diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index ced0e36..559585a 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -1,12 +1,7 @@ name: CI on: - push: - branches: - - master - pull_request: - branches: - - master + push jobs: build: @@ -14,29 +9,28 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] + fail-fast: false + runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true - - name: Set up CMake + - name: Set up dependencies for Linux if: runner.os == 'Linux' run: | sudo apt-get update -qq - sudo apt-get install -qq cmake build-essential + sudo apt-get install -qq cmake build-essential clang - - name: Set up Homebrew + - name: Set up dependencies for macOS if: runner.os == 'macOS' run: | brew update - brew upgrade cmake - - - name: Set up compiler - run: | - sudo apt-get install -qq clang + brew upgrade cmake + brew install automake autoconf fontconfig - name: Display versions run: | @@ -44,7 +38,22 @@ jobs: g++ -v cmake --version + - name: set env variables + if: runner.os == 'macOS' + run: | + echo "" >> $GITHUB_ENV + echo "" >> $GITHUB_ENV + - name: Build + if: runner.os == 'macOS' + env: + C_INCLUDE_PATH: '/opt/homebrew/include' + CPLUS_INCLUDE_PATH: '/opt/homebrew/include' + run: | + cmake ./ + make + - name: Build + if: runner.os == 'Linux' run: | cmake ./ make diff --git a/install_deps.sh b/install_deps.sh index 4f7b3e2..19ddbcd 100755 --- a/install_deps.sh +++ b/install_deps.sh @@ -22,47 +22,56 @@ FREETYPE_URI=https://download.savannah.gnu.org/releases/freetype/freetype-2.9.ta #ICU_URI=http://download.icu-project.org/files/icu4c/62.1/icu4c-62_1-src.tgz ICU_URI="https://github.com/unicode-org/icu/releases/download/release-62-2/icu4c-62_2-src.tgz" #ICU_URI=https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.tgz +# Latest version +# ICU_URI="https://github.com/unicode-org/icu/archive/refs/tags/release-76-1.tar.gz" ICU_FILENAME=$(basename "${ICU_URI}") ICU_DIR_NAME=icu -mkdir -p $DEP_INSTALL_DIR +mkdir -p "${DEP_INSTALL_DIR}" -cd $DEP_INSTALL_DIR +cd "${DEP_INSTALL_DIR}" -if [[ "$OSTYPE" == "linux-gnu" ]]; then -if ! [ -x "$(command -v autoreconf)" ]; then - sudo apt-get install autoconf - fi - ICU_CONFIG="Linux" - LIB_INSTALL="linux" +echo ${OSTYPE} + +if [[ "${OSTYPE}" == "linux"* ]]; then + if ! [ -x "$(command -v autoreconf)" ]; then + sudo apt-get install autoconf + fi + ICU_CONFIG="Linux" + LIB_INSTALL="linux" elif [[ "$OSTYPE" == "darwin"* ]]; then - # Mac OSX - if ! [ -x "$(command -v autoreconf)" ]; then - brew install autoreconf - fi - ICU_CONFIG="MacOSX" - LIB_INSTALL="mac" + # Mac OSX + if ! [ -x "$(command -v autoreconf)" ]; then + brew install autoconf automake + fi + ICU_CONFIG="MacOSX" + LIB_INSTALL="mac" elif [[ "$OSTYPE" == "cygwin" ]]; then - # POSIX compatibility layer and Linux environment emulation for Windows - ICU_CONFIG="Cygwin" - LIB_INSTALL="windows" -#elif [[ "$OSTYPE" == "msys" ]]; then - # Lightweight shell and GNU utilities compiled for Windows (part of MinGW) -#elif [[ "$OSTYPE" == "win32" ]]; then - # I'm not sure this can happen. -#elif [[ "$OSTYPE" == "freebsd"* ]]; then - # ... -#else - # Unknown. + # POSIX compatibility layer and Linux environment emulation for Windows + ICU_CONFIG="Cygwin" + LIB_INSTALL="windows" + #elif [[ "$OSTYPE" == "msys" ]]; then + # Lightweight shell and GNU utilities compiled for Windows (part of MinGW) + #elif [[ "$OSTYPE" == "win32" ]]; then + # I'm not sure this can happen. + #elif [[ "$OSTYPE" == "freebsd"* ]]; then + # ... +else + echo "Unknown OSTYPE: $OSTYPE, assuming it's LINUX" + if ! [ -x "$(command -v autoreconf)" ]; then + sudo apt-get install autoconf + fi + ICU_CONFIG="Linux" + LIB_INSTALL="linux" fi -echo "$LIB_INSTALL" +echo "${LIB_INSTALL}" echo 'Installing libxml2.' # rm -rf libxml2-2.9.8 -wget -nc $LIBXML_URI +wget -nc "${LIBXML_URI}" tar xvf libxml2-2.9.8.tar.gz @@ -106,7 +115,7 @@ echo 'Installing ICU.' rm -rf "${ICU_DIR_NAME}" -wget -nc $ICU_URI +wget -nc ${ICU_URI} tar xvf "${ICU_FILENAME}" @@ -114,7 +123,8 @@ cd "${ICU_DIR_NAME}/source" && mkdir lib && mkdir bin chmod +x runConfigureICU configure install-sh -./runConfigureICU $ICU_CONFIG --enable-static --disable-shared +echo "ICU_CONFIG -> ${ICU_CONFIG}" +./runConfigureICU "${ICU_CONFIG}" --enable-static --disable-shared make @@ -126,30 +136,32 @@ echo 'Installing zlib and png.' cd .. -cd libs/image/zlib/src && cmake "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true" && make && cd - -cd libs/image/png/src && cmake "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true" && make && cd - +cd libs/image/zlib/src && cmake -S . -B build "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true" && make -C build && cd - +cd libs/image/png/src && cmake -S . -B build "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true" && make -C build && cd - echo 'zlib and png installation is finished.' echo 'Copying libraries into their corresponding location.' -MACHINE_TYPE=`uname -m` -if [ ${MACHINE_TYPE} == 'x86_64' ]; then +MACHINE_TYPE=$(uname -m) +if [[ "${MACHINE_TYPE}" == 'x86_64' ]]; then ARCH="64" -elif [ ${MACHINE_TYPE} == 'arm64' ]; then +elif [[ "${MACHINE_TYPE}" == 'arm64' ]]; then ARCH="arm64" else ARCH="32" fi -cp libs/image/zlib/src/libzlib.a libs/image/zlib/$LIB_INSTALL/$ARCH/ -cp libs/image/png/src/libpng.a libs/image/png/$LIB_INSTALL/$ARCH/ -cp $DEP_INSTALL_DIR/freetype-2.9/_build/libfreetype.a libs/freetype/$LIB_INSTALL/$ARCH/ -cp $DEP_INSTALL_DIR/libxml2-2.9.8/.libs/libxml2.a libs/libxml/$LIB_INSTALL/$ARCH/ + +cp "libs/image/zlib/src/build/libzlib.a" "libs/image/zlib/${LIB_INSTALL}/$ARCH/" +cp "libs/image/png/src/build/libpng.a" "libs/image/png/${LIB_INSTALL}/$ARCH/" +cp "${DEP_INSTALL_DIR}/freetype-2.9/_build/libfreetype.a" "libs/freetype/${LIB_INSTALL}/${ARCH}/" +cp "${DEP_INSTALL_DIR}/libxml2-2.9.8/.libs/libxml2.a" "libs/libxml/${LIB_INSTALL}/${ARCH}/" if [[ "$OSTYPE" == "cygwin" ]]; then -mv $DEP_INSTALL_DIR/icu/source/lib/libsicuuc.a $DEP_INSTALL_DIR/icu/source/lib/libicuuc.a -mv $DEP_INSTALL_DIR/icu/source/lib/libsicudata.a $DEP_INSTALL_DIR/icu/source/lib/libicudata.a + mv "${DEP_INSTALL_DIR}/icu/source/lib/libsicuuc.a" "${DEP_INSTALL_DIR}/icu/source/lib/libicuuc.a" + mv "${DEP_INSTALL_DIR}/icu/source/lib/libsicudata.a" "${DEP_INSTALL_DIR}/icu/source/lib/libicudata.a" fi -cp $DEP_INSTALL_DIR/icu/source/lib/libicuuc.a libs/icu/$LIB_INSTALL/$ARCH/ -cp $DEP_INSTALL_DIR/icu/source/lib/libicudata.a libs/icu/$LIB_INSTALL/$ARCH/ + +cp "${DEP_INSTALL_DIR}/icu/source/lib/libicuuc.a" "libs/icu/${LIB_INSTALL}/${ARCH}/" +cp "${DEP_INSTALL_DIR}/icu/source/lib/libicudata.a" "libs/icu/${LIB_INSTALL}/${ARCH}/" rm -rf $DEP_INSTALL_DIR @@ -172,7 +184,7 @@ languages=( for language in "${languages[@]}" ; do #language_dir="${language}" language_url="https://dl.xpdfreader.com/xpdf-${language}.tar.gz" - wget -qO- "${language_url}" | tar xvfz - + wget -qO- "${language_url}" | tar xvfz - done cp xpdfrc .. diff --git a/libs/freetype/mac/arm64/libfreetype.a b/libs/freetype/mac/arm64/libfreetype.a new file mode 100644 index 0000000..0df7aba Binary files /dev/null and b/libs/freetype/mac/arm64/libfreetype.a differ diff --git a/libs/icu/mac/arm64/libicudata.a b/libs/icu/mac/arm64/libicudata.a new file mode 100644 index 0000000..b438494 Binary files /dev/null and b/libs/icu/mac/arm64/libicudata.a differ diff --git a/libs/icu/mac/arm64/libicuuc.a b/libs/icu/mac/arm64/libicuuc.a new file mode 100644 index 0000000..353dba0 Binary files /dev/null and b/libs/icu/mac/arm64/libicuuc.a differ diff --git a/libs/image/png/mac/arm64/libpng.a b/libs/image/png/mac/arm64/libpng.a new file mode 100644 index 0000000..b4965f7 Binary files /dev/null and b/libs/image/png/mac/arm64/libpng.a differ diff --git a/libs/image/zlib/mac/arm64/libzlib.a b/libs/image/zlib/mac/arm64/libzlib.a new file mode 100644 index 0000000..453c592 Binary files /dev/null and b/libs/image/zlib/mac/arm64/libzlib.a differ diff --git a/libs/libxml/mac/arm64/libxml2.a b/libs/libxml/mac/arm64/libxml2.a new file mode 100644 index 0000000..5d95bfc Binary files /dev/null and b/libs/libxml/mac/arm64/libxml2.a differ