Skip to content

Commit

Permalink
fix(ci): install pdfium for mac
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser committed Apr 26, 2024
1 parent fc48384 commit 4fb3209
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/scripts/pdfium.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

mkdir ./pdfium
curl -sLo pdfium.tgz https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-mac-x64.tgz
tar -xzvf pdfium.tgz -C ./pdfium
mv ./pdfium /usr/local/opt/
VERSION="$(cat /usr/local/opt/pdfium/VERSION | grep BUILD | sed -e 's/BUILD=//')" \
cat > /usr/local/lib/pkgconfig/pdfium.pc<< EOF
prefix=/usr/local/opt/pdfium
libdir=/usr/local/opt/pdfium/lib
includedir=/usr/local/opt/pdfium/include
Name: PDFium
Description: PDFium
Version: $VERSION
Requires:
Libs: -L\${libdir} -lpdfium
Cflags: -I\${includedir}
EOF
ln -s /usr/local/opt/pdfium/lib/libpdfium.dylib /usr/local/lib/libpdfium.dylib
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Use C for rust temporary files
run: echo "CARGO_TARGET_DIR=C:\target" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install pdfium
run: brew install pdfium
- name: Run tests
run: cargo test --verbose

Expand All @@ -59,5 +63,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install pdfium
run: brew install pdfium
- name: Run tests
run: cargo test --verbose

0 comments on commit 4fb3209

Please sign in to comment.