-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider options for offering automated building of Pdfium as part of pdfium-render. #53
Comments
A sample build script that creates a #!/usr/bin/env bash
mkdir -p pdfium
cd pdfium
# Clone depot tools, standard tools used for building Chromium and associated projects.
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH:$(cd depot_tools; pwd)"
# Clone the pdfium source.
gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git
gclient sync --no-history
# Create default build configuration...
cd pdfium
./build/install-build-deps.sh --no-prompt
rm out/Default/args.gn
gn gen out/Default
# ... and now customise it as needed.
echo "use_goma = false" >> out/Default/args.gn
echo "clang_use_chrome_plugins = false" >> out/Default/args.gn
echo "is_component_build = false" >> out/Default/args.gn
echo "pdf_is_standalone = true" >> out/Default/args.gn
echo "pdf_is_complete_lib = true" >> out/Default/args.gn
echo "pdf_enable_v8 = true" >> out/Default/args.gn
echo "pdf_enable_xfa = true" >> out/Default/args.gn
echo "pdf_use_skia = false" >> out/Default/args.gn
echo "pdf_use_skia_paths = false" >> out/Default/args.gn
echo "is_clang = true" >> out/Default/args.gn
echo "use_custom_libcxx = false" >> out/Default/args.gn
#echo "treat_warnings_as_errors = false" >> out/Default/args.gn
#echo "target_cpu = \"x64\"" >> out/Default/args.gn
#echo "target_os = \"linux\"" >> out/Default/args.gn
#echo "is_debug = false" >> out/Default/args.gn
# Run the build.
ninja -C out/Default pdfium Building Pdfium is only officially supported on certain Ubuntu and Debian distros, but in practice it probably will work on other distros as well; the build works fine on Arch, for instance. |
Some notes on the configuration flags that can be set in the build script:
|
It would be nice for pdfium-render to eventually offer a cargo subcommand to build Pdfium; something like:
If the build could be dockerised, even better. |
More notes on build flags: https://github.com/chromium/pdfium#selecting-build-configuration |
Possibly, pypdfium2's build script might interest you? Also note that you can list all GN arguments (including defaults, possible values and help) by running |
Thanks for the suggestion @mara004 , that's very helpful! I'll take a look at that build script. |
PS on #53 (comment) (script) and #53 (comment) (build config):
|
Windows compiler toolchain and Google source projects build steps: https://chromium.googlesource.com/chromium/src/+/main/docs/windows_build_instructions.md |
Note: must use |
Is it possible to build a musl linux x86-64 static version with this script? |
IIRC, musl is not natively supported by the toolchain, but Benoît Blanchon at pdfium-binaries maintains patches to (cross-)build for musl: https://github.com/bblanchon/pdfium-binaries/tree/master/patches/musl |
Follow-on from #12, #51. Look into options for offering automated building of Pdfium as part of pdfium-render, and in the meantime document the process for building Pdfium manually based on a sample build script provided by Victor-N-Suadicani as part of #51.
The text was updated successfully, but these errors were encountered: