Skip to content

Commit

Permalink
Bump github.com/klippa-app/go-pdfium from 1.11.0 to 1.12.1 (#41)
Browse files Browse the repository at this point in the history
* Bump github.com/klippa-app/go-pdfium from 1.11.0 to 1.12.1

Bumps [github.com/klippa-app/go-pdfium](https://github.com/klippa-app/go-pdfium) from 1.11.0 to 1.12.1.
- [Release notes](https://github.com/klippa-app/go-pdfium/releases)
- [Commits](klippa-app/go-pdfium@v1.11.0...v1.12.1)

---
updated-dependencies:
- dependency-name: github.com/klippa-app/go-pdfium
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update libturbojpeg in tests, update pdfium version

* Try to fix macos builds

* Fix turbojpeg

* Add back x64 support

* Add arm64 build for macos

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeroen Bobbeldijk <jeroen@klippa.com>
  • Loading branch information
dependabot[bot] and jerbob92 authored May 27, 2024
1 parent 7caa4d6 commit 16bd739
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 70 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/libturbojpeg.pc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
prefix=/opt/libjpegturbo/libjpeg-turbo-3.0.2
libdir=/opt/libjpegturbo/libjpeg-turbo-3.0.2/build
includedir=/opt/libjpegturbo/libjpeg-turbo-3.0.2
prefix=/opt/libjpegturbo/libjpeg-turbo-3.0.3
libdir=/opt/libjpegturbo/libjpeg-turbo-3.0.3/build
includedir=/opt/libjpegturbo/libjpeg-turbo-3.0.3

Name: libturbojpeg
Description: A SIMD-accelerated JPEG codec that provides the TurboJPEG API
Version: 3.0.2
Version: 3.0.3
Libs: -L${libdir} -lturbojpeg
Cflags: -I${includedir}
2 changes: 1 addition & 1 deletion .github/workflows/pdfium-windows.pc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ includedir=D:/opt/pdfium/include

Name: PDFium
Description: PDFium
Version: 6281
Version: 6392
Requires:

Libs: -L${libdir} -lpdfium
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pdfium.pc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ includedir=/opt/pdfium/include

Name: PDFium
Description: PDFium
Version: 6281
Version: 6392
Requires:

Libs: -L${libdir} -lpdfium
Expand Down
54 changes: 45 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
GO_VERSION: "1.22"
PDFIUM_VERSION: "6281"
PDFIUM_VERSION: "6392"

jobs:
release-webassembly:
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
env:
CGO_ENABLED: 1
CC: "musl-gcc"
LD_LIBRARY_PATH: "/opt/pdfium/lib:/opt/libjpegturbo/libjpeg-turbo-3.0.2/build"
LD_LIBRARY_PATH: "/opt/pdfium/lib:/opt/libjpegturbo/libjpeg-turbo-3.0.3/build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -105,14 +105,14 @@ jobs:
sudo cp ./.github/workflows/libturbojpeg.pc /usr/lib/pkgconfig/libturbojpeg.pc
sudo apt-get update -y
sudo apt-get install -y musl-dev musl-tools
sudo curl -L https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.2/libjpeg-turbo-3.0.2.tar.gz -o libjpeg-turbo-3.0.2.tar.gz && sudo mkdir /opt/libjpegturbo && sudo tar -C /opt/libjpegturbo -xvf libjpeg-turbo-3.0.2.tar.gz
cd /opt/libjpegturbo/libjpeg-turbo-3.0.2 && sudo mkdir build && cd build
sudo curl -L https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.3/libjpeg-turbo-3.0.3.tar.gz -o libjpeg-turbo-3.0.3.tar.gz && sudo mkdir /opt/libjpegturbo && sudo tar -C /opt/libjpegturbo -xvf libjpeg-turbo-3.0.3.tar.gz
cd /opt/libjpegturbo/libjpeg-turbo-3.0.3 && sudo mkdir build && cd build
sudo cmake -G"Unix Makefiles" -DCMAKE_C_COMPILER=musl-gcc -DWITH_JPEG8=1 -DCMAKE_BUILD_TYPE=None ../
sudo make turbojpeg
- name: Build
run: |
go build --ldflags '-linkmode external -extldflags "-fno-PIC -L/opt/libjpegturbo/libjpeg-turbo-3.0.2/build"' -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg -ldflags "-X 'github.com/klippa-app/pdfium-cli/version.VERSION=${{ github.event.release.name }}'" -o artifacts/pdfium-native-linux-musl-amd64 main.go
go build --ldflags '-linkmode external -extldflags "-fno-PIC -L/opt/libjpegturbo/libjpeg-turbo-3.0.3/build"' -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg -ldflags "-X 'github.com/klippa-app/pdfium-cli/version.VERSION=${{ github.event.release.name }}'" -o artifacts/pdfium-native-linux-musl-amd64 main.go
- uses: actions/upload-artifact@v4
with:
Expand All @@ -125,13 +125,48 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}


release-cgo-macos:
release-cgo-macos-arm64:
env:
CGO_ENABLED: 1
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Set up PDFium library and libjpeg-turbo
run: |
sudo curl -L https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F${{ env.PDFIUM_VERSION }}/pdfium-mac-arm64.tgz -o pdfium-mac-arm64.tgz && sudo mkdir /opt/pdfium && sudo tar -C /opt/pdfium -xvf pdfium-mac-arm64.tgz
sudo rm pdfium-mac-arm64.tgz
sudo cp ./.github/workflows/pdfium.pc /opt/pdfium/pdfium.pc
brew install jpeg-turbo
- name: Build
run: |
export LD_LIBRARY_PATH="/opt/pdfium/lib"
export PKG_CONFIG_PATH="/opt/pdfium"
go build -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg -ldflags "-X 'github.com/klippa-app/pdfium-cli/version.VERSION=${{ github.event.release.name }}'" -o artifacts/pdfium-native-mac-arm64 main.go
- uses: actions/upload-artifact@v4
with:
name: builds
path: artifacts

- uses: AButler/upload-release-assets@v3.0
with:
files: 'artifacts/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}

release-cgo-macos-x64:
env:
CGO_ENABLED: 1
runs-on: macos-13
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
Expand All @@ -141,12 +176,13 @@ jobs:
run: |
sudo curl -L https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F${{ env.PDFIUM_VERSION }}/pdfium-mac-x64.tgz -o pdfium-mac-x64.tgz && sudo mkdir /opt/pdfium && sudo tar -C /opt/pdfium -xvf pdfium-mac-x64.tgz
sudo rm pdfium-mac-x64.tgz
sudo cp ./.github/workflows/pdfium.pc /usr/local/lib/pkgconfig/pdfium.pc
sudo cp ./.github/workflows/pdfium.pc /opt/pdfium/pdfium.pc
brew install jpeg-turbo
- name: Build
run: |
export LD_LIBRARY_PATH="/opt/pdfium/lib"
export PKG_CONFIG_PATH="/opt/pdfium"
go build -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg -ldflags "-X 'github.com/klippa-app/pdfium-cli/version.VERSION=${{ github.event.release.name }}'" -o artifacts/pdfium-native-mac-amd64 main.go
- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -179,8 +215,8 @@ jobs:
rm pdfium-win-x64.tgz
mkdir D:\opt\pkgconfig
cp ./.github/workflows/pdfium-windows.pc D:\opt\pkgconfig\pdfium.pc
curl -L https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.2/libjpeg-turbo-3.0.2-gcc64.exe -o libjpeg-turbo-3.0.2-gcc64.exe
./libjpeg-turbo-3.0.2-gcc64.exe /S
curl -L https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.3/libjpeg-turbo-3.0.3-gcc64.exe -o libjpeg-turbo-3.0.3-gcc64.exe
./libjpeg-turbo-3.0.3-gcc64.exe /S
$Folder = 'C:\libjpeg-turbo-gcc64\lib\pkgconfig'
while (!(Test-Path -Path $Folder)) {
"libjpeg-turbo does not exist yet!"
Expand Down
54 changes: 44 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
GO_VERSION: "1.22"
PDFIUM_VERSION: "6281"
PDFIUM_VERSION: "6392"

jobs:
test-webassembly:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
env:
CGO_ENABLED: 1
CC: "musl-gcc"
LD_LIBRARY_PATH: "/opt/pdfium/lib:/opt/libjpegturbo/libjpeg-turbo-3.0.2/build"
LD_LIBRARY_PATH: "/opt/pdfium/lib:/opt/libjpegturbo/libjpeg-turbo-3.0.3/build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -88,26 +88,57 @@ jobs:
sudo cp ./.github/workflows/libturbojpeg.pc /usr/lib/pkgconfig/libturbojpeg.pc
sudo apt-get update -y
sudo apt-get install -y musl-dev musl-tools
sudo curl -L https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.2/libjpeg-turbo-3.0.2.tar.gz -o libjpeg-turbo-3.0.2.tar.gz && sudo mkdir /opt/libjpegturbo && sudo tar -C /opt/libjpegturbo -xvf libjpeg-turbo-3.0.2.tar.gz
cd /opt/libjpegturbo/libjpeg-turbo-3.0.2 && sudo mkdir build && cd build
sudo curl -L https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.3/libjpeg-turbo-3.0.3.tar.gz -o libjpeg-turbo-3.0.3.tar.gz && sudo mkdir /opt/libjpegturbo && sudo tar -C /opt/libjpegturbo -xvf libjpeg-turbo-3.0.3.tar.gz
cd /opt/libjpegturbo/libjpeg-turbo-3.0.3 && sudo mkdir build && cd build
sudo cmake -G"Unix Makefiles" -DCMAKE_C_COMPILER=musl-gcc -DWITH_JPEG8=1 -DCMAKE_BUILD_TYPE=None ../
sudo make turbojpeg
- name: Test Linux
run: |
go test ./... --ldflags '-linkmode external -extldflags "-fno-PIC -L/opt/libjpegturbo/libjpeg-turbo-3.0.2/build"' -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg -v
go test ./... --ldflags '-linkmode external -extldflags "-fno-PIC -L/opt/libjpegturbo/libjpeg-turbo-3.0.3/build"' -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg -v
- name: Build
run: |
go build --ldflags '-linkmode external -extldflags "-fno-PIC -L/opt/libjpegturbo/libjpeg-turbo-3.0.2/build"' -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg main.go
go build --ldflags '-linkmode external -extldflags "-fno-PIC -L/opt/libjpegturbo/libjpeg-turbo-3.0.3/build"' -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg main.go
test-cgo-macos:
test-cgo-macos-arm64:
env:
CGO_ENABLED: 1
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Set up PDFium library and libjpeg-turbo
run: |
sudo curl -L https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F${{ env.PDFIUM_VERSION }}/pdfium-mac-arm64.tgz -o pdfium-mac-arm64.tgz && sudo mkdir /opt/pdfium && sudo tar -C /opt/pdfium -xvf pdfium-mac-arm64.tgz
sudo rm pdfium-mac-arm64.tgz
sudo cp ./.github/workflows/pdfium.pc /opt/pdfium/pdfium.pc
brew install jpeg-turbo
- name: Test
run: |
export LD_LIBRARY_PATH="/opt/pdfium/lib"
export PKG_CONFIG_PATH="/opt/pdfium"
go test ./... -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg -exec "env DYLD_LIBRARY_PATH=/opt/pdfium/lib" -v
- name: Build
run: |
export LD_LIBRARY_PATH="/opt/pdfium/lib"
export PKG_CONFIG_PATH="/opt/pdfium"
go build -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg main.go
test-cgo-macos-x64:
env:
CGO_ENABLED: 1
runs-on: macos-13
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
Expand All @@ -117,19 +148,22 @@ jobs:
run: |
sudo curl -L https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F${{ env.PDFIUM_VERSION }}/pdfium-mac-x64.tgz -o pdfium-mac-x64.tgz && sudo mkdir /opt/pdfium && sudo tar -C /opt/pdfium -xvf pdfium-mac-x64.tgz
sudo rm pdfium-mac-x64.tgz
sudo cp ./.github/workflows/pdfium.pc /usr/local/lib/pkgconfig/pdfium.pc
sudo cp ./.github/workflows/pdfium.pc /opt/pdfium/pdfium.pc
brew install jpeg-turbo
- name: Test
run: |
export LD_LIBRARY_PATH="/opt/pdfium/lib"
export PKG_CONFIG_PATH="/opt/pdfium"
go test ./... -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg -exec "env DYLD_LIBRARY_PATH=/opt/pdfium/lib" -v
- name: Build
run: |
export LD_LIBRARY_PATH="/opt/pdfium/lib"
export PKG_CONFIG_PATH="/opt/pdfium"
go build -tags pdfium_experimental,pdfium_cli_use_cgo,pdfium_use_turbojpeg main.go
test-cgo-windows:
env:
CGO_ENABLED: 1
Expand All @@ -150,8 +184,8 @@ jobs:
rm pdfium-win-x64.tgz
mkdir D:\opt\pkgconfig
cp ./.github/workflows/pdfium-windows.pc D:\opt\pkgconfig\pdfium.pc
curl -L https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.2/libjpeg-turbo-3.0.2-gcc64.exe -o libjpeg-turbo-3.0.2-gcc64.exe
./libjpeg-turbo-3.0.2-gcc64.exe /S
curl -L https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.3/libjpeg-turbo-3.0.3-gcc64.exe -o libjpeg-turbo-3.0.3-gcc64.exe
./libjpeg-turbo-3.0.3-gcc64.exe /S
$Folder = 'C:\libjpeg-turbo-gcc64\lib\pkgconfig'
while (!(Test-Path -Path $Folder)) {
"libjpeg-turbo does not exist yet!"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The following release types are available:
- Native + MUSL (amd64)
- MacOS
- WebAssembly (amd64 + arm64)
- Native (amd64)
- Native (amd64 + arm64)
- Windows
- WebAssembly (amd64)
- Native (amd64)
Expand Down
20 changes: 10 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ module github.com/klippa-app/pdfium-cli
go 1.22

require (
github.com/klippa-app/go-pdfium v1.11.0
github.com/klippa-app/go-pdfium v1.12.1
github.com/spf13/cobra v1.8.0
)

require (
github.com/fatih/color v1.13.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/go-hclog v1.6.2 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-plugin v1.6.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jolestar/go-commons-pool/v2 v2.1.2 // indirect
Expand All @@ -21,11 +21,11 @@ require (
github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tetratelabs/wazero v1.6.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.3 // indirect
google.golang.org/protobuf v1.30.0 // indirect
github.com/tetratelabs/wazero v1.7.1 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.33.0 // indirect
)
Loading

0 comments on commit 16bd739

Please sign in to comment.