-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is based on @nikitalita's script on fugashi's repo. See details in polm/fugashi#80
- Loading branch information
Showing
2 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
X86_TRIPLET=x86_64-apple-macos10.9 | ||
ARM_TRIPLET=arm64-apple-macos11 | ||
|
||
git clone --depth=1 https://github.com/neubig/kytea.git | ||
cd kytea | ||
|
||
rm -rf src/lib/.libs-arm64 src/lib/.libs-x86_64 src/lib/.libs.combined | ||
|
||
./configure --host="arm-apple-darwin22.1.0 " CXX="clang++ -target $ARM_TRIPLET" CC="clang -target $ARM_TRIPLET" | ||
|
||
make clean | ||
make -j$(sysctl -n hw.logicalcpu_max) | ||
|
||
mv src/lib/.libs src/lib/.libs-arm64 | ||
|
||
./configure --host="x86_64-apple-darwin20.6.0" CXX="clang++ -target $X86_TRIPLET" CC="clang -target $X86_TRIPLET" | ||
|
||
make clean | ||
make -j$(sysctl -n hw.logicalcpu_max) | ||
|
||
mv src/lib/.libs src/lib/.libs-x86_64 | ||
|
||
rm -rf src/lib/.libs.combined | ||
mkdir src/lib/.libs.combined | ||
|
||
lipo -create src/lib/.libs-arm64/libkytea.0.dylib src/lib/.libs-x86_64/libkytea.0.dylib -output src/lib/.libs.combined/libkytea.0.dylib | ||
|
||
lipo -create src/lib/.libs-arm64/libkytea.a src/lib/.libs-x86_64/libkytea.a -output src/lib/.libs.combined/libkytea.a | ||
|
||
cp src/lib/.libs-arm64/libkytea.lai src/lib/.libs.combined/libkytea.lai | ||
|
||
ls -l src/lib/.libs-arm64/*.o | wihle read line; do | ||
file=$(basename $file) | ||
echo $file | ||
lipo -create src/lib/.libs-arm64/$file src/lib/.libs-x86_64/$file -output src/lib/.libs.combined/$file | ||
done | ||
|
||
cd src/lib/.libs.combined | ||
ln -s libkytea.0.dylib libkytea.dylib | ||
ln -s ../libkytea.a libkytea.a | ||
cd ../../.. | ||
mv src/lib/.libs.combined src/lib/.libs | ||
|
||
sudo make install | ||
cd .. | ||
|
||
python -m cibuildwheel --output-dir wheelhouse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters