Skip to content

Commit

Permalink
Merge pull request #42 from garymm/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
LehMaxence authored May 1, 2024
2 parents 412fdd1 + da6cdaa commit 8bf7df7
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .azure-pipelines/azure-pipelines-osx.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MACOSX_DEPLOYMENT_TARGET:
- '11.0'
c_compiler:
- clang
c_compiler_version:
- '16'
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- clangxx
cxx_compiler_version:
- '16'
macos_machine:
- arm64-apple-darwin20.0.0
target_platform:
- osx-arm64
zip_keys:
- - c_compiler_version
- cxx_compiler_version
zlib:
- '1.2'
7 changes: 7 additions & 0 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions conda-forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ github:
tooling_branch_name: main
conda_build:
pkg_format: '2'
build_platform:
osx_arm64: osx_64
30 changes: 25 additions & 5 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,29 @@ if [[ $target_platform == "linux-"* ]]; then
export LIBS="-lrt $LIBS"
fi

./configure \
--enable-shared \
--prefix=$PREFIX
BUILD_ARCH=${CONDA_TOOLCHAIN_BUILD%%-*}
HOST_ARCH=${CONDA_TOOLCHAIN_HOST%%-*}

make -j${CPU_COUNT} check
make install
configure_cmd=(./configure --enable-shared --prefix=$PREFIX)

# cross-compiling needs to use prebuilt capnp
# https://github.com/capnproto/capnproto/issues/1815#issuecomment-1732327995
# We should install this using meta.yaml, but currently capnproto requires
# openSSL 1.1, which conflicts with some other dependencies, so we have to
# install it here with --no-deps.
# TODO: remove this when capnproto is updated to use openSSL 3.
if [[ "${BUILD_ARCH}" != "${HOST_ARCH}" ]]; then
mamba install --no-deps --yes capnproto
configure_cmd+=("--with-external-capnp")
fi

"${configure_cmd[@]}"

make_cmd=(make -j${CPU_COUNT})
if [[ "${BUILD_ARCH}" == "${HOST_ARCH}" ]]; then
make_cmd+=(check)
fi

"${make_cmd[@]}"

make install
16 changes: 8 additions & 8 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source:
md5: 4dd1aaacff63781087e89097f9b02542

build:
number: 0
number: 1
run_exports:
# soname changes with every release
# https://abi-laboratory.pro/index.php?view=timeline&l=capnproto
Expand All @@ -31,19 +31,19 @@ requirements:
- zlib
- openssl 1.1*
run:
- __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }} # [osx and x86_64]
- __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }} # [osx]

test:
source_files:
- c++/samples
commands:
- capnp --help
- capnpc --help
- capnpc-c++ --help
- capnpc-capnp --help
- capnp --help # [not (osx and arm64)]
- capnpc --help # [not (osx and arm64)]
- capnpc-c++ --help # [not (osx and arm64)]
- capnpc-capnp --help # [not (osx and arm64)]

- capnpc -I"$PREFIX/include" -oc++ c++/samples/addressbook.capnp # [unix]
- test -f c++/samples/addressbook.capnp.c++ # [unix]
- capnpc -I"$PREFIX/include" -oc++ c++/samples/addressbook.capnp # [unix and (not (osx and arm64))]
- test -f c++/samples/addressbook.capnp.c++ # [unix and (not (osx and arm64))]

- capnpc -I"%LIBRARY_INC%" -oc++ c++/samples/addressbook.capnp # [win]
- if not exist c++/samples/addressbook.capnp.c++ exit 1 # [win]
Expand Down

0 comments on commit 8bf7df7

Please sign in to comment.