Skip to content

Commit

Permalink
macos: fix build
Browse files Browse the repository at this point in the history
get a patch from https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/101.patch
or else cairo can't be build on macOS
  • Loading branch information
naveen521kk committed Mar 28, 2021
1 parent 5d38969 commit ee97202
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
test:
name: ${{ matrix.os }} - ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
env:
MACOSX_DEPLOYMENT_TARGET: 10.9
strategy:
fail-fast: false
matrix:
Expand All @@ -25,6 +27,9 @@ jobs:
if: runner.os == 'macOS'
run: |
brew install cairo
brew uninstall --ignore-dependencies brotli
brew uninstall --ignore-dependencies pcre
brew uninstall --ignore-dependencies libpng
echo "LD_LIBRARY_PATH=$HOME/pangoprefix/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$HOME/pangoprefix/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
- name: Set ENV
Expand All @@ -38,7 +43,7 @@ jobs:
with:
path: |
/home/runner/pangobuild
key: 1-${{ runner.os }}-${{ hashFiles('packing/build_pango_tests.sh') }}
key: ${{ runner.os }}-${{ hashFiles('packing/build_pango_tests.sh') }}
- name: Install System Dependency
if: steps.cache-pango.outputs.cache-hit != 'true'
run: |
Expand Down
11 changes: 10 additions & 1 deletion packing/build_pango_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ HARFBUZZ_VERSION=2.7.4
FILE_PATH=$PWD
PREFIX="$HOME/pangoprefix"

cd $TMP
cd $TEMPDIR

mkdir pango
cd pango
echo "::group::Downloading Files"
Expand Down Expand Up @@ -47,13 +50,19 @@ meson install -C fribidi_builddir
echo "::endgroup::"

echo "::group::Building and Installing Cairo"
echo "Getting patch"
curl -L https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/101.diff -o 101.diff
cd cairo
patch -Nbp1 -i "$PWD/../101.diff" || true
# it is fine to fail because the CI config is missing.
cd ..
meson setup --prefix=$PREFIX --default-library=shared --buildtype=release -Dfontconfig=enabled -Dfreetype=enabled -Dglib=enabled -Dzlib=enabled -Dtee=enabled cairo_builddir cairo
meson compile -C cairo_builddir
meson install --no-rebuild -C cairo_builddir
echo "::endgroup::"

echo "::group::Building and Installing Harfbuzz"
meson setup --prefix=$PREFIX --buildtype=release -Dtests=disabled -Ddocs=disabled harfbuzz_builddir harfbuzz
meson setup --prefix=$PREFIX -Dcoretext=enabled --buildtype=release -Dtests=disabled -Ddocs=disabled harfbuzz_builddir harfbuzz
meson compile -C harfbuzz_builddir
meson install -C harfbuzz_builddir
echo "::endgroup::"
Expand Down

0 comments on commit ee97202

Please sign in to comment.