Skip to content

Commit

Permalink
Conda: add shell: bash -l {0}
Browse files Browse the repository at this point in the history
Musl: fix "selected processor does not support `pmull`"

Windows: remove `cgdi_printer_driver.cpp`'s patch

This patch is not required anymore.

Run `install-sysroot.py` after `runhooks`

Restore `install-sysroot.py`

The Linux ARM builds fail without this line.

Call `gclient runhooks` instead of `install-sysroot.py`

Remove `use_allocator_shim`

It's an option of `partition_allocator` which we disabled for all architectures.

Upgrade the runner to Ubuntu 22.04

iOS V8: remove the dependency on BrowserEngineKit

Bug introduced by:
https://chromium.googlesource.com/v8/v8.git/+/7dec59784535eac97053729969a42282ce1387b6

Fixes bblanchon#164

Android: remove `gclient runhooks`

The command was failing with the following message:

> update_depot_tools: line 148: goma_ctl: command not found

Caused by:
https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4160794

Musl: remove workaround for undefined `enable_safe_libstdcxx`

This reverts commit e789065.
https://chromium.googlesource.com/chromium/src/build/+/4711ca616db541b49146e18b485c20876680c570

Android: set `default_min_sdk_version = 21`

Closes bblanchon#147.
Closes bblanchon#161.

Android: install `unzip`

CI: remove the optional token for `workflow-dispatch`

Musl: add a workaround for undefined `enable_safe_libstdcxx`

https://chromium.googlesource.com/chromium/src/build/+/b484740dba8205ad6cec10feb2d2e17a466ec3bf

Make `linux_musl_arm64_v8` wait for `linux_musl_arm64`

Musl: update patch

https://chromium.googlesource.com/chromium/src/build/+/ee2c24e99f79ca8f7ce16adf7aa89597aeac4816

WASM: update patch

https://chromium.googlesource.com/chromium/src/build/+/ee2c24e99f79ca8f7ce16adf7aa89597aeac4816

Update V8 patch

Update WASM patch https://pdfium.googlesource.com/pdfium/+/67963ba

Test the patches against the latest `chromium/*` branch

Set `clang_use_chrome_plugins = false`

This skips many extra warnings, such as `chromium-rawptr` which broke today's build.

Update deprecated actions

NuGet: Add release notes to packages

Closes bblanchon#154
Closes bblanchon#156

Set `pdf_use_partition_alloc = false` for all platforms

Closes bblanchon#148

NuGet: fix macOS arch in target file

NuGet: add target files to Linux and macOS for Mono support

NuGet: add Linux Musl ARM64

Musl: add `-flax-vector-conversions` for ARM64 (fixes bblanchon#150)

Windows: update patch (fixes bblanchon#149)

Adds a dummy definition to avoid the unused variable error

Anaconda: remove 32-bit packages

Relates to bblanchon#146

Anaconda: switch from weekly to monthly release

Closes bblanchon#146

WASM: remove `libpdfium.a` from tarball and NuGet package

Reverts 8d9cea2
Reverts bblanchon#123
Closes bblanchon#145

Make Emscripten SDK (emsdk) version a workflow input

Closes bblanchon#143

Musl: add arm64 v8 Relates to bblanchon#133 and bblanchon#134

readme/conda badge: add link

Add a 15 minutes timeout to the checkout step

Add Spacedrive to related projects

Disable allocator_shim for macOS build

Update V8 patch https://pdfium.googlesource.com/pdfium/+/5956b29a

Update V8 patch https://pdfium.googlesource.com/pdfium/+/cee3d1d43a

Patch `build/config/BUILDCONFIG.gn` instead of `build_overrides/BUILDCONFIG.gn` https://pdfium.googlesource.com/pdfium/+/9c8a2c8e

Musl: add arm64 build Closes bblanchon#133

Use GCC 10 for the linux arm builds

Update Windows runner to `windows-2022`

Fix Musl patch
  • Loading branch information
bblanchon authored and reece394 committed Aug 12, 2024
1 parent 9dc3db6 commit e1e445d
Show file tree
Hide file tree
Showing 33 changed files with 402 additions and 180 deletions.
88 changes: 65 additions & 23 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,18 @@ on:
type: boolean
required: false
default: false
publish:
description: Publish release
release:
description: Publish GitHub release
type: boolean
required: false
default: false
nuget:
description: Publish on nuget.org
type: boolean
required: false
default: false
anaconda:
description: Publish on anaconda.org
type: boolean
required: false
default: false
Expand Down Expand Up @@ -268,6 +278,32 @@ jobs:
target_cpu: x86
enable_v8: true

linux_musl_arm64:
name: Linux musl ARM64
uses: ./.github/workflows/build.yml
with:
branch: ${{ github.event.inputs.branch }}
version: ${{ github.event.inputs.version }}
is_debug: ${{ github.event.inputs.is_debug == 'true' }}
target_os: linux
target_cpu: arm64
target_libc: musl
enable_v8: false

linux_musl_arm64_v8:
name: Linux musl ARM64 V8
if: github.event.inputs.enable_v8 == 'true'
needs: linux_musl_arm64
uses: ./.github/workflows/build.yml
with:
branch: ${{ github.event.inputs.branch }}
version: ${{ github.event.inputs.version }}
is_debug: ${{ github.event.inputs.is_debug == 'true' }}
target_os: linux
target_cpu: arm64
target_libc: musl
enable_v8: true

linux_musl_x64:
name: Linux musl x64
uses: ./.github/workflows/build.yml
Expand Down Expand Up @@ -495,6 +531,8 @@ jobs:
- linux_x64_v8
- linux_x86
- linux_x86_v8
- linux_musl_arm64
- linux_musl_arm64_v8
- linux_musl_x64
- linux_musl_x64_v8
- linux_musl_x86
Expand All @@ -512,29 +550,38 @@ jobs:
- win_x86_v8
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: nuget
- name: Prepare header files
shell: bash
run: mkdir -p nuget/include/pdfium && cp -r nuget/pdfium-win-x86/include/* nuget/include/pdfium/
- name: Define properties
shell: bash
run: |
VERSION="${{ github.event.inputs.version || '0.0.0.0' }}"
BRANCH="${GITHUB_REF#refs/heads/}"
COMMIT="${GITHUB_SHA}"
RELEASE_NOTES="${{github.server_url}}/${{github.repository}}/releases"
${{ github.event.inputs.release }} && RELEASE_NOTES+="/tag/${{ github.event.inputs.branch }}"
echo "NUSPEC_PROPERTIES=version=$VERSION;branch=$BRANCH;commit=$COMMIT;releaseNotes=$RELEASE_NOTES" >> "$GITHUB_ENV"
- name: Pack
shell: bash
run: |
for NUSPEC in nuget/*.nuspec; do
echo "::group::$NUSPEC"
nuget pack "$NUSPEC" -properties "version=${{ github.event.inputs.version || '0.0.0.0' }};branch=${GITHUB_REF#refs/heads/};commit=${GITHUB_SHA}"
nuget pack "$NUSPEC" -p "$NUSPEC_PROPERTIES"
echo "::endgroup::"
done
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NuGet packages
path: '*.nupkg'
- name: Push to nuget.org
if: env.NUGET_API_KEY && startsWith(github.event.inputs.branch, 'chromium/') && github.event.inputs.version && github.event.inputs.publish == 'true'
if: env.NUGET_API_KEY && startsWith(github.event.inputs.branch, 'chromium/') && github.event.inputs.version && github.event.inputs.nuget == 'true'
run: nuget push -Source nuget.org -ApiKey ${{ secrets.NUGET_API_KEY }} *.nupkg
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
Expand All @@ -544,20 +591,17 @@ jobs:
if: github.event.inputs.version
runs-on: ubuntu-latest
needs:
- linux_arm
- linux_arm64
- linux_x64
- linux_x86
- mac_arm64
- mac_x64
- win_arm64
- win_x64
- win_x86
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
- name: Create build script
run: |
cat >conda-build.sh <<END
Expand All @@ -575,42 +619,38 @@ jobs:
python conda/build.py pdfium-binaries \$PLATFORM \$VERSION --about-file conda/about.json --source-dir \$SOURCE_DIR --output-dir conda/out
END
chmod +x conda-build.sh
- name: Build for linux-32
run: ./conda-build.sh linux-32 pdfium-linux-x86
- name: Build for linux-64
run: ./conda-build.sh linux-64 pdfium-linux-x64
- name: Build for linux-aarch64
run: ./conda-build.sh linux-aarch64 pdfium-linux-arm64
- name: Build for linux-armv7l
run: ./conda-build.sh linux-armv7l pdfium-linux-arm
- name: Build for osx-arm64
run: ./conda-build.sh osx-arm64 pdfium-mac-arm64
- name: Build for osx-64
run: ./conda-build.sh osx-64 pdfium-mac-x64
- name: Build for win-32
run: ./conda-build.sh win-32 pdfium-win-x86
- name: Build for win-64
run: ./conda-build.sh win-64 pdfium-win-x64
- name: Build for win-arm64
run: ./conda-build.sh win-arm64 pdfium-win-arm64
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Conda packages
path: conda/out/
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
- name: Install anaconda-client
run: conda install -yq anaconda-client
shell: bash -l {0}
- name: Upload to Anaconda
if: env.ANACONDA_API_TOKEN && startsWith(github.event.inputs.branch, 'chromium/') && github.event.inputs.version && github.event.inputs.publish == 'true'
if: env.ANACONDA_API_TOKEN && startsWith(github.event.inputs.branch, 'chromium/') && github.event.inputs.version && github.event.inputs.anaconda == 'true'
run: find conda/out -name 'pdfium-binaries-*.tar.bz2' -exec anaconda upload --force {} +
shell: bash -l {0}
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}

publish:
name: Publish Release
if: startsWith(github.event.inputs.branch, 'chromium/') && github.event.inputs.version && github.event.inputs.publish == 'true'
if: startsWith(github.event.inputs.branch, 'chromium/') && github.event.inputs.version && github.event.inputs.release == 'true'
runs-on: ubuntu-latest
needs:
- android_arm
Expand All @@ -629,6 +669,8 @@ jobs:
- linux_arm_v8
- linux_arm64
- linux_arm64_v8
- linux_musl_arm64
- linux_musl_arm64_v8
- linux_musl_x64
- linux_musl_x64_v8
- linux_musl_x86
Expand All @@ -652,7 +694,7 @@ jobs:
- win_x86_v8
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
- name: Create tarballs
run: |
for DIR in pdfium-*; do
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ on:
type: boolean
required: false
default: false
emsdk_version:
description: Emscripten SDK
type: string
required: false
default: 3.1.34
is_debug:
description: Is debug
type: boolean
Expand All @@ -59,3 +64,4 @@ jobs:
target_cpu: ${{ github.event.inputs.target_cpu }}
target_libc: ${{ github.event.inputs.target_libc }}
enable_v8: ${{ github.event.inputs.enable_v8 == 'true' }}
emsdk_version: ${{ github.event.inputs.emsdk_version }}
19 changes: 10 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ on:
type: string
required: false
default: ''
emsdk_version:
description: Emscripten SDK
type: string
required: false
default: 3.1.34
outputs:
artifact:
description: "The name of the artifact"
Expand All @@ -45,7 +50,7 @@ jobs:
build:
outputs:
artifact: ${{ steps.init.outputs.artifact }}
runs-on: ${{ (inputs.target_os == 'ios' || inputs.target_os == 'mac') && 'macos-latest' || inputs.target_os == 'win' && 'windows-2019' || 'ubuntu-20.04' }}
runs-on: ${{ (inputs.target_os == 'ios' || inputs.target_os == 'mac') && 'macos-latest' || inputs.target_os == 'win' && 'windows-2022' || 'ubuntu-22.04' }}
steps:
- name: Initialize
id: init
Expand All @@ -59,13 +64,7 @@ jobs:
[ "${{inputs.is_debug}}" == "true" ] && ARTIFACT="$ARTIFACT-debug"
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
- name: Checkout this repo
uses: actions/checkout@v3
- name: Workaround for libpcre2 i386 # https://github.com/actions/virtual-environments/issues/4589#issuecomment-1100899313
if: inputs.target_os == 'android'
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update -qq
sudo apt-get install -yqq --allow-downgrades libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal
uses: actions/checkout@v4
- name: Set environment variables
run: |
cat >>$GITHUB_ENV <<END
Expand All @@ -76,6 +75,7 @@ jobs:
PDFium_TARGET_LIBC=${{ inputs.target_libc }}
PDFium_ENABLE_V8=${{ inputs.enable_v8 }}
PDFium_VERSION=${{ inputs.version }}
EMSDK_VERSION=${{ inputs.emsdk_version }}
MUSL_URL=${{ secrets.MUSL_URL }}
END
steps/00-environment.sh
Expand All @@ -86,6 +86,7 @@ jobs:
- name: Checkout PDFium
run: steps/02-checkout.sh
shell: bash
timeout-minutes: 15
- name: Apply patches
run: steps/03-patch.sh
shell: bash
Expand All @@ -110,7 +111,7 @@ jobs:
run: steps/07-stage.sh
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.init.outputs.artifact }}
path: staging/
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/mac-univ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
run: |
echo "artifact=${{inputs.artifact_x64}}" | sed "s/x64/univ/g" >> $GITHUB_OUTPUT
- name: Download ${{ inputs.artifact_x64 }}
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_x64 }}
path: ${{ inputs.artifact_x64 }}
- name: Download ${{ inputs.artifact_arm64 }}
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_arm64 }}
path: ${{ inputs.artifact_arm64 }}
Expand All @@ -45,7 +45,7 @@ jobs:
${{ inputs.artifact_x64 }}/lib/libpdfium.dylib \
-output ${{ steps.init.outputs.artifact }}/lib/libpdfium.dylib
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.init.outputs.artifact }}
path: ${{ steps.init.outputs.artifact }}
6 changes: 4 additions & 2 deletions .github/workflows/patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install depot_tools
run: |
Expand All @@ -23,8 +23,10 @@ jobs:
id: checkout
timeout-minutes: 15
run: |
PDFium_BRANCH=$(git ls-remote --sort version:refname --refs https://pdfium.googlesource.com/pdfium.git 'chromium/*' | tail -n 1 | cut -d/ -f3-4)
echo "Checking out branch $PDFium_BRANCH"
gclient config --unmanaged "https://pdfium.googlesource.com/pdfium.git" --custom-var "checkout_configuration=minimal"
gclient sync --no-history --shallow
gclient sync -r "origin/${PDFium_BRANCH}" --no-history --shallow
- name: Create patch script
run: |
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,21 @@ jobs:
BUILD=$(echo "$VERSION" | cut -d. -f3)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "branch=chromium/$BUILD" >> $GITHUB_OUTPUT
- name: Get date
id: date
run: |
echo "day=$(date +%-d)" >> $GITHUB_OUTPUT
- name: Trigger build
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Build all
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
inputs: |
{
"branch": "${{ steps.chromium.outputs.branch }}",
"version": "${{ steps.chromium.outputs.version }}",
"is_debug": "false",
"enable_v8": "true",
"publish": "true"
"release": "true",
"nuget": "true",
"anaconda": "${{ steps.date.outputs.day <= 7 && 'true' || 'false' }}"
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
/staging/
/build/
*.tgz
/*-musl-cross/
/*-musl*-cross/
/android-ndk*
/conda/out/
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

[![Latest release](https://img.shields.io/github/v/release/bblanchon/pdfium-binaries?display_name=release&label=github)](https://github.com/bblanchon/pdfium-binaries/releases/latest/)
[![Nuget](https://img.shields.io/nuget/v/bblanchon.PDFium)](https://www.nuget.org/packages/bblanchon.PDFium/)
![Conda](https://img.shields.io/conda/v/bblanchon/pdfium-binaries?label=conda)
[![Conda](https://img.shields.io/conda/v/bblanchon/pdfium-binaries?label=conda)](https://anaconda.org/bblanchon/pdfium-binaries)


This project hosts pre-compiled binaries of the [PDFium library](https://pdfium.googlesource.com/pdfium/), an open-source library for PDF manipulation and rendering.
Expand Down Expand Up @@ -87,7 +87,12 @@ Here are the download links for latest release:
</tr>

<tr>
<td rowspan="2">Linux<br>musl</td>
<td rowspan="3">Linux<br>musl</td>
<td>arm64</td>
<td><a href="https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-linux-musl-arm64.tgz">pdfium-linux-musl-arm64.tgz</a></td>
<td><a href="https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-v8-linux-musl-arm64.tgz">pdfium-v8-linux-musl-arm64.tgz</a></td>
</tr>
<tr>
<td>x64</td>
<td><a href="https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-linux-musl-x64.tgz">pdfium-linux-musl-x64.tgz</a></td>
<td><a href="https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-v8-linux-musl-x64.tgz">pdfium-v8-linux-musl-x64.tgz</a></td>
Expand Down Expand Up @@ -241,6 +246,7 @@ The following projects use (or recommend using) our PDFium builds:
| [PDFtoZPL][pdftozpl] | C# | A .NET library to convert PDF files (and bitmaps) into Zebra Programming Language code |
| [PDFx][pdfx] | Dart | Flutter Render & show PDF documents on Web, MacOs 10.11+, Android 5.0+, iOS and Windows |
| [PyPDFium2][pypdfium2] | Python | Python bindings to PDFium |
| [Spacedrive][spacedrive] | Rust/TS | Cross-platform file manager, powered by a virtual distributed filesystem |
| [wxPDFView][wxpdfview] | C++ | wxWidgets components to display PDF content |

*Did we miss a project? Please open a PR!*
Expand Down Expand Up @@ -312,3 +318,4 @@ The following projects use (or recommend using) our PDFium builds:
[pdflibcore]: https://github.com/jbaarssen/PdfLibCore
[dtronixpdf]: https://github.com/Dtronix/DtronixPdf
[pdftozpl]: https://github.com/sungaila/PDFtoZPL
[spacedrive]: https://github.com/spacedriveapp/spacedrive
Loading

0 comments on commit e1e445d

Please sign in to comment.