Skip to content

Commit ce1052e

Browse files
committed
Support for macOS
1 parent 0be5278 commit ce1052e

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

.github/workflows/wheels.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ jobs:
1111
# os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]
1212
# os: [ubuntu-latest]
1313
# os: [windows-2019] #latest]
14-
os: [ubuntu-latest, windows-2019, ubuntu-24.04-arm]
14+
# os: [macos-latest]
15+
os: [ubuntu-latest, windows-2019, ubuntu-24.04-arm, macos-13, macos-latest]
1516

1617
steps:
1718
- uses: actions/checkout@v4
1819

20+
- name: Install bootstrap Python (macOS only)
21+
if: runner.os == 'macOS'
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: '3.8'
25+
1926
# Apply patch only on Windows
2027
- name: Apply header patch on Windows
2128
if: matrix.os == 'windows-latest'
@@ -48,6 +55,39 @@ jobs:
4855
# since commands are executed in a UNIX-like shell expecting 'mkdir -p'
4956
CIBW_ENVIRONMENT: "MSYSCON=y"
5057
CIBW_BUILD_VERBOSITY: 1
58+
# CIBW_REPAIR_WHEEL_COMMAND_MACOS: 'delocate-wheel -w {dest_dir} -v {wheel}'
59+
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
60+
sh -c '
61+
set -e
62+
WHEEL_IN="{wheel}";
63+
WHEEL_OUT="{dest_dir}";
64+
TMP_DIR=$(mktemp -d);
65+
unzip -q "$WHEEL_IN" -d "$TMP_DIR";
66+
67+
BIN_DIR="$TMP_DIR/ecdev/bin";
68+
BACKUP_BIN=$(mktemp -d);
69+
if [ -d "$BIN_DIR" ]; then
70+
mv "$BIN_DIR" "$BACKUP_BIN";
71+
fi;
72+
73+
# Re-zip into a temporary wheel (without the executables)
74+
TMP_WHEEL="$TMP_DIR/temp.whl";
75+
(cd "$TMP_DIR" && zip -qr "$TMP_WHEEL" .);
76+
77+
# Run delocate on that stripped wheel
78+
delocate-wheel -w "$WHEEL_OUT" "$TMP_WHEEL";
79+
80+
# Restore executables to the repaired wheel
81+
REPAIRED_WHEEL="$WHEEL_OUT/$(basename "$WHEEL_IN")";
82+
REPAIR_TMP=$(mktemp -d);
83+
unzip -q "$REPAIRED_WHEEL" -d "$REPAIR_TMP";
84+
if [ -d "$BACKUP_BIN/bin" ]; then
85+
cp -R "$BACKUP_BIN/bin" "$REPAIR_TMP/ecdev/";
86+
fi;
87+
88+
# Repack final wheel with everything
89+
(cd "$REPAIR_TMP" && zip -qr "$REPAIRED_WHEEL" .);
90+
'
5191
5292
# CIBW_SOME_OPTION: value
5393
# CIBW_BEFORE_BUILD: |

eC

Submodule eC updated 63 files

0 commit comments

Comments
 (0)