Skip to content

Commit

Permalink
📦 Enable meson cross build
Browse files Browse the repository at this point in the history
* fix pango library loading
  • Loading branch information
dbouron committed May 5, 2022
1 parent 9a45ddb commit 64bbf81
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/docker/windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RUN yum install ${YUM_OPTIONS} \
mingw64-glib2 \
mingw64-win-iconv \
mingw64-expat \
mingw-w64-x86_64
mingw-w64-fontconfig

# Link the system version of libmpfr, which is more recent than expected, but works fine.
RUN ln -s /lib64/libmpfr.so.6 /lib64/libmpfr.so.4
Expand Down
13 changes: 11 additions & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include(ExternalProject)

find_program(MESON meson REQUIRED)
find_program(MESON meson REQUIRED )
find_program(NINJA ninja REQUIRED)

# Read external project versions
Expand Down Expand Up @@ -47,13 +47,22 @@ list(APPEND CONFIGURE_VARS
${CONFIGURE_HOST}
)


if (NOT DEFINED BUILD_TARGET)
set(MESON_CROSS_FILE "")
elseif(${BUILD_TARGET} STREQUAL "w64")
set(MESON_CROSS_FILE "--cross-file ${PROJECT_SOURCE_DIR}/meson/linux-mingw-w64-64bit.txt")
endif()


list(APPEND MESON_VARS
-Dpkg_config_path=${EXT_INSTALL_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH
--bindir=${EXT_INSTALL_DIR}/bin
--libdir=${EXT_INSTALL_DIR}/lib
--includedir=${EXT_INSTALL_DIR}/include
--datadir=${EXT_INSTALL_DIR}/share
--prefix=${EXT_INSTALL_DIR}
${MESON_CROSS_FILE}
)

find_library(LIBIMAGEQUANT imagequant PATHS "${EXT_INSTALL_DIR}/lib" NO_DEFAULT_PATH)
Expand Down Expand Up @@ -276,7 +285,7 @@ else()
add_custom_target(cairo "")
endif()

find_library(PANGO pango PATHS "${EXT_INSTALL_DIR}/lib" NO_DEFAULT_PATH)
find_library(PANGO pango-1.0 PATHS "${EXT_INSTALL_DIR}/lib" NO_DEFAULT_PATH)
if(NOT PANGO)
ExternalProject_Add(pango
URL "https://gitlab.gnome.org/GNOME/pango/-/archive/${PANGO_VERSION}/pango-${PANGO_VERSION}.tar.gz"
Expand Down
6 changes: 1 addition & 5 deletions lib/VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ LCMS2_VERSION=2.11
TIFF_VERSION=4.1.0
FREETYPE_VERSION=2.10.4
HARFBUZZ_VERSION=2.7.2
<<<<<<< HEAD
VIPS_VERSION=8.12.2
=======
FRIBIDI_VERSION=1.0.10
PIXMAN_VERSION=0.40.0
CAIRO_VERSION=1.16.0
PANGO_VERSION=1.48.0
VIPS_VERSION=8.12.1
>>>>>>> 📦 Add Fribidi dependency
VIPS_VERSION=8.12.2
20 changes: 20 additions & 0 deletions meson/linux-mingw-w64-64bit.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[binaries]
c = '/usr/bin/x86_64-w64-mingw32-gcc'
cpp = '/usr/bin/x86_64-w64-mingw32-g++'
ar = '/usr/bin/x86_64-w64-mingw32-ar'
strip = '/usr/bin/x86_64-w64-mingw32-strip'
pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config'
windres = '/usr/bin/x86_64-w64-mingw32-windres'
exe_wrapper = 'wine64'

[properties]
# Directory that contains 'bin', 'lib', etc
root = '/usr/x86_64-w64-mingw32'
# Directory that contains 'bin', 'lib', etc for the toolchain and system libraries
sys_root = '/usr/x86_64-w64-mingw32/sys-root/mingw'

[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
2 changes: 1 addition & 1 deletion src/main/java/com/criteo/vips/Vips.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Vips {
"png16",
"spng",
"cairo",
"pango",
"pango-1.0",
"gif",
"jpeg",
"turbojpeg",
Expand Down

0 comments on commit 64bbf81

Please sign in to comment.