Skip to content

Commit

Permalink
ci: build
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Oct 13, 2024
1 parent 578b71b commit 3f629ec
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .android.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
clang_use_chrome_plugins = false
default_min_sdk_version = 21
pdf_bundle_freetype = true
13 changes: 13 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
is_debug = false
use_goma = false
treat_warnings_as_errors = false
clang_use_chrome_plugins = false

pdf_enable_v8 = false
pdf_enable_xfa = false
pdf_use_skia = false

is_component_build = false
pdf_use_partition_alloc = false
pdf_is_standalone = true
pdf_is_complete_lib = true
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ jobs:
shell: bash
run: |
cat >> .env <<END
TARGET_OS=${{ matrix.targets.os }}
TARGET_CPU=${{ matrix.targets.arch }}
target_os = "${{ matrix.targets.os }}"
target_cpu = "${{ matrix.targets.arch }}"
END
echo "${PWD}/depot_tools" >> $GITHUB_PATH
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.path
pdfium

.cipd
.gc*
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

4 changes: 4 additions & 0 deletions .ios.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ios_enable_code_signing = false
use_blink = true
target_environment = "device"
use_custom_libcxx = false
Empty file added .linux.env
Empty file.
4 changes: 4 additions & 0 deletions .mac.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mac_deployment_target = "10.13.0"
use_custom_libcxx = false
use_sysroot = false
use_allocator_shim = false
1 change: 1 addition & 0 deletions .release.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
symbol_level = 0
3 changes: 3 additions & 0 deletions .wasm.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
is_clang=false
use_custom_libcxx=false
use_sysroot=false
51 changes: 46 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,51 @@
set dotenv-load

fetch:
git submodule init && git submodule update --recursive

build:
@echo "$TARGET_OS $TARGET_CPU"
depot_tools_repo := "https://chromium.googlesource.com/chromium/tools/depot_tools.git"
pdfium_repo := "https://pdfium.googlesource.com/pdfium.git"
pdfium_branch := env_var_or_default('PDFIUM_BRANCH', "chromium/6694")

pdfium_dir := "pdfium"
target_env := if env_var("is_debug") == "false" { "release" } else { "debug" }
target := "$target_os-$target_cpu-" + target_env

clone_depot_tools:
[ -d "depot_tools" ] || git clone {{depot_tools_repo}}

clone_pdfium:
[ -d "pdfium" ] || gclient config --unmanaged {{pdfium_repo}} --custom-var checkout_configuration=minimal
[ -f ".gclient" ] && echo "target_os = [ '$target_os' ]" >> .gclient

gclient sync -r origin/{{pdfium_branch}} --no-history --shallow

build: clone_depot_tools
#!/usr/bin/env bash
set -euo pipefail
export PATH="$PATH:$PWD/depot_tools"

just clone_pdfium

for folder in pdfium \
pdfium/build \
pdfium/third_party/libjpeg_turbo \
pdfium/base/allocator/partition_allocator; do
if [ -e "$folder" ]; then
git -C $folder reset --hard
git -C $folder clean -df
fi
done


target_dir="out/{{target}}"
mkdir -p {{pdfium_dir}}/$target_dir

args="$(cat .env .$target_os.env .release.env | sed 's/ = /=/g' | sort)"

pushd {{pdfium_dir}}
gn gen "$target_dir" --args="$args"
ninja -C "$target_dir" pdfium -v
popd


patch:
echo 'path'
Expand Down
2 changes: 1 addition & 1 deletion pdfium
Submodule pdfium updated from 7a8409 to aec00b

0 comments on commit 3f629ec

Please sign in to comment.