]> git.cameronkatri.com Git - ldid.git/commitdiff
Use OpenSSL 1.1.1 in GH actions for now
authorCameron Katri <me@cameronkatri.com>
Tue, 5 Apr 2022 02:21:28 +0000 (19:21 -0700)
committerCameron Katri <me@cameronkatri.com>
Tue, 5 Apr 2022 02:48:58 +0000 (22:48 -0400)
This reverts commit 94d0cd4bb688adef8f39aaec37faac4368345d5a.

.github/workflows/build.yml

index 1358e181ea7a1269bcf02aaa0a1ef5e64e4fc15d..6315017bae0d5a71ee08db3c71c0f7505fc97a0a 100644 (file)
@@ -19,7 +19,7 @@ on:
 
 env:
   LIBPLIST_VERSION: 2.2.0
-  OPENSSL_VERSION: 3.0.1
+  OPENSSL_VERSION: 1.1.1n
   SCCACHE_VERSION: 0.2.15
 
 jobs:
@@ -28,10 +28,7 @@ jobs:
     strategy:
       matrix:
         triple:
-        - arm-linux-musleabi
         - aarch64-linux-musl
-        - i486-linux-musl
-        - riscv64-linux-musl
         - x86_64-linux-musl
     env:
       TOOLCHAIN: ${{ matrix.triple }}-cross
@@ -96,22 +93,11 @@ jobs:
     - name: build openssl
       run: |
         export PLATFORM="linux-${ARCH}"
-        case ${ARCH} in
-          arm)
-            export PLATFORM="linux-generic32"
-            ;;
-          i486)
-            export PLATFORM="linux-x86"
-            ;;
-          riscv64)
-            export PLATFORM="linux64-riscv64"
-            ;;
-        esac
 
         wget -q -nc -P ${DOWNLOAD_PATH} https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
         tar xf ${DOWNLOAD_PATH}/openssl-${OPENSSL_VERSION}.tar.gz -C ${DEP_PATH}
         cd ${DEP_PATH}/openssl-${OPENSSL_VERSION}
-        ./config --prefix=/usr --static -static ${PLATFORM}
+        ./Configure --prefix=/usr --static -static ${PLATFORM}
         make -j$(nproc) build_generated libcrypto.a
 
         echo "CPPFLAGS=${CPPFLAGS} -I${DEP_PATH}/openssl-${OPENSSL_VERSION}/include" >> $GITHUB_ENV
@@ -157,40 +143,14 @@ jobs:
         submodules: recursive
 
     - uses: actions/cache@v2
-      id: cache
       with:
         path: |
           ~/Library/Caches/Mozilla.sccache
           ~/dep_src
-          ~/__cache
         key: build-macos-${{ matrix.arch }}-${ { env.GITHUB_SHA } }
         restore-keys: |
           build-macos-${{ matrix.arch }}-
 
-    - name: Setup Procursus Bootstrap (install)
-      if: steps.cache.outpus.cache-hit != 'true'
-      run: |
-        wget https://apt.procurs.us/bootstrap_darwin-amd64.tar.zst https://apt.procurs.us/Toolchain12_5.tzst
-        sudo gtar --preserve-permissions -xkf ./bootstrap_darwin-amd64.tar.zst -C /
-        echo '/opt/procursus/sbin:/opt/procursus/bin' >> $GITHUB_PATH
-        PATH=/opt/procursus/sbin:/opt/procursus/bin:$PATH sudo /opt/procursus/bin/apt update
-        sudo /opt/procursus/bin/apt -V dist-upgrade -y || :
-        sudo /opt/procursus/bin/apt -V dist-upgrade -y
-        sudo /opt/procursus/bin/apt install -y libssl-dev libplist-dev
-
-    - name: Add Procursus to PATH
-      run: |
-        echo '/opt/procursus/sbin:/opt/procursus/bin' >> $GITHUB_PATH
-
-    - name: Setup Procursus Bootstrap (cache)
-      if: steps.cache.outputs.cache-hit == 'true'
-      run: |
-        sudo mkdir -p ~/__cache/procursus/var/cache/apt/archives/partial ~/__cache/procursus/var/lib/apt/lists/partial
-        sudo rsync -aP ~/__cache/procursus /opt
-        sudo /opt/procursus/bin/apt update
-        sudo /opt/procursus/bin/apt -V dist-upgrade -y
-        sudo /opt/procursus/bin/apt -V dist-upgrade -y
-
     - name: setup environment
       run: |
         export DOWNLOAD_PATH=${HOME}/dep_src
@@ -199,8 +159,15 @@ jobs:
         echo "DOWNLOAD_PATH=${DOWNLOAD_PATH}" >> $GITHUB_ENV
         echo "DEP_PATH=${DEP_PATH}" >> $GITHUB_ENV
 
+        if [ "${ARCH}" = "arm64" ]; then
+          echo "HOST_ARCH=aarch64" >> $GITHUB_ENV
+        else
+          echo "HOST_ARCH=${ARCH}" >> $GITHUB_ENV
+        fi
+
     - name: setup toolchain
       run: |
+        brew install libtool autoconf automake
 
         # Download sccache
         wget -nc -P ${DOWNLOAD_PATH} \
@@ -208,31 +175,40 @@ jobs:
         tar xf ${DOWNLOAD_PATH}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin.tar.gz -C ${HOME}
         chmod +x ${HOME}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin/sccache
 
-        if [ "${ARCH}" = "arm64" ]; then
-          wget -nc -P ${DOWNLOAD_PATH} \
-            https://apt.procurs.us/pool/main/big_sur/libssl-dev_${OPENSSL_VERSION}_darwin-arm64.deb
-          dpkg -x ${DOWNLOAD_PATH}/libssl-dev_${OPENSSL_VERSION}_darwin-arm64.deb ${DEP_PATH}
-          wget -nc -P ${DOWNLOAD_PATH} \
-            https://apt.procurs.us/pool/main/big_sur/libplist-dev_${LIBPLIST_VERSION}_darwin-arm64.deb
-          dpkg -x ${DOWNLOAD_PATH}/libplist-dev_${LIBPLIST_VERSION}_darwin-arm64.deb ${DEP_PATH}
-          echo "LIBS=${DEP_PATH}/opt/procursus/lib/libplist-2.0.a ${DEP_PATH}/opt/procursus/lib/libcrypto.a" >> $GITHUB_ENV
-        else
-          echo "LIBS=/opt/procursus/lib/libplist-2.0.a /opt/procursus/lib/libcrypto.a" >> $GITHUB_ENV
-        fi
-
         echo "${HOME}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin" >> $GITHUB_PATH
-        echo "CC=sccache clang -arch ${ARCH} -mmacosx-version-min=11.0" >> $GITHUB_ENV
-        echo "CXX=sccache clang++ -arch ${ARCH} -mmacosx-version-min=11.0" >> $GITHUB_ENV
-        echo "CFLAGS=-Os -I/opt/procursus/include -flto=thin" >> $GITHUB_ENV
+        echo "CC=sccache clang -arch ${ARCH} -mmacosx-version-min=10.13" >> $GITHUB_ENV
+        echo "CXX=sccache clang++ -arch ${ARCH} -mmacosx-version-min=10.13" >> $GITHUB_ENV
+        echo "CFLAGS=-Os" >> $GITHUB_ENV
+
+    - name: build libplist
+      run: |
+        wget -q -nc -P ${DOWNLOAD_PATH} https://github.com/libimobiledevice/libplist/releases/download/${LIBPLIST_VERSION}/libplist-${LIBPLIST_VERSION}.tar.bz2
+        tar xf ${DOWNLOAD_PATH}/libplist-${LIBPLIST_VERSION}.tar.bz2 -C ${DEP_PATH}
+        cd ${DEP_PATH}/libplist-${LIBPLIST_VERSION}
+        ./configure --host=${HOST_ARCH}-apple-darwin --without-cython --enable-static --disable-shared
+        make -j$(sysctl -n hw.ncpu)
+
+        echo "CFLAGS=${CFLAGS} -I${DEP_PATH}/libplist-${LIBPLIST_VERSION}/include" >> $GITHUB_ENV
+        echo "LIBPLIST_LIB=${DEP_PATH}/libplist-${LIBPLIST_VERSION}/src/.libs/libplist-2.0.a" >> $GITHUB_ENV
+
+    - name: build openssl
+      run: |
+        wget -q -nc -P ${DOWNLOAD_PATH} https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
+        tar xf ${DOWNLOAD_PATH}/openssl-${OPENSSL_VERSION}.tar.gz -C ${DEP_PATH}
+        cd ${DEP_PATH}/openssl-${OPENSSL_VERSION}
+        ./Configure --prefix=/usr no-shared darwin64-${ARCH}-cc
+        make -j$(sysctl -n hw.ncpu) build_generated libcrypto.a
+
+        echo "CFLAGS=${CFLAGS} -I${DEP_PATH}/openssl-${OPENSSL_VERSION}/include" >> $GITHUB_ENV
+        echo "LIBCRYPTO_LIB=${DEP_PATH}/openssl-${OPENSSL_VERSION}/libcrypto.a" >> $GITHUB_ENV
 
     - name: build
       run: |
         export LDID_VERSION=$(echo "$(git describe --tags --abbrev=0)")
         make -j$(sysctl -n hw.ncpu) \
-          CFLAGS="${CFLAGS}" \
-          CXXFLAGS="${CFLAGS} -std=c++11" \
+          CFLAGS="${CFLAGS} -flto=thin" \
           VERSION="${LDID_VERSION}" \
-          LIBS="${LIBS}"
+          LIBS="${LIBPLIST_LIB} ${LIBCRYPTO_LIB}"
         strip ldid
 
     - uses: actions/upload-artifact@v1