Inkscape extensions and python3
Re: https://git.alpinelinux.org/aports/tree/community/inkscape/APKBUILD
I'm looking to decrease the size of an Alpine container to use for typesetting documents, which includes Inkscape for transcoding SVG images. Bundling Inkscape pulls in its extensions, which depend on Python and py3-numpy.
I asked Marc Jeanmougin about whether extensions are needed for converting SVG files to PDF files. He wrote:
Most file import or export formats are actually handled by extensions - but not the pdf export afaik
For my purposes, the Alpine container has Inkscape installed, but will only ever run headless from the command-line when called upon by the typesetting system to convert SVG files to PDF files. I'm using neither the Inkscape GUI nor SVG -> PNG rasterization.
Python3 occupies 60MB and eliminating it offers a significant image size reduction. Further, libopenblasp and other knock-on dependencies could be removed:
root@typesetter:/usr/lib# du -hcs * | sort -n | grep M
28.6M inkscape
30.8M libopenblasp-r0.3.25.so
60.8M python3.11
Compiling Inkscape without Python failed:
sudo pacman -Rdd python
cd /tmp
git clone --depth=1 --single-branch --recurse-submodules --shallow-submodule https://gitlab.com/inkscape/inkscape.git
cd inkscape
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/install_dir -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
I've asked on the Inkscape extensions chat, but received no useful answer.
The container image is 192 M, so purging Python, if possible, would be significant savings, leading to faster downloads and faster installs. (No free, open-source alternatives for converting SVG to PDF that I could find are superior to Inkscape. If there is one, such as cairosvg, I'd be happy to entertain using it.)
Does anyone know if it'd be possible to build a slimmer Inkscape for the use case of SVG -> PDF?