# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python class Recipe(recipe.Recipe): name = 'cargo-c' version = '0.9.30' stype = SourceType.TARBALL btype = BuildType.CARGO url = 'https://github.com/lu-zero/cargo-c/archive/refs/tags/v0.9.30.tar.gz' tarball_checksum = '174cfc3a69263c3e54b95e00c4bd61b13377f7f72d4bf60aa714fd9e7ed3849c' tarball_dirname = '%(name)s-%(version)s' # Get this from the release page on github cargo_lock = f'{name}/{version}-Cargo.lock' # Need system openssl on Linux use_system_libs = True deps = ['zlib', 'pkg-config'] # Need openssl on macOS. On Windows, a prebuilt openssl crate is downloaded. platform_deps = { Platform.DARWIN: ['openssl'], } files_bins = ['cargo-capi', 'cargo-cbuild', 'cargo-cinstall', 'cargo-ctest'] def prepare(self): if self.config.platform == Platform.DARWIN: self.set_env('OPENSSL_LIB_DIR', self.config.libdir) self.set_env('OPENSSL_INCLUDE_DIR', os.path.join(self.config.prefix, 'include')) self.set_env('RUSTFLAGS', "-C link-args=-Wl,-headerpad_max_install_names")