cargo_c, bump version (#9722)

This commit is contained in:
Schrijvers Luc
2023-11-02 08:47:50 +00:00
committed by GitHub
parent b2e3e0c0ee
commit 7021a96ec2
3 changed files with 45 additions and 132 deletions

View File

@@ -1,72 +0,0 @@
SUMMARY="Cargo applet to build and install C-ABI compatibile dynamic and static libraries"
DESCRIPTION="It produces and installs a correct pkg-config file, a static \
library and a dynamic library, and a C header to be used by any C (and \
C-compatible) software."
HOMEPAGE="https://github.com/lu-zero/cargo-c"
COPYRIGHT="2020 Luca Barbato"
LICENSE="MIT"
REVISION="3"
SOURCE_URI="https://github.com/lu-zero/cargo-c/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="7c649061826e0ad3c2c8735718f4a0c4afd12eed9b9fdc5fe59e34582902e1c5"
SOURCE_URI_2="https://github.com/lu-zero/cargo-c/releases/download/v$portVersion/Cargo.lock#noarchive"
CHECKSUM_SHA256_2="11f23a09ef06ca2125027e24574124a99089863fb4226570b6adbe317848b670"
SOURCE_DIR="cargo-c-$portVersion"
PATCHES="cargo_c-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
cargo_c$secondaryArchSuffix
cmd:cargo_capi = $portVersion
cmd:cargo_cbuild = $portVersion
cmd:cargo_cinstall = $portVersion
cmd:cargo_ctest = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libgit2$secondaryArchSuffix
lib:libssh2$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcrypto$secondaryArchSuffix
devel:libcurl$secondaryArchSuffix
devel:libgit2$secondaryArchSuffix
devel:libssh2$secondaryArchSuffix
devel:libssl$secondaryArchSuffix >= 1.1
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cargo$secondaryArchSuffix >= 0.70
cmd:gcc$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cp $sourceDir2/Cargo.lock Cargo.lock
cargo fetch --locked
}
INSTALL()
{
export LIBSSH2_SYS_USE_PKG_CONFIG=1
export LIBGIT2_SYS_USE_PKG_CONFIG=1
export PKG_CONFIG_ALLOW_CROSS=1
cargo install --locked --root $prefix --path .
rm -f $prefix/{.crates.toml,.crates2.json}
}
TEST()
{
cargo test --release
}

View File

@@ -0,0 +1,45 @@
SUMMARY="Cargo applet to build and install C-ABI compatibile dynamic and static libraries"
DESCRIPTION="It produces and installs a correct pkg-config file, a static \
library and a dynamic library, and a C header to be used by any C (and \
C-compatible) software."
HOMEPAGE="https://github.com/lu-zero/cargo-c"
COPYRIGHT="2020 Luca Barbato"
LICENSE="MIT"
REVISION="1"
if [ "$targetArchitecture" = x86_gcc2 ]; then
srcGitRev="cdd0b630eedd53ae6d89cfec9ee0cea8fa83b124"
SOURCE_URI="https://github.com/Begasus/cargo-c/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="39da8945db1ee54f051ea69b04d2c0a9c765baffab2c4871427c1d1f96b29e03"
SOURCE_DIR="cargo-c-$srcGitRev/32bit"
elif [ "$targetArchitecture" = x86_64 ]; then
srcGitRev="a703bd97a18326396b7805aa75a6444796fe4605"
SOURCE_URI="https://github.com/Begasus/cargo-c/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="0af0cef06db1aa7d46ca6ce60ad89bc1ca0c3705c51a7f80f6f87e0b2b84d8f7"
SOURCE_DIR="cargo-c-$srcGitRev/64bit"
fi
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
cargo_c_bin$secondaryArchSuffix
cmd:cargo_capi = $portVersion
cmd:cargo_cbuild = $portVersion
cmd:cargo_cinstall = $portVersion
cmd:cargo_ctest = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libgit2$secondaryArchSuffix
lib:libssh2$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
INSTALL()
{
mkdir $prefix/bin
cp * $prefix/bin
}

View File

@@ -1,60 +0,0 @@
From d749dcc1b6a4fe8aee785def086a6fdbc9bec9bb Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Mon, 6 Jun 2022 08:36:19 +0200
Subject: Add support for Haiku
diff --git a/src/build_targets.rs b/src/build_targets.rs
index c0e5240..300af37 100644
--- a/src/build_targets.rs
+++ b/src/build_targets.rs
@@ -81,7 +81,8 @@ impl BuildTargets {
| ("freebsd", _)
| ("dragonfly", _)
| ("netbsd", _)
- | ("android", _) => {
+ | ("android", _)
+ | ("haiku", _) => {
let static_lib = targetdir.join(&format!("lib{}.a", lib_name));
let shared_lib = targetdir.join(&format!("lib{}.so", lib_name));
(shared_lib, static_lib, None, None)
diff --git a/src/install.rs b/src/install.rs
index f958c72..864c627 100644
--- a/src/install.rs
+++ b/src/install.rs
@@ -84,9 +84,12 @@ impl LibType {
let env = &target.env;
match (os.as_str(), env.as_str()) {
- ("linux", _) | ("freebsd", _) | ("dragonfly", _) | ("netbsd", _) | ("android", _) => {
- LibType::So
- }
+ ("linux", _)
+ | ("freebsd", _)
+ | ("dragonfly", _)
+ | ("netbsd", _)
+ | ("android", _)
+ | ("haiku", _) => LibType::So,
("macos", _) | ("ios", _) => LibType::Dylib,
("windows", _) => LibType::Windows,
_ => unimplemented!("The target {}-{} is not supported yet", os, env),
diff --git a/src/target.rs b/src/target.rs
index 79ab283..f447f2d 100644
--- a/src/target.rs
+++ b/src/target.rs
@@ -72,7 +72,11 @@ impl Target {
if os == "android" {
lines.push(format!("-Wl,-soname,lib{}.so", lib_name));
} else if env != "musl"
- && (os == "linux" || os == "freebsd" || os == "dragonfly" || os == "netbsd")
+ && (os == "linux"
+ || os == "freebsd"
+ || os == "dragonfly"
+ || os == "netbsd"
+ || os == "haiku")
{
lines.push(format!("-Wl,-soname,lib{}.so.{}", lib_name, major));
} else if os == "macos" || os == "ios" {
--
2.36.1