-
Notifications
You must be signed in to change notification settings - Fork 15
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
How to selectively build libvips for windows? #42
Comments
I think the easiest way to exclude unneeded dependencies is to adapt the build-win64-mxe/build/vips-all.mk Lines 11 to 14 in 50edec4
to: $(PKG)_DEPS := cc glib expat poppler To ensure only libvips (+ required dependencies) and Poppler (+ sub-dependencies) are build. Though, you may also need to do the same for the build-win64-mxe/build/overrides.mk Line 285 in 50edec4
However, this may still cause libvips to link against the sub-dependencies that Poppler brings in. To avoid this, you can build libvips with:
|
Thank you for the quick answer! I test it and I'll get back to you soon |
Note that within the Meson build system, available in the future libvips v8.13 (see the
|
That will be a huge improvement in the building configuration for sure, writing that configuration took me some time. Anyway, this is the patch I created for my configuration diff --git a/build/vips-all.mk b/build/vips-all.mk
index 6edc806..0e57bfb 100644
--- a/build/vips-all.mk
+++ b/build/vips-all.mk
@@ -8,10 +8,7 @@ $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST
$(PKG)_GH_CONF := libvips/libvips/releases,v
$(PKG)_SUBDIR := vips-$($(PKG)_VERSION)
$(PKG)_FILE := vips-$($(PKG)_VERSION).tar.gz
-$(PKG)_DEPS := cc libwebp librsvg glib pango libgsf \
- libjpeg-turbo tiff lcms libexif libheif libpng \
- libspng libimagequant orc imagemagick matio openexr \
- cfitsio nifticlib poppler fftw openslide libjxl cgif
+$(PKG)_DEPS := cc glib expat poppler
define $(PKG)_PRE_CONFIGURE
# Copy some files to the packaging directory
@@ -80,6 +77,19 @@ define $(PKG)_BUILD
--enable-debug=no \
$(if $(IS_LLVM),, --without-libjxl) \
--without-pdfium \
+ --without-lcms \
+ --without-libopenjp2 \
+ --without-zlib \
+ --without-libwebp \
+ --without-fontconfig \
+ --without-tiff \
+ --without-png \
+ --without-libexif \
+ --without-jpeg \
+ --without-ppm \
+ --without-analyze \
+ --without-radiance \
+ --disable-modules \
--disable-introspection \
--disable-deprecated \
--with-heif=$(if $(IS_HEVC),module,yes) \ I invoked the scrip with: ./build.sh --nightly all x86_64 shared Is it an expected behavior the usage of only 4 threads while compiling? It's taking a very long time, in fact, I'm still waiting for this step, this is the output
|
By default, it will run as many parallel jobs as there are available CPU cores. The first time build will take a long time indeed, since the whole of LLVM must be built from source. |
Got it. It reached the and but, unfortunately, it fails during the linking phase
I don't really know where that symbol comes from - google is not that helpful in this case. Any guess? |
It looks like we still need to include You may need to invalidate GLib's build cache by removing |
Thank you for your support, I've been able to build it. Anyway, it doesn't work. When I try to load the library, it automatically searches for the various DLLs compiled, and when it tries to preload
I used dependencies for understanding what's going on, and If it would be able to compile with pdfium I won't have these problems, because all these libraries are dependencies of poppler. Anyway, you've been really helpful so far, and thank you for pointing me in the right direction for compiling libvips on Windows. |
Does the pre-built I'm not sure if a PDFium build (see #20) would resolve this, since it also depends on FreeType. However, PDFium does have a permissive license that allows the distribution of static-linked binaries (this not the case with Poppler which is licensed under the GPL). |
With the With the
maybe it's because libfreetype is already shipped by unreal engine and loaded before, and perhaps this creates a conflict |
I managed to build a very minimal version of livbips (with pdfium support!) in shared configuration and it works! It's a very manual process (because I'm not familiar with the build tool) but after the holidays I plan to write some lines about this, so maybe it can help you in doing it in the right way 🥳 |
@kleisauke I wrote some lines about the pdfium support here #20 (comment) I hope it can help you automatize this manual process - at least there's the proof that it works and it's possible to integrate pdfium on windows build |
Closing in favor of #20. |
Hi! I'm trying to integrate libvips inside a project that already has lots of the dependencies that libvips also has.
Moreover, I'm only interested in integrating the pdf import feature.
On linux I can easily build libvips in this way:
PKG_CONFIG_PATH=$(pwd)/lib/pkgconfig/ meson setup build-dir --prefix=/tmp/vips \ -Dcfitsio=disabled \ -Dcgif=disabled \ -Dexif=disabled \ -Dfftw=disabled \ -Dfontconfig=disabled \ -Dgsf=disabled \ -Dheif=disabled \ -Dheif-module=disabled \ -Dimagequant=disabled \ -Djpeg=disabled \ -Djpeg-xl=disabled \ -Djpeg-xl-module=disabled \ -Dlcms=disabled \ -Dmagick=disabled \ -Dmagick-module=disabled \ -Dmatio=disabled \ -Dnifti=disabled \ -Dopenexr=disabled \ -Dopenjpeg=disabled \ -Dopenslide=disabled \ -Dopenslide-module=disabled \ -Dorc=disabled \ -Dpangocairo=disabled \ -Dpdfium=disabled \ -Dpng=disabled \ -Dquantizr=disabled \ -Drsvg=disabled \ -Dspng=disabled \ -Dtiff=disabled \ -Dwebp=disabled \ -Dzlib=disabled \ -Dpoppler-module=disabled \ -Dpoppler=disabled \ -Dpdfium=enabled \ --buildtype=release
and having a very minimal libvips instance with pdfium support.
For windows, I'd like to do the same but I'm completely lost in this build system.
I've seen that pdfium is not an option (in fact in the build you provide there's no pdfium), but poppler is a valid alternative.
So here's the question: do you have some hint on how to proceed to build a very minimal version of libvips with only the poppler suppìort - on windows?
The text was updated successfully, but these errors were encountered: