Skip to content

Commit

Permalink
Try xcframework
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Mar 31, 2024
1 parent 5dd25f5 commit 4321cdc
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 151 deletions.
49 changes: 48 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,30 @@ jobs:
with:
path: ./${{ env.install_path }}/**
name: ${{ env.install_path }}
ios-arm64-sim:
# The type of runner that the job will run on
runs-on: macos-12
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
id: setup-xcode
with:
xcode-version: '${{ env.GH_XCODE_VER }}'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build
shell: pwsh
run: ./build.ps1 -p ios -a arm64 -sdk simulator
- name: Upload
uses: actions/upload-artifact@v4
with:
path: ./${{ env.install_path }}/**
name: ${{ env.install_path }}

tvos:
# The type of runner that the job will run on
Expand Down Expand Up @@ -167,7 +191,30 @@ jobs:
with:
path: ./${{ env.install_path }}/**
name: ${{ env.install_path }}

tvos-arm64-sim:
# The type of runner that the job will run on
runs-on: macos-12
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
id: setup-xcode
with:
xcode-version: '${{ env.GH_XCODE_VER }}'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build
shell: pwsh
run: ./build.ps1 -p tvos -a arm64 -sdk simulator
- name: Upload
uses: actions/upload-artifact@v4
with:
path: ./${{ env.install_path }}/**
name: ${{ env.install_path }}
android:
# The type of runner that the job will run on
runs-on: ubuntu-latest
Expand Down
65 changes: 38 additions & 27 deletions src/cares/dist1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,44 @@ DIST_DIR="${DIST_ROOT}/${LIB_NAME}"

dist_lib ${LIB_NAME} ${DIST_DIR} $DISTF_NATIVES

# create flat lib for ios
if [ -f "install_ios_arm/${LIB_NAME}/lib/libcares.a" ] ; then
lipo -create install_ios_arm/${LIB_NAME}/lib/libcares.a install_ios_arm64/${LIB_NAME}/lib/libcares.a install_ios_x64/${LIB_NAME}/lib/libcares.a -output ${DIST_DIR}/lib/ios/libcares.a
else
lipo -create install_ios_arm64/${LIB_NAME}/lib/libcares.a install_ios_x64/${LIB_NAME}/lib/libcares.a -output ${DIST_DIR}/lib/ios/libcares.a
fi

# create flat lib for tvos
if [ -f "install_tvos_arm/${LIB_NAME}/lib/libcares.a" ] ; then
lipo -create install_tvos_arm/${LIB_NAME}/lib/libcares.a install_tvos_arm64/${LIB_NAME}/lib/libcares.a install_tvos_x64/${LIB_NAME}/lib/libcares.a -output ${DIST_DIR}/lib/tvos/libcares.a
else
lipo -create install_tvos_arm64/${LIB_NAME}/lib/libcares.a install_tvos_x64/${LIB_NAME}/lib/libcares.a -output ${DIST_DIR}/lib/tvos/libcares.a
fi

# check the flat lib
lipo -info ${DIST_DIR}/lib/ios/libcares.a

# check the flat lib
lipo -info ${DIST_DIR}/lib/tvos/libcares.a


# create fat lib for mac
lipo -create install_osx_arm64/${LIB_NAME}/lib/libcares.a install_osx_x64/${LIB_NAME}/lib/libcares.a -output ${DIST_DIR}/lib/mac/libcares.a


# check the fat lib
lipo -info ${DIST_DIR}/lib/mac/libcares.a
# # create flat lib for ios
# if [ -f "install_ios_arm/${LIB_NAME}/lib/libcares.a" ] ; then
# lipo -create install_ios_arm/${LIB_NAME}/lib/libcares.a install_ios_arm64/${LIB_NAME}/lib/libcares.a install_ios_x64/${LIB_NAME}/lib/libcares.a -output ${DIST_DIR}/lib/ios/libcares.a
# else
# lipo -create install_ios_arm64/${LIB_NAME}/lib/libcares.a install_ios_x64/${LIB_NAME}/lib/libcares.a -output ${DIST_DIR}/lib/ios/libcares.a
# fi

# # create flat lib for tvos
# if [ -f "install_tvos_arm/${LIB_NAME}/lib/libcares.a" ] ; then
# lipo -create install_tvos_arm/${LIB_NAME}/lib/libcares.a install_tvos_arm64/${LIB_NAME}/lib/libcares.a install_tvos_x64/${LIB_NAME}/lib/libcares.a -output ${DIST_DIR}/lib/tvos/libcares.a
# else
# lipo -create install_tvos_arm64/${LIB_NAME}/lib/libcares.a install_tvos_x64/${LIB_NAME}/lib/libcares.a -output ${DIST_DIR}/lib/tvos/libcares.a
# fi

# # check the flat lib
# lipo -info ${DIST_DIR}/lib/ios/libcares.a

# # check the flat lib
# lipo -info ${DIST_DIR}/lib/tvos/libcares.a


# # create fat lib for mac
# lipo -create install_osx_arm64/${LIB_NAME}/lib/libcares.a install_osx_x64/${LIB_NAME}/lib/libcares.a -output ${DIST_DIR}/lib/mac/libcares.a


# # check the fat lib
# lipo -info ${DIST_DIR}/lib/mac/libcares.a

xcodebuild -create-xcframework \
-library install_ios_arm64/${LIB_NAME}/lib/libcares.a \
-library install_ios_x64/${LIB_NAME}/lib/libcares.a \
-library install_ios_arm64_sim/${LIB_NAME}/lib/libcares.a \
-library install_tvos_arm64/${LIB_NAME}/lib/libcares.a \
-library install_tvos_x64/${LIB_NAME}/lib/libcares.a \
-library install_tvos_arm64_sim/${LIB_NAME}/lib/libcares.a \
-library install_osx_x64/${LIB_NAME}/lib/libcares.a \
-library install_osx_arm64/${LIB_NAME}/lib/libcares.a \
-output ${DIST_DIR}/lib/cares.xcframework

# overrite ares_build.h with common header
cp -f src/cares/ares_build.h ${DIST_DIR}/include/
65 changes: 38 additions & 27 deletions src/curl/dist1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,41 @@ DIST_DIR="${DIST_ROOT}/${LIB_NAME}"

dist_lib ${LIB_NAME} ${DIST_DIR} $DISTF_NATIVES

# create flat lib for ios
if [ -f "install_ios_arm/${LIB_NAME}/lib/libcurl.a" ] ; then
lipo -create install_ios_arm/${LIB_NAME}/lib/libcurl.a install_ios_arm64/${LIB_NAME}/lib/libcurl.a install_ios_x64/${LIB_NAME}/lib/libcurl.a -output ${DIST_DIR}/lib/ios/libcurl.a
else
lipo -create install_ios_arm64/${LIB_NAME}/lib/libcurl.a install_ios_x64/${LIB_NAME}/lib/libcurl.a -output ${DIST_DIR}/lib/ios/libcurl.a
fi

# create flat lib for tvos
if [ -f "install_tvos_arm/${LIB_NAME}/lib/libcurl.a" ] ; then
lipo -create install_tvos_arm/${LIB_NAME}/lib/libcurl.a install_tvos_arm64/${LIB_NAME}/lib/libcurl.a install_tvos_x64/${LIB_NAME}/lib/libcurl.a -output ${DIST_DIR}/lib/tvos/libcurl.a
else
lipo -create install_tvos_arm64/${LIB_NAME}/lib/libcurl.a install_tvos_x64/${LIB_NAME}/lib/libcurl.a -output ${DIST_DIR}/lib/tvos/libcurl.a
fi

# check the flat lib
lipo -info ${DIST_DIR}/lib/ios/libcurl.a

# check the flat lib
lipo -info ${DIST_DIR}/lib/tvos/libcurl.a


# create fat lib for mac
lipo -create install_osx_arm64/${LIB_NAME}/lib/libcurl.a install_osx_x64/${LIB_NAME}/lib/libcurl.a -output ${DIST_DIR}/lib/mac/libcurl.a


# check the fat lib
lipo -info ${DIST_DIR}/lib/mac/libcurl.a
# # create flat lib for ios
# if [ -f "install_ios_arm/${LIB_NAME}/lib/libcurl.a" ] ; then
# lipo -create install_ios_arm/${LIB_NAME}/lib/libcurl.a install_ios_arm64/${LIB_NAME}/lib/libcurl.a install_ios_x64/${LIB_NAME}/lib/libcurl.a -output ${DIST_DIR}/lib/ios/libcurl.a
# else
# lipo -create install_ios_arm64/${LIB_NAME}/lib/libcurl.a install_ios_x64/${LIB_NAME}/lib/libcurl.a -output ${DIST_DIR}/lib/ios/libcurl.a
# fi

# # create flat lib for tvos
# if [ -f "install_tvos_arm/${LIB_NAME}/lib/libcurl.a" ] ; then
# lipo -create install_tvos_arm/${LIB_NAME}/lib/libcurl.a install_tvos_arm64/${LIB_NAME}/lib/libcurl.a install_tvos_x64/${LIB_NAME}/lib/libcurl.a -output ${DIST_DIR}/lib/tvos/libcurl.a
# else
# lipo -create install_tvos_arm64/${LIB_NAME}/lib/libcurl.a install_tvos_x64/${LIB_NAME}/lib/libcurl.a -output ${DIST_DIR}/lib/tvos/libcurl.a
# fi

# # check the flat lib
# lipo -info ${DIST_DIR}/lib/ios/libcurl.a

# # check the flat lib
# lipo -info ${DIST_DIR}/lib/tvos/libcurl.a


# # create fat lib for mac
# lipo -create install_osx_arm64/${LIB_NAME}/lib/libcurl.a install_osx_x64/${LIB_NAME}/lib/libcurl.a -output ${DIST_DIR}/lib/mac/libcurl.a


# # check the fat lib
# lipo -info ${DIST_DIR}/lib/mac/libcurl.a

xcodebuild -create-xcframework \
-library install_ios_arm64/${LIB_NAME}/lib/libcurl.a \
-library install_ios_x64/${LIB_NAME}/lib/libcurl.a \
-library install_ios_arm64_sim/${LIB_NAME}/lib/libcurl.a \
-library install_tvos_arm64/${LIB_NAME}/lib/libcurl.a \
-library install_tvos_x64/${LIB_NAME}/lib/libcurl.a \
-library install_tvos_arm64_sim/${LIB_NAME}/lib/libcurl.a \
-library install_osx_x64/${LIB_NAME}/lib/libcurl.a \
-library install_osx_arm64/${LIB_NAME}/lib/libcurl.a \
-output ${DIST_DIR}/lib/curl.xcframework
61 changes: 36 additions & 25 deletions src/jpeg-turbo/dist1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,39 @@ DIST_DIR="${DIST_ROOT}/${LIB_NAME}"

dist_lib ${LIB_NAME} ${DIST_DIR} $DISTF_NO_WINRT jconfig.h config_ab.h.in

# create flat lib for ios
if [ -f "install_ios_arm/${LIB_NAME}/lib/libjpeg.a" ] ; then
lipo -create install_ios_arm/${LIB_NAME}/lib/libjpeg.a install_ios_arm64/${LIB_NAME}/lib/libjpeg.a install_ios_x64/${LIB_NAME}/lib/libjpeg.a -output ${DIST_DIR}/lib/ios/libjpeg.a
else
lipo -create install_ios_arm64/${LIB_NAME}/lib/libjpeg.a install_ios_x64/${LIB_NAME}/lib/libjpeg.a -output ${DIST_DIR}/lib/ios/libjpeg.a
fi

# create flat lib for tvos
if [ -f "install_tvos_arm/${LIB_NAME}/lib/libjpeg.a" ] ; then
lipo -create install_tvos_arm/${LIB_NAME}/lib/libjpeg.a install_tvos_arm64/${LIB_NAME}/lib/libjpeg.a install_tvos_x64/${LIB_NAME}/lib/libjpeg.a -output ${DIST_DIR}/lib/tvos/libjpeg.a
else
lipo -create install_tvos_arm64/${LIB_NAME}/lib/libjpeg.a install_tvos_x64/${LIB_NAME}/lib/libjpeg.a -output ${DIST_DIR}/lib/tvos/libjpeg.a
fi

# check the flat lib
lipo -info ${DIST_DIR}/lib/ios/libjpeg.a

# check the flat lib
lipo -info ${DIST_DIR}/lib/tvos/libjpeg.a

# create fat lib for mac
lipo -create install_osx_arm64/${LIB_NAME}/lib/libjpeg.a install_osx_x64/${LIB_NAME}/lib/libjpeg.a -output ${DIST_DIR}/lib/mac/libjpeg.a

# check the fat lib
lipo -info ${DIST_DIR}/lib/mac/libjpeg.a
# # create flat lib for ios
# if [ -f "install_ios_arm/${LIB_NAME}/lib/libjpeg.a" ] ; then
# lipo -create install_ios_arm/${LIB_NAME}/lib/libjpeg.a install_ios_arm64/${LIB_NAME}/lib/libjpeg.a install_ios_x64/${LIB_NAME}/lib/libjpeg.a -output ${DIST_DIR}/lib/ios/libjpeg.a
# else
# lipo -create install_ios_arm64/${LIB_NAME}/lib/libjpeg.a install_ios_x64/${LIB_NAME}/lib/libjpeg.a -output ${DIST_DIR}/lib/ios/libjpeg.a
# fi

# # create flat lib for tvos
# if [ -f "install_tvos_arm/${LIB_NAME}/lib/libjpeg.a" ] ; then
# lipo -create install_tvos_arm/${LIB_NAME}/lib/libjpeg.a install_tvos_arm64/${LIB_NAME}/lib/libjpeg.a install_tvos_x64/${LIB_NAME}/lib/libjpeg.a -output ${DIST_DIR}/lib/tvos/libjpeg.a
# else
# lipo -create install_tvos_arm64/${LIB_NAME}/lib/libjpeg.a install_tvos_x64/${LIB_NAME}/lib/libjpeg.a -output ${DIST_DIR}/lib/tvos/libjpeg.a
# fi

# # check the flat lib
# lipo -info ${DIST_DIR}/lib/ios/libjpeg.a

# # check the flat lib
# lipo -info ${DIST_DIR}/lib/tvos/libjpeg.a

# # create fat lib for mac
# lipo -create install_osx_arm64/${LIB_NAME}/lib/libjpeg.a install_osx_x64/${LIB_NAME}/lib/libjpeg.a -output ${DIST_DIR}/lib/mac/libjpeg.a

# # check the fat lib
# lipo -info ${DIST_DIR}/lib/mac/libjpeg.a

xcodebuild -create-xcframework \
-library install_ios_arm64/${LIB_NAME}/lib/libjpeg.a \
-library install_ios_x64/${LIB_NAME}/lib/libjpeg.a \
-library install_ios_arm64_sim/${LIB_NAME}/lib/libjpeg.a \
-library install_tvos_arm64/${LIB_NAME}/lib/libjpeg.a \
-library install_tvos_x64/${LIB_NAME}/lib/libjpeg.a \
-library install_tvos_arm64_sim/${LIB_NAME}/lib/libjpeg.a \
-library install_osx_x64/${LIB_NAME}/lib/libjpeg.a \
-library install_osx_arm64/${LIB_NAME}/lib/libjpeg.a \
-output ${DIST_DIR}/lib/jpeg.xcframework
49 changes: 30 additions & 19 deletions src/luajit/dist1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,37 @@ DIST_DIR="${DIST_ROOT}/${LIB_NAME}"
dist_lib ${LIB_NAME} ${DIST_DIR} $DISTF_NO_WINRT

# create flat lib for ios
if [ -f "install_ios_arm/${LIB_NAME}/lib/libluajit.a" ] ; then
echo "Creating flat libluajit.a with armv7,arm64,x86_64"
lipo -create install_ios_arm/${LIB_NAME}/lib/libluajit.a install_ios_arm64/${LIB_NAME}/lib/libluajit.a install_ios_x64/${LIB_NAME}/lib/libluajit.a -output ${DIST_DIR}/lib/ios/libluajit.a
else
echo "Creating flat libluajit.a with arm64,x86_64"
lipo -create install_ios_arm64/${LIB_NAME}/lib/libluajit.a install_ios_x64/${LIB_NAME}/lib/libluajit.a -output ${DIST_DIR}/lib/ios/libluajit.a
fi
# if [ -f "install_ios_arm/${LIB_NAME}/lib/libluajit.a" ] ; then
# echo "Creating flat libluajit.a with armv7,arm64,x86_64"
# lipo -create install_ios_arm/${LIB_NAME}/lib/libluajit.a install_ios_arm64/${LIB_NAME}/lib/libluajit.a install_ios_x64/${LIB_NAME}/lib/libluajit.a -output ${DIST_DIR}/lib/ios/libluajit.a
# else
# echo "Creating flat libluajit.a with arm64,x86_64"
# lipo -create install_ios_arm64/${LIB_NAME}/lib/libluajit.a install_ios_x64/${LIB_NAME}/lib/libluajit.a -output ${DIST_DIR}/lib/ios/libluajit.a
# fi

# create flat lib for tvos
if [ -f "install_tvos_arm/${LIB_NAME}/lib/libluajit.a" ] ; then
echo "Creating flat libluajit.a with armv7,arm64,x86_64"
lipo -create install_tvos_arm/${LIB_NAME}/lib/libluajit.a install_tvos_arm64/${LIB_NAME}/lib/libluajit.a install_tvos_x64/${LIB_NAME}/lib/libluajit.a -output ${DIST_DIR}/lib/tvos/libluajit.a
else
echo "Creating flat libluajit.a with arm64,x86_64"
lipo -create install_tvos_arm64/${LIB_NAME}/lib/libluajit.a install_tvos_x64/${LIB_NAME}/lib/libluajit.a -output ${DIST_DIR}/lib/tvos/libluajit.a
fi
# # create flat lib for tvos
# if [ -f "install_tvos_arm/${LIB_NAME}/lib/libluajit.a" ] ; then
# echo "Creating flat libluajit.a with armv7,arm64,x86_64"
# lipo -create install_tvos_arm/${LIB_NAME}/lib/libluajit.a install_tvos_arm64/${LIB_NAME}/lib/libluajit.a install_tvos_x64/${LIB_NAME}/lib/libluajit.a -output ${DIST_DIR}/lib/tvos/libluajit.a
# else
# echo "Creating flat libluajit.a with arm64,x86_64"
# lipo -create install_tvos_arm64/${LIB_NAME}/lib/libluajit.a install_tvos_x64/${LIB_NAME}/lib/libluajit.a -output ${DIST_DIR}/lib/tvos/libluajit.a
# fi

# create fat lib for mac
lipo -create install_osx_arm64/${LIB_NAME}/lib/libluajit.a install_osx_x64/${LIB_NAME}/lib/libluajit.a -output ${DIST_DIR}/lib/mac/libluajit.a
# # create fat lib for mac
# lipo -create install_osx_arm64/${LIB_NAME}/lib/libluajit.a install_osx_x64/${LIB_NAME}/lib/libluajit.a -output ${DIST_DIR}/lib/mac/libluajit.a

# check the fat lib
lipo -info ${DIST_DIR}/lib/mac/libluajit.a
# # check the fat lib
# lipo -info ${DIST_DIR}/lib/mac/libluajit.a


xcodebuild -create-xcframework \
-library install_ios_arm64/${LIB_NAME}/lib/libluajit.a \
-library install_ios_x64/${LIB_NAME}/lib/libluajit.a \
-library install_ios_arm64_sim/${LIB_NAME}/lib/libluajit.a \
-library install_tvos_arm64/${LIB_NAME}/lib/libluajit.a \
-library install_tvos_x64/${LIB_NAME}/lib/libluajit.a \
-library install_tvos_arm64_sim/${LIB_NAME}/lib/libluajit.a \
-library install_osx_x64/${LIB_NAME}/lib/libluajit.a \
-library install_osx_arm64/${LIB_NAME}/lib/libluajit.a \
-output ${DIST_DIR}/lib/luajit.xcframework
Loading

0 comments on commit 4321cdc

Please sign in to comment.