-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Description
I'm trying to package pypdfium2 for NixOS / nixpkgs (the Linux distribution with currently by far the most packages in).
Like many other distros, the build system has the requirement that builds are hermetic, without network access.
For the beginning I'm trying to use the pre-built pdfium
binaries provided.
But the build system (paths down from setup.py
) still tries to connect to the network in various places:
- downloading pdfium binaries
- fetching tags with git
urlretrieve()
inbuild_pdfium_bindings()
; it has aheaders_dir=None
default argument, but no path in the code allows to set it to something not-None
I noticed the prepared!
concept from the README, but not sure that's what's needed, as that seems to skip ctypesgen
.
Would it be possible to provide setup.py with pre-downloaded files of whatever is needed to build a single pypdfium2 version?
For example, from what I've read so far, for version 6097
it seems it would be sufficient to provide:
- pdfium binary: https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F6097/pdfium-linux-x64.tgz
- headers: https://pdfium.googlesource.com/pdfium/+archive/refs/heads/chromium/6097/public.tar.gz
If one could just provide those to setup.py
with flags or environment variables, it would solve the hermetic distro packaging issue.