Skip to content

Commit

Permalink
Merge pull request #104 from paulocoutinhox/pdfium-update
Browse files Browse the repository at this point in the history
pdfium updated to 6183
  • Loading branch information
paulocoutinhox authored Dec 15, 2023
2 parents b3c17ff + 3c34c5a commit 3c1f154
Show file tree
Hide file tree
Showing 14 changed files with 275 additions and 280 deletions.
66 changes: 42 additions & 24 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,78 @@ jobs:
matrix:
config:
- { name: "Ubuntu", os: "ubuntu-20.04", target: "android" }
python-version: [3.7]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
- name: Install System Packages
run: |
sudo apt-get -y update && \
sudo apt-get remove -y php7.4-common && \
sudo rm -rf /var/lib/apt/lists/* && \
sudo apt-get clean
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
python-version: "3.10"

- name: Upgrade PIP
run: python3 -m pip install --upgrade pip setuptools wheel

- name: Display Python version
run: python3 --version
- name: Install CMake
uses: jwlawson/actions-setup-cmake@v1.8
with:
cmake-version: "3.24.0"

- name: Display PIP version
run: python3 -m pip --version
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
with:
version: "1.10.0"

- name: Python requirements
run: python3 -m pip install -r requirements.txt --user
- name: Install NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
add-to-path: true

- name: Remove trash
- name: Verify
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
python3 --version
cmake --version
ninja --version
ndk-build -version
- name: Python requirements
run: python3 -m pip install -r requirements.txt --user

- name: Docker build
run: docker build -t pdfium-android -f docker/android/Dockerfile docker/android
- name: Depot tools
run: python3 make.py build-depot-tools

- name: Docker test
run: docker run -v ${PWD}:/app -i -t=false pdfium-android echo "test"
- name: Environment
run: echo "$PWD/build/depot-tools" >> $GITHUB_PATH

- name: PDFium
run: docker run -v ${PWD}:/app -i -t=false pdfium-android python3 make.py build-pdfium-${{ matrix.config.target }}
run: python3 make.py build-pdfium-${{ matrix.config.target }}

- name: Patch
run: docker run -v ${PWD}:/app -i -t=false pdfium-android python3 make.py patch-${{ matrix.config.target }}
run: python3 make.py patch-${{ matrix.config.target }}

- name: Patch - Check
run: docker run -v ${PWD}:/app -i -t=false pdfium-android python3 make.py patch-${{ matrix.config.target }}
run: python3 make.py patch-${{ matrix.config.target }}

- name: Build
run: docker run -v ${PWD}:/app -i -t=false pdfium-android python3 make.py build-${{ matrix.config.target }}
run: python3 make.py build-${{ matrix.config.target }}

- name: Install
run: docker run -v ${PWD}:/app -i -t=false pdfium-android python3 make.py install-${{ matrix.config.target }}
run: python3 make.py install-${{ matrix.config.target }}

- name: Test
run: docker run -v ${PWD}:/app -i -t=false pdfium-android python3 make.py test-${{ matrix.config.target }}
run: python3 make.py test-${{ matrix.config.target }}

- name: Archive
run: docker run -v ${PWD}:/app -i -t=false pdfium-android python3 make.py archive-${{ matrix.config.target }}
run: python3 make.py archive-${{ matrix.config.target }}

- name: Save
uses: actions/upload-artifact@v2
Expand Down
69 changes: 15 additions & 54 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
- 'docs/**'
- 'extras/images/**'

env:
CMAKE_VERSION: "3.24.0"
NINJA_VERSION: "1.10.0"

jobs:
build:
name: ${{ matrix.config.name }}
Expand All @@ -20,66 +16,33 @@ jobs:
matrix:
config:
- { name: "macOS", os: "macos-latest", target: "ios" }
python-version: [3.7]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
python-version: "3.10"

- name: Upgrade PIP
run: python3 -m pip install --upgrade pip setuptools wheel

- name: Display Python version
run: python3 --version
- name: Install CMake
uses: jwlawson/actions-setup-cmake@v1.8
with:
cmake-version: "3.24.0"

- name: Display PIP version
run: python3 -m pip --version
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
with:
version: "1.10.0"

- name: Install Ninja and CMake
id: cmake_and_ninja
shell: cmake -P {0}
- name: Verify
run: |
set(cmake_version $ENV{CMAKE_VERSION})
set(ninja_version $ENV{NINJA_VERSION})
message(STATUS "Using host CMake version: ${CMAKE_VERSION}")
if ("${{ runner.os }}" STREQUAL "Windows")
set(ninja_suffix "win.zip")
set(cmake_suffix "win64-x64.zip")
set(cmake_dir "cmake-${cmake_version}-win64-x64/bin")
elseif ("${{ runner.os }}" STREQUAL "Linux")
set(ninja_suffix "linux.zip")
set(cmake_suffix "Linux-x86_64.tar.gz")
set(cmake_dir "cmake-${cmake_version}-Linux-x86_64/bin")
elseif ("${{ runner.os }}" STREQUAL "macOS")
set(ninja_suffix "mac.zip")
set(cmake_suffix "Darwin-x86_64.tar.gz")
set(cmake_dir "cmake-${cmake_version}-Darwin-x86_64/CMake.app/Contents/bin")
endif()
set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v${ninja_version}/ninja-${ninja_suffix}")
file(DOWNLOAD "${ninja_url}" ./ninja.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ninja.zip)
set(cmake_url "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-${cmake_suffix}")
file(DOWNLOAD "${cmake_url}" ./cmake.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./cmake.zip)
# Save the path for other steps
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/${cmake_dir}" cmake_dir)
message("::set-output name=cmake_dir::${cmake_dir}")
if (NOT "${{ runner.os }}" STREQUAL "Windows")
execute_process(
COMMAND chmod +x ninja
COMMAND chmod +x ${cmake_dir}/cmake
)
endif()
python3 --version
cmake --version
ninja --version
- name: Python requirements
run: python3 -m pip install -r requirements.txt --user
Expand All @@ -88,9 +51,7 @@ jobs:
run: python3 make.py build-depot-tools

- name: Environment
run: |
echo "$PWD/build/depot-tools" >> $GITHUB_PATH
echo "FORCE_MAC_SDK_MIN=10.15" >> $GITHUB_ENV
run: echo "$PWD/build/depot-tools" >> $GITHUB_PATH

- name: PDFium
run: python3 make.py build-pdfium-${{ matrix.config.target }}
Expand Down
71 changes: 16 additions & 55 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
- 'docs/**'
- 'extras/images/**'

env:
CMAKE_VERSION: "3.24.0"
NINJA_VERSION: "1.10.0"

jobs:
build:
name: ${{ matrix.config.name }}
Expand All @@ -19,67 +15,34 @@ jobs:
fail-fast: false
matrix:
config:
- { name: "macOS", os: "macos-12", target: "macos" }
python-version: [3.7]
- { name: "macOS", os: "macos-latest", target: "macos" }

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
python-version: "3.10"

- name: Upgrade PIP
run: python3 -m pip install --upgrade pip setuptools wheel

- name: Display Python version
run: python3 --version
- name: Install CMake
uses: jwlawson/actions-setup-cmake@v1.8
with:
cmake-version: "3.24.0"

- name: Display PIP version
run: python3 -m pip --version
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
with:
version: "1.10.0"

- name: Install Ninja and CMake
id: cmake_and_ninja
shell: cmake -P {0}
- name: Verify
run: |
set(cmake_version $ENV{CMAKE_VERSION})
set(ninja_version $ENV{NINJA_VERSION})
message(STATUS "Using host CMake version: ${CMAKE_VERSION}")
if ("${{ runner.os }}" STREQUAL "Windows")
set(ninja_suffix "win.zip")
set(cmake_suffix "win64-x64.zip")
set(cmake_dir "cmake-${cmake_version}-win64-x64/bin")
elseif ("${{ runner.os }}" STREQUAL "Linux")
set(ninja_suffix "linux.zip")
set(cmake_suffix "Linux-x86_64.tar.gz")
set(cmake_dir "cmake-${cmake_version}-Linux-x86_64/bin")
elseif ("${{ runner.os }}" STREQUAL "macOS")
set(ninja_suffix "mac.zip")
set(cmake_suffix "Darwin-x86_64.tar.gz")
set(cmake_dir "cmake-${cmake_version}-Darwin-x86_64/CMake.app/Contents/bin")
endif()
set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v${ninja_version}/ninja-${ninja_suffix}")
file(DOWNLOAD "${ninja_url}" ./ninja.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ninja.zip)
set(cmake_url "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-${cmake_suffix}")
file(DOWNLOAD "${cmake_url}" ./cmake.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./cmake.zip)
# Save the path for other steps
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/${cmake_dir}" cmake_dir)
message("::set-output name=cmake_dir::${cmake_dir}")
if (NOT "${{ runner.os }}" STREQUAL "Windows")
execute_process(
COMMAND chmod +x ninja
COMMAND chmod +x ${cmake_dir}/cmake
)
endif()
python3 --version
cmake --version
ninja --version
- name: Python requirements
run: python3 -m pip install -r requirements.txt --user
Expand All @@ -88,9 +51,7 @@ jobs:
run: python3 make.py build-depot-tools

- name: Environment
run: |
echo "$PWD/build/depot-tools" >> $GITHUB_PATH
echo "FORCE_MAC_SDK_MIN=10.15" >> $GITHUB_ENV
run: echo "$PWD/build/depot-tools" >> $GITHUB_PATH

- name: PDFium
run: python3 make.py build-pdfium-${{ matrix.config.target }}
Expand Down
Loading

0 comments on commit 3c1f154

Please sign in to comment.