Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH OSX sysroot/sdk package #23777

Merged
merged 61 commits into from
Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
d2ea1ed
WIP something like this
beckermr Aug 23, 2023
cfe0f91
Create LICENSE
beckermr Aug 23, 2023
2e7995b
Update meta.yaml
beckermr Aug 23, 2023
6b02b86
Update meta.yaml
beckermr Aug 23, 2023
721729d
Update meta.yaml
beckermr Aug 23, 2023
07449f8
WIP try this
beckermr Aug 24, 2023
9837662
merge
beckermr Aug 24, 2023
74a101f
try again
beckermr Aug 24, 2023
7dbd4b4
test
beckermr Aug 24, 2023
1665582
more lint
beckermr Aug 24, 2023
d74309e
ENH download SDKs and get constraints right
beckermr Aug 24, 2023
205028b
Merge branch 'main' into osx-sdk
beckermr Aug 24, 2023
d13f093
fix lint
beckermr Aug 24, 2023
6dd5a5c
Merge branch 'osx-sdk' of https://github.com/beckermr/staged-recipes …
beckermr Aug 24, 2023
846b874
bug need all the files
beckermr Aug 24, 2023
cb0942a
rezip things
beckermr Aug 24, 2023
ddb3c46
quotes
beckermr Aug 24, 2023
a181c55
quotes
beckermr Aug 24, 2023
055f84e
Update conda_build_config.yaml
beckermr Aug 24, 2023
b631db8
BUG current setup makes new one not work
beckermr Aug 24, 2023
d2646fe
bugz again
beckermr Aug 24, 2023
57de817
Merge branch 'main' into osx-sdk
beckermr Aug 24, 2023
5b3ac1f
BUG wrong thing copied
beckermr Aug 24, 2023
6d6eb99
Merge branch 'osx-sdk' of https://github.com/beckermr/staged-recipes …
beckermr Aug 24, 2023
c95b866
Merge branch 'main' into osx-sdk
beckermr Aug 24, 2023
f3f42e3
ENH move over a bunch of compiler stuff
beckermr Aug 24, 2023
18a8227
do not use future sysroots with old sdks
beckermr Aug 24, 2023
47ec1a7
ENH enable two defaults with extra feature for 10.x SDKs
beckermr Aug 24, 2023
1ebe2a5
maybe this
beckermr Aug 24, 2023
d83f0a5
maybe this
beckermr Aug 24, 2023
08d41cc
BUG use -s
beckermr Aug 24, 2023
7093e1c
bugz
beckermr Aug 24, 2023
e1b15cd
one more
beckermr Aug 25, 2023
91b80ea
ENH adjust features again
beckermr Aug 25, 2023
ec5b9c6
fix
beckermr Aug 25, 2023
c724c14
add system sdk as version 1
beckermr Aug 25, 2023
5a4ac19
Merge branch 'main' into osx-sdk
beckermr Aug 25, 2023
18e0576
rename
beckermr Aug 25, 2023
e1b57f1
Merge branch 'osx-sdk' of https://github.com/beckermr/staged-recipes …
beckermr Aug 25, 2023
1dba225
bug only run system sdk on osx
beckermr Aug 25, 2023
cca78f3
make a dir
beckermr Aug 25, 2023
8870a63
debug symlink
beckermr Aug 25, 2023
af5f7e5
fixed the bugz
beckermr Aug 25, 2023
e82d63b
i think I got it
beckermr Aug 25, 2023
d9115f9
Merge branch 'main' into osx-sdk
beckermr Aug 25, 2023
a4a497f
Update recipes/osx-sysroot/meta.yaml
beckermr Aug 27, 2023
9cd57c5
Update recipes/osx-sysroot/meta.yaml
beckermr Aug 27, 2023
e0b46e3
REF try this version
beckermr Aug 28, 2023
f650452
merged
beckermr Aug 28, 2023
3f34a30
better error message
beckermr Aug 28, 2023
39957fa
try this
beckermr Aug 28, 2023
b5768cc
add sdk versions and fix a bug
beckermr Aug 28, 2023
61540ad
comments
beckermr Aug 28, 2023
38e4b13
bug in deactivate
beckermr Aug 28, 2023
0804eff
spacing
beckermr Aug 28, 2023
e419165
BUG make sure works for bash and zsh
beckermr Aug 28, 2023
4b8567a
ENH respond to code review
beckermr Aug 28, 2023
3e5ecd9
Merge branch 'main' into osx-sdk
beckermr Aug 28, 2023
26c44e6
Merge branch 'main' into osx-sdk
beckermr Aug 29, 2023
1c3c1bd
Merge branch 'main' into osx-sdk
beckermr Aug 30, 2023
55270f5
Merge branch 'main' into osx-sdk
beckermr Aug 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions recipes/osx-sysroot/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
BSD-3-Clause license
Copyright (c) 2015-2023, conda-forge contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
20 changes: 20 additions & 0 deletions recipes/osx-sysroot/activate-mdt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if [ -z "$MACOSX_DEPLOYMENT_TARGET" ]; then
export MACOSX_DEPLOYMENT_TARGET="@MACOSX_DEPLOYMENT_TARGET@"
else
export CONDA_SYSROOT_@PLATFORM@_BACKUP_MACOSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET}"
export MACOSX_DEPLOYMENT_TARGET="@MACOSX_DEPLOYMENT_TARGET@"
fi

if [ -z "${CMAKE_ARGS}" ]; then
export CMAKE_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}"
else
export CONDA_SYSROOT_@PLATFORM@_BACKUP_CMAKE_ARGS="${CMAKE_ARGS}"
export CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}"
fi

if [ -z "${CPPFLAGS}" ]; then
export CPPFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
else
export CONDA_SYSROOT_@PLATFORM@_BACKUP_CPPFLAGS="${CPPFLAGS}"
export CPPFLAGS="${CPPFLAGS} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
fi
15 changes: 15 additions & 0 deletions recipes/osx-sysroot/build_mdt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

find "${RECIPE_DIR}" -name "activate-mdt.sh" -exec cp {} . \;
find "${RECIPE_DIR}" -name "deactivate-mdt.sh" -exec cp {} . \;

find . -name "activate-mdt.sh" -exec sed -i.bak "s|@MACOSX_DEPLOYMENT_TARGET@|${_MACOSX_DEPLOYMENT_TARGET_}|g" "{}" \;
find . -name "activate-mdt.sh" -exec sed -i.bak "s|@PLATFORM@|${cross_target_platform//-/_}|g" "{}" \;
find . -name "activate-mdt.sh.bak" -exec rm "{}" \;

find . -name "deactivate-mdt.sh" -exec sed -i.bak "s|@PLATFORM@|${cross_target_platform//-/_}|g" "{}" \;
find . -name "deactivate-mdt.sh.bak" -exec rm "{}" \;

mkdir -p "${PREFIX}"/etc/conda/{de,}activate.d/
cp "${SRC_DIR}"/activate-mdt.sh "${PREFIX}"/etc/conda/activate.d/activate_"${PKG_NAME}".sh
cp "${SRC_DIR}"/deactivate-mdt.sh "${PREFIX}"/etc/conda/deactivate.d/deactivate_"${PKG_NAME}".sh
22 changes: 22 additions & 0 deletions recipes/osx-sysroot/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
_MACOSX_DEPLOYMENT_TARGET_:
- "10.9"
- "10.10"
- "10.11"
- "10.12"
- "10.13"
- "10.13"
- "10.14"
- "10.15"
- "11.0"
- "11.1"
- "11.3"
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
- "12.0"
- "12.1"
- "12.3"
- "13.0"
- "13.1"
- "13.3"

cross_target_platform:
- osx-64
- osx-arm64
20 changes: 20 additions & 0 deletions recipes/osx-sysroot/deactivate-mdt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if [ -n "${CONDA_SYSROOT_@PLATFORM@_BACKUP_MACOSX_DEPLOYMENT_TARGET}" ]; then
export MACOSX_DEPLOYMENT_TARGET="${CONDA_SYSROOT_@PLATFORM@_BACKUP_MACOSX_DEPLOYMENT_TARGET}"
unset CONDA_SYSROOT_@PLATFORM@_BACKUP_MACOSX_DEPLOYMENT_TARGET
else
unset MACOSX_DEPLOYMENT_TARGET
fi

if [ -n "${CONDA_SYSROOT_@PLATFORM@_BACKUP_CMAKE_ARGS}" ]; then
export CMAKE_ARGS="${CONDA_SYSROOT_@PLATFORM@_BACKUP_CMAKE_ARGS}"
unset CONDA_SYSROOT_@PLATFORM@_BACKUP_CMAKE_ARGS
else
unset CMAKE_ARGS
fi

if [ -n "${CONDA_SYSROOT_@PLATFORM@_BACKUP_CPPFLAGS}" ]; then
export CPPFLAGS="${CONDA_SYSROOT_@PLATFORM@_BACKUP_CPPFLAGS}"
unset CONDA_SYSROOT_@PLATFORM@_BACKUP_CPPFLAGS
else
unset CPPFLAGS
fi
36 changes: 36 additions & 0 deletions recipes/osx-sysroot/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% set name = "osx-sysroot" %}
{% set version = "1" %}

package:
name: {{ name|lower }}
version: {{ version }}

build:
number: 0
{% if cross_target_platform == "osx-arm64" and _MACOSX_DEPLOYMENT_TARGET_[0:2]|int < 11 %}
skip: True
{% endif %}
beckermr marked this conversation as resolved.
Show resolved Hide resolved

outputs:
- name: macosx_deployment_target_{{ cross_target_platform }}
version: {{ _MACOSX_DEPLOYMENT_TARGET_ }}
script: build_mdt.sh
build:
noarch: generic
run_exports:
strong:
- __osx >={{ _MACOSX_DEPLOYMENT_TARGET_ }}
test:
commands:
- "[[ ${MACOSX_DEPLOYMENT_TARGET} == '{{ _MACOSX_DEPLOYMENT_TARGET_ }}' ]]"

about:
home: https://github.com/conda-forge/osx-sysroot-feedstock
summary: metapackage to set the MACOSX_DEPLOYMENT_TARGET
license: BSD-3-Clause
license_family: BSD
license_file: LICENSE

extra:
recipe-maintainers:
- beckermr
Loading