-
Notifications
You must be signed in to change notification settings - Fork 2.1k
libobjc2: Add new recipe for 2.2.1 #27957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
qmfrederik
wants to merge
7
commits into
conan-io:master
Choose a base branch
from
qmfrederik:recipes/libobjc2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+121
−0
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a43a542
libobjc2: Add new recipe for 2.2.1
qmfrederik 1dec31d
Cleanups
AbrilRBS 940689d
Fix linting errors, macOS is not supported
qmfrederik 63b5ed1
Minor tweaks
perseoGI fb5dff8
Update recipes/libobjc2/all/conanfile.py
ErniGH 7e80de2
Update recipes/libobjc2/all/conanfile.py
ErniGH c709d71
Update recipes/libobjc2/all/conanfile.py
ErniGH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| sources: | ||
| "2.2.1": | ||
| url: "https://github.com/gnustep/libobjc2/archive/v2.2.1.zip" | ||
| sha256: "b0afc1d98a6f7208fb5ce1fc8b5848b5ba6dba1f4fcd755fbe3fc78b5e4b3308" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| from conan import ConanFile | ||
| from conan.errors import ConanInvalidConfiguration | ||
| from conan.tools.apple import is_apple_os | ||
| from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout | ||
| from conan.tools.files import copy, get, rm, rmdir | ||
| import os | ||
|
|
||
| required_conan_version = ">=2.1" | ||
|
|
||
| class PackageConan(ConanFile): | ||
| name = "libobjc2" | ||
| description = "Objective-C runtime library intended for use with Clang." | ||
| license = "MIT" | ||
| url = "https://github.com/conan-io/conan-center-index" | ||
| homepage = "https://github.com/gnustep/libobjc2" | ||
| topics = ("objective-c", "objective-c-plus-plus", "clang", "gnustep", "objective-c-runtime", "runtime-library") | ||
| package_type = "library" | ||
| settings = "os", "arch", "compiler", "build_type" | ||
| options = { | ||
| "shared": [True, False], | ||
| "fPIC": [True, False], | ||
| } | ||
| default_options = { | ||
| "shared": False, | ||
| "fPIC": True, | ||
| } | ||
| implements = ["auto_shared_fpic"] | ||
|
|
||
| def layout(self): | ||
| cmake_layout(self, src_folder="src") | ||
|
|
||
| def requirements(self): | ||
| self.requires("tsl-robin-map/1.2.1") | ||
|
|
||
| def validate(self): | ||
| if self.settings.compiler != "clang": | ||
| raise ConanInvalidConfiguration("libobjc2 supports clang only.") | ||
|
|
||
| if is_apple_os(self): | ||
| raise ConanInvalidConfiguration("libobjc2 does not support macOS.") | ||
|
|
||
| def build_requirements(self): | ||
| self.tool_requires("cmake/[>=3.16 <5]") | ||
|
|
||
| def source(self): | ||
| get(self, **self.conan_data["sources"][self.version], strip_root=True) | ||
| replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_CXX_STANDARD 17)", "") | ||
|
|
||
| def generate(self): | ||
| tc = CMakeToolchain(self) | ||
| # Prevent picking up a default install location through gnustep-config | ||
| tc.cache_variables["GNUSTEP_INSTALL_TYPE"] = "NONE" | ||
| tc.generate() | ||
|
|
||
| deps = CMakeDeps(self) | ||
| deps.generate() | ||
|
|
||
| def build(self): | ||
| cmake = CMake(self) | ||
| cmake.configure() | ||
| cmake.build() | ||
|
|
||
| def package(self): | ||
| copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) | ||
| cmake = CMake(self) | ||
| cmake.install() | ||
|
|
||
| rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) | ||
| rm(self, "*.pdb", self.package_folder, recursive=True) | ||
|
|
||
| def package_info(self): | ||
| self.cpp_info.libs = ["objc"] | ||
ErniGH marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| self.cpp_info.set_property("pkg_config_name", "libobjc") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| cmake_minimum_required(VERSION 3.15) | ||
| project(test_package LANGUAGES C) | ||
|
|
||
| find_package(libobjc2 REQUIRED CONFIG) | ||
|
|
||
| add_executable(${PROJECT_NAME} test_package.c) | ||
| target_link_libraries(${PROJECT_NAME} PRIVATE libobjc2::libobjc2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| from conan import ConanFile | ||
| from conan.tools.build import can_run | ||
| from conan.tools.cmake import cmake_layout, CMake | ||
| import os | ||
|
|
||
|
|
||
| class TestPackageConan(ConanFile): | ||
| settings = "os", "arch", "compiler", "build_type" | ||
| generators = "CMakeDeps", "CMakeToolchain" | ||
|
|
||
| def layout(self): | ||
| cmake_layout(self) | ||
|
|
||
| def requirements(self): | ||
| self.requires(self.tested_reference_str) | ||
|
|
||
| def build(self): | ||
| cmake = CMake(self) | ||
| cmake.configure() | ||
| cmake.build() | ||
|
|
||
| def test(self): | ||
| if can_run(self): | ||
| bin_path = os.path.join(self.cpp.build.bindir, "test_package") | ||
| self.run(bin_path, env="conanrun") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #include <stdlib.h> | ||
| #include "objc/objc.h" | ||
| #include "objc/encoding.h" | ||
|
|
||
| int main(void) { | ||
| char type = _C_CLASS; | ||
| objc_sizeof_type(&type); | ||
| return EXIT_SUCCESS; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| versions: | ||
| "2.2.1": | ||
| folder: all |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.