Skip to content

Commit

Permalink
(ref) osx: MACOS_DEPLOY + time
Browse files Browse the repository at this point in the history
  • Loading branch information
MementoRC committed Dec 11, 2024
1 parent e0e0ed7 commit cf9fa3e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions recipes/keepawake-rs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

set -euxo pipefail

export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=$CC
export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=$CC

BINDGEN_EXTRA_CLANG_ARGS="-v ${CPPFLAGS} ${CFLAGS}"
if [[ "${target_platform}" == osx-arm64 ]]; then
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=aarch64-apple-darwin"
else
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=x86_64-apple-darwin13.4.0"
fi
export BINDGEN_EXTRA_CLANG_ARGS="$(echo "${BINDGEN_EXTRA_CLANG_ARGS}" | sed 's/ /\n/g' | sort -u | paste -s -d ' ' -)"
export LIBCLANG_PATH=${BUILD_PREFIX}/lib

cargo build --release --all-targets
# Skip doc-test which fails to find cc as a linker (odd, since it can build just fine)
cargo test --release --all-targets
Expand Down
6 changes: 6 additions & 0 deletions recipes/keepawake-rs/patches/osx-update-time.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--- a/Cargo.toml.orig 2021-09-23 14:00:00.000000000 +0000
+++ b/Cargo.toml 2021-09-23 14:00:00.000000000 +0000
@@ -42,2 +42,3 @@
sysinfo = { version = "0.30.5", optional = true }
+time = "0.3.35"
thiserror = "1.0.56"
9 changes: 9 additions & 0 deletions recipes/keepawake-rs/variant_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
c_stdlib_version:
- if: osx
then:
- 10.13
MACOSX_DEPLOYEMENT_TARGET:
- if: osx
then:
- 10.13

0 comments on commit cf9fa3e

Please sign in to comment.