Commit f4735762 authored by nanahira's avatar nanahira

add a workflow for patch lib

parent 7b4a052b
......@@ -20,7 +20,7 @@ unity:
tags:
- unity
patch:
patch-header:
stage: patch
dependencies:
- unity
......@@ -28,13 +28,43 @@ patch:
- apt update; apt -y install tar patch
- mv dist/src ./unity-src
- cd unity-src
- cp -rf ../patches.sh .
- cp -rf ../misc .
- chmod +x *.sh
- sed -i '/>UIStatusBarStyle</i\ <key>UIFileSharingEnabled</key>\n <true />\n <key>LSSupportsOpeningDocumentsInPlace</key>\n <true />' ./Info.plist
- patch -p1 < ../misc/patches/iPhone_Sensors.mm.patch
- echo '#define UNITY_USES_LOCATION 0' >> ./Classes/Preprocessor.h
- sed -i 's/^#define UNITY_USES_REMOTE_NOTIFICATIONS 1/#define UNITY_USES_REMOTE_NOTIFICATIONS 0/g' ./Classes/Preprocessor.h
- rm -rf Libraries
- cd ..
artifacts:
paths:
- unity-src/
tags:
- linux
patch-lib:
stage: patch
dependencies:
- unity
script:
- mkdir unity-src
- cd unity-src
- mv ../dist/src/Libraries .
- env MISC_PATH="../misc" ../patches.sh
- cd ..
artifacts:
paths:
- unity-src/
tags:
- macos
pack:
stage: pack
dependencies:
- patch-header
- patch-lib
script:
- mkdir dist
- cd unity-src
- tar zcvf ../dist/KoishiPro2-src.tar.gz *
- cd ..
artifacts:
......
#!/bin/bash
MM_PATH="./misc/URLUtility.mm"
MM_PATH="$MISC_PATH/URLUtility.mm"
IPHONE_SDK_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
_run_for_arch() {
......@@ -14,12 +14,13 @@ _run_for_arch() {
rm -f ./URLUtility.o
}
mkdir /tmp/tmp-libs
_run_for_arch arm64 /tmp/tmp-libs/libiPhone-lib-arm64.a
_run_for_arch armv7 /tmp/tmp-libs/libiPhone-lib-armv7.a
_run_for_arch armv7s /tmp/tmp-libs/libiPhone-lib-armv7s.a
lipo -create /tmp/tmp-libs/libiPhone-lib-arm64.a /tmp/tmp-libs/libiPhone-lib-armv7.a /tmp/tmp-libs/libiPhone-lib-armv7s.a -output ./Libraries/libiPhone-lib-new.a && \
TMP_PATH=/tmp/tmp-libs-$RANDOM
mkdir $TMP_PATH
_run_for_arch arm64 $TMP_PATH/libiPhone-lib-arm64.a
_run_for_arch armv7 $TMP_PATH/libiPhone-lib-armv7.a
_run_for_arch armv7s $TMP_PATH/libiPhone-lib-armv7s.a
lipo -create $TMP_PATH/libiPhone-lib-arm64.a $TMP_PATH/libiPhone-lib-armv7.a $TMP_PATH/libiPhone-lib-armv7s.a -output ./Libraries/libiPhone-lib-new.a && \
mv ./Libraries/libiPhone-lib-new.a ./Libraries/libiPhone-lib.a
# patch -p1 < ./misc/patches/iPhone_Sensors.mm.patch
# patch -p1 < $MISC_PATH/patches/iPhone_Sensors.mm.patch
# echo '#define UNITY_USES_LOCATION 0' >> ./Classes/Preprocessor.h
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment