-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#23387) macdylibbundler: Add build tool for macOS
* Add recipe for macdylibbundler * Use can_run guard for test_package
- Loading branch information
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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: | ||
"1.0.5": | ||
url: "https://github.com/auriamg/macdylibbundler/archive/refs/tags/1.0.5.tar.gz" | ||
sha256: "13384ebe7ca841ec392ac49dc5e50b1470190466623fa0e5cd30f1c634858530" |
This file contains 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,50 @@ | ||
from conan import ConanFile | ||
from conan.tools.apple import is_apple_os | ||
from conan.tools.files import copy, get | ||
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout | ||
from conan.errors import ConanInvalidConfiguration | ||
|
||
import os | ||
|
||
required_conan_version = ">=1.53.0" | ||
|
||
|
||
class MacDylibBundlerConan(ConanFile): | ||
name = "macdylibbundler" | ||
package_type = "application" | ||
description = ( | ||
"mac dylib bundler is a tool for use when bundling mac applications" | ||
) | ||
topics = ("build", "dylib", "installer", "mac") | ||
url = "https://github.com/conan-io/conan-center-index" | ||
homepage = "https://github.com/auriamg/macdylibbundler" | ||
license = "MIT" | ||
settings = "os", "arch", "build_type" | ||
|
||
def layout(self): | ||
cmake_layout(self, src_folder="src") | ||
|
||
def validate(self): | ||
if not is_apple_os(self): | ||
raise ConanInvalidConfiguration("This tool is for macOS only") | ||
|
||
def source(self): | ||
get(self, **self.conan_data["sources"][self.version], strip_root=True) | ||
|
||
def generate(self): | ||
tc = CMakeToolchain(self) | ||
tc.generate() | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def package(self): | ||
copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) | ||
# The CMakeLists.txt misses the install command, so for simplicity the executable is copied manually | ||
copy(self, "dylibbundler", src=self.build_folder, dst=os.path.join(self.package_folder, "bin")) | ||
|
||
def package_info(self): | ||
self.cpp_info.includedirs = [] | ||
self.cpp_info.libdirs = [] |
This file contains 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,15 @@ | ||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "build_type" | ||
generators = "VirtualBuildEnv" | ||
test_type = "explicit" | ||
|
||
def build_requirements(self): | ||
self.tool_requires(self.tested_reference_str) | ||
|
||
def test(self): | ||
if can_run(self): | ||
self.run("dylibbundler -h") |
This file contains 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: | ||
"1.0.5": | ||
folder: all |