Skip to content

Commit

Permalink
[WiP] Update for 8.16.1
Browse files Browse the repository at this point in the history
MXE Updates:
- Update SQLite to 3.49.1.
  • Loading branch information
kleisauke committed Feb 19, 2025
1 parent 32a2d0e commit ea91b64
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 199 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Run the top-level [build script](build.sh) with the `--help` parameter for help.
| [librsvg] | 2.59.2 | LGPLv3 |
| [libspng] | 0.7.4 | BSD 2-Clause |
| [libtiff] | 4.7.0 | [libtiff License] (BSD-like) |
| [libvips] | 8.16.0 | LGPLv3 |
| [libvips] | 8.16.1 | LGPLv3 |
| [libwebp] | 1.5.0 | New BSD License |
| [libxml2] | 2.13.5 | MIT Licence |
| [mozjpeg] | 4.1.5 | [zlib License, IJG License, BSD-3-Clause] |
Expand Down Expand Up @@ -104,7 +104,7 @@ Same as libvips-web + these extra dependencies:
| [openjpeg] | 2.5.3 | BSD 2-Clause |
| [openslide] | 4.0.0 | LGPLv3 |
| [poppler] | 25.02.0 | GPLv2 |
| [sqlite] | 3.49.0 | Public domain |
| [sqlite] | 3.49.1 | Public domain |

[brotli]: https://github.com/google/brotli
[cfitsio]: https://heasarc.gsfc.nasa.gov/fitsio/
Expand Down
6 changes: 3 additions & 3 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fi
# Always checkout a particular revision which will successfully build.
# This ensures that it will not suddenly break a build.
# Note: Must be regularly updated.
revision="866492387740cc6580ef516c8a746402be645453"
revision="2bf85f28165cefbce457a79cc0c69007455b025a"
initialize=false

if [ -f "$mxe_dir/Makefile" ]; then
Expand All @@ -59,12 +59,12 @@ fi
curr_revision=$(git rev-parse HEAD)

# Is our branch up-to-date?
if [ ! "$curr_revision" = "$revision" ]; then
if [ "$curr_revision" != "$revision" ]; then
git pull && git reset --hard $revision
initialize=true
fi

if [ "$initialize" = true ]; then
if [ "$initialize" = "true" ]; then
# Patch MXE to support the ARM64 target
git apply $work_dir/patches/mxe-fixes.patch
fi
Expand Down
27 changes: 12 additions & 15 deletions build/overrides.mk
Original file line number Diff line number Diff line change
Expand Up @@ -822,27 +822,24 @@ endef

# install DLL in /bin
# generate missing import library
# build with --disable-load-extension
define sqlite_BUILD
cd '$(1)' && $(SOURCE_DIR)/configure \
cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
--host='$(TARGET)' \
--build='$(BUILD)' \
--prefix='$(PREFIX)/$(TARGET)' \
$(if $(BUILD_STATIC), \
--enable-static \
--disable-shared \
$(else), \
$(if $(BUILD_SHARED), \
--out-implib \
--enable-shared \
--disable-static \
--enable-shared) \
--disable-readline
$(MAKE) -C '$(1)' -j 1 install
$(else), \
--enable-static \
--disable-shared) \
--disable-readline \
--disable-load-extension
$(MAKE) -C '$(BUILD_DIR)' -j 1 install

# https://sqlite.org/forum/forumpost/4b68a3b892dfb9a1
# TODO(kleisauke): Switch to `--out-implib` configure flag for the next release.
$(if $(BUILD_SHARED), \
cp -L '$(PREFIX)/$(TARGET)/lib/libsqlite3.dll' '$(PREFIX)/$(TARGET)/bin'; \
rm -v '$(PREFIX)/$(TARGET)/lib/libsqlite3.dll'*; \
'$(PREFIX)/$(TARGET)/bin/gendef' '$(PREFIX)/$(TARGET)/bin/libsqlite3.dll'; \
$(TARGET)-dlltool -D '$(PREFIX)/$(TARGET)/bin/libsqlite3.dll' \
-l '$(PREFIX)/$(TARGET)/lib/libsqlite3.dll.a' \
-d 'libsqlite3.def';)
mv -vf '$(PREFIX)/$(TARGET)/lib/libsqlite3.dll' '$(PREFIX)/$(TARGET)/bin')
endef
12 changes: 8 additions & 4 deletions build/patches/mxe-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ index 1111111..2222222 100644
cmake = '@PREFIX@/bin/@TARGET@-cmake'
glib-mkenums = '@PREFIX@/@TARGET@/bin/glib-mkenums'
glib-genmarshal = '@PREFIX@/@TARGET@/bin/glib-genmarshal'
@@ -23,6 +23,16 @@ needs_exe_wrapper = true
@@ -22,6 +22,20 @@ glib-compile-resources = '/usr/bin/glib-compile-resources'
needs_exe_wrapper = true
sys_root = '@PREFIX@/@TARGET@'
pkg_config_libdir = '@PREFIX@/@TARGET@/lib/pkgconfig'

+# https://docs.gtk.org/glib/cross-compiling.html#cross-properties
+have_c99_vsnprintf = true
+have_c99_snprintf = true
+have_unix98_printf = true
+
+[built-in options]
+bindir = 'bin'
+includedir = 'include'
Expand All @@ -164,10 +169,9 @@ index 1111111..2222222 100644
+buildtype = 'release'
+default_library = '@LIBTYPE@'
+strip = @STRIP@
+
[host_machine]
system = 'windows'
cpu_family = '@CPU_FAMILY@'
diff --git a/src/meson-wrapper/conf/target-meson.in b/src/meson-wrapper/conf/target-meson.in
index 1111111..2222222 100644
--- a/src/meson-wrapper/conf/target-meson.in
Expand Down
178 changes: 16 additions & 162 deletions build/patches/sqlite-3-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,177 +2,31 @@ This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: stephan <stephan@noemail.net>
Date: Mon, 10 Feb 2025 15:01:14 +0000
Subject: [PATCH 1/3] configure: when dlopen() is not found, only fail fatally if
--enable-loadable-module is explicitly provided, else warn instead. Based on
discussion around [forum:2efe9c33bd9021ca|forum post 2efe9c33bd9021ca].
Update proj-indented-notice to behave like its docs say it should when the
-error flag is used.

FossilOrigin-Name: f28e52cbf9e80cb5a1cde7cba099e2c2b6787a77263796e4f9febf3f30bc99dc

Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/3ea05b5b4f219a0cadb5d573bf73c0818cee02cf]

diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl
index 1111111..2222222 100644
--- a/autosetup/proj.tcl
+++ b/autosetup/proj.tcl
@@ -114,11 +114,13 @@ proc proj-bold {str} {
#
# If the -notice flag it used then it emits using [user-notice], which
# means its rendering will (A) go to stderr and (B) be delayed until
-# the next time autosetup goes to output a message. If -notice
-# is not used, it will send the message to stdout without delay.
+# the next time autosetup goes to output a message.
#
# If the -error flag is provided then it renders the message
# immediately to stderr and then exits.
+#
+# If neither -notice nor -error are used, the message will be sent to
+# stdout without delay.
proc proj-indented-notice {args} {
set fErr ""
set outFunc "puts"
@@ -126,6 +128,7 @@ proc proj-indented-notice {args} {
switch -exact -- [lindex $args 0] {
-error {
set args [lassign $args fErr]
+ set outFunc "user-notice"
}
-notice {
set args [lassign $args -]
diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl
index 1111111..2222222 100644
--- a/autosetup/sqlite-config.tcl
+++ b/autosetup/sqlite-config.tcl
@@ -828,20 +828,53 @@ proc sqlite-handle-icu {} {


########################################################################
-# Handles the --enable-load-extension flag.
+# Handles the --enable-load-extension flag. Returns 1 if the support
+# is enabled, else 0. If support for that feature is not found, a
+# fatal error is triggered if --enable-load-extension is explicitly
+# provided, else a loud warning is instead emited. If
+# --disable-load-extension is used, no check is performed.
+#
+# Makes the following environment changes:
+#
+# - defines LDFLAGS_DLOPEN to any linker flags needed for this
+# feature. It may legally be empty on some systems where dlopen()
+# is in libc.
+#
+# - If the feature is not available, adds
+# -DSQLITE_OMIT_LOAD_EXTENSION=1 to the feature flags list.
proc sqlite-handle-load-extension {} {
+ define LDFLAGS_DLOPEN ""
+ set found 0
proj-if-opt-truthy load-extension {
- if {[proj-check-function-in-lib dlopen dl]} {
+ set found [proj-check-function-in-lib dlopen dl]
+ if {$found} {
define LDFLAGS_DLOPEN [get-define lib_dlopen]
undefine lib_dlopen
} else {
- user-error "dlopen() not found. Use --disable-load-extension to bypass this check."
+ if {[proj-opt-was-provided load-extension]} {
+ # Explicit --enable-load-extension: fail if not found
+ proj-indented-notice -error {
+ --enable-load-extension was provided but dlopen()
+ not found. Use --disable-load-extension to bypass this
+ check.
+ }
+ } else {
+ # It was implicitly enabled: warn if not found
+ proj-indented-notice {
+ WARNING: dlopen() not found, so loadable module support will
+ be disabled. Use --disable-load-extension to bypass this
+ check.
+ }
+ }
}
- } {
- define LDFLAGS_DLOPEN ""
+ }
+ if {$found} {
+ msg-result "Loadable extension support enabled."
+ } else {
+ msg-result "Disabling loadable extension support. Use --enable-load-extensions to enable them."
sqlite-add-feature-flag {-DSQLITE_OMIT_LOAD_EXTENSION=1}
- msg-result "Disabling loadable extensions."
}
+ return $found
}

########################################################################

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Fri, 7 Feb 2025 11:00:29 +0100
Subject: [PATCH 2/3] fix library extension for mingw

Upstream-Status: Submitted [https://sqlite.org/forum/forumpost/6bcf90e1d2d52d00]

diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl
index 1111111..2222222 100644
--- a/autosetup/proj.tcl
+++ b/autosetup/proj.tcl
@@ -790,7 +790,7 @@ proc proj-lib-extension {} {
proc inner {key} {
switch -glob -- [get-define $key] {
*-*-ming* - *-*-cygwin - *-*-msys {
- return ".lib"
+ return ".a"
}
default {
return ".a"

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kleis Auke Wolthuizen <github@kleisauke.nl>
Date: Fri, 14 Feb 2025 17:20:40 +0100
Subject: [PATCH 3/3] configure: make pthread bits optional
Date: Sat, 15 Feb 2025 14:21:30 +0100
Subject: [PATCH 1/1] configure: avoid disabling thread safety if pthreads is
unavailable

Specifically Windows does not require this.
Specifically, Windows does not require pthreads.

Regressed since the migration of the build system to autosetup.

Upstream-Status: Submitted [https://sqlite.org/forum/forumpost/8e0fdb8c0d3985d5]
Upstream-Status: Inappropriate [libvips specific - https://sqlite.org/forum/forumpost/93bedd58e5c4e6ea]

diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl
index 1111111..2222222 100644
--- a/autosetup/sqlite-config.tcl
+++ b/autosetup/sqlite-config.tcl
@@ -383,7 +383,7 @@ proc sqlite-handle-soname {} {
}

########################################################################
-# If --enable-thresafe is set, this adds -DSQLITE_THREADSAFE=1 to
+# If --enable-threadsafe is set, this adds -DSQLITE_THREADSAFE=1 to
# OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD to the linker flags
# needed for linking pthread. If --enable-threadsafe is not set, adds
# -DSQLITE_THREADSAFE=0 to OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD
@@ -393,14 +393,15 @@ proc sqlite-handle-threadsafe {} {
@@ -694,10 +694,10 @@ proc sqlite-handle-threadsafe {} {
define LDFLAGS_PTHREAD ""
set enable 0
proj-if-opt-truthy threadsafe {
msg-result yes
sqlite-add-feature-flag -DSQLITE_THREADSAFE=1
- if {![proj-check-function-in-lib pthread_create pthread]
- || ![proj-check-function-in-lib pthread_mutexattr_init pthread]} {
- user-error "Missing required pthread bits"
+ proj-check-function-in-lib pthread_mutexattr_init pthread
+ if {[proj-check-function-in-lib pthread_create pthread]} {
+ define LDFLAGS_PTHREAD [get-define lib_pthread_create]
+ undefine lib_pthread_create
+ # Recall that LDFLAGS_PTHREAD might be empty even if pthreads if
+ # found because it's in -lc on some platforms.
+ } else {
+ define LDFLAGS_PTHREAD ""
}
- define LDFLAGS_PTHREAD [get-define lib_pthread_create]
- undefine lib_pthread_create
- # Recall that LDFLAGS_PTHREAD might be empty even if pthreads if
- # found because it's in -lc on some platforms.
} {
msg-result no
sqlite-add-feature-flag -DSQLITE_THREADSAFE=0
+ set enable 1
msg-result "Checking for libs..."
if {[proj-check-function-in-lib pthread_create pthread]
&& [proj-check-function-in-lib pthread_mutexattr_init pthread]} {
- set enable 1
define LDFLAGS_PTHREAD [get-define lib_pthread_create]
undefine lib_pthread_create
undefine lib_pthread_mutexattr_init
4 changes: 2 additions & 2 deletions build/patches/vips-8-dlldir-as-libdir.patch
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c
index 1111111..2222222 100644
--- a/libvips/iofuncs/init.c
+++ b/libvips/iofuncs/init.c
@@ -1207,6 +1207,12 @@ vips_guess_prefix(const char *argv0, const char *env_name)
@@ -1200,6 +1200,12 @@ vips_guess_prefix(const char *argv0, const char *env_name)
const char *
vips_guess_libdir(const char *argv0, const char *env_name)
{
Expand All @@ -34,7 +34,7 @@ index 1111111..2222222 100644
const char *prefix = vips_guess_prefix(argv0, env_name);
static char *libdir = NULL;

@@ -1231,6 +1237,7 @@ vips_guess_libdir(const char *argv0, const char *env_name)
@@ -1224,6 +1230,7 @@ vips_guess_libdir(const char *argv0, const char *env_name)
libdir = g_strdup_printf("%s/lib", prefix);

return libdir;
Expand Down
10 changes: 5 additions & 5 deletions build/patches/vips-8-heifsave-disable-hbr-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ diff --git a/libvips/foreign/heifsave.c b/libvips/foreign/heifsave.c
index 1111111..2222222 100644
--- a/libvips/foreign/heifsave.c
+++ b/libvips/foreign/heifsave.c
@@ -533,20 +533,9 @@ vips_foreign_save_heif_build(VipsObject *object)
!vips_object_argument_isset(object, "subsample_mode"))
@@ -539,20 +539,9 @@ vips_foreign_save_heif_build(VipsObject *object)
if (heif->lossless)
heif->subsample_mode = VIPS_FOREIGN_SUBSAMPLE_OFF;

- /* Default 12 bit save for 16-bit images.
Expand All @@ -41,7 +41,7 @@ index 1111111..2222222 100644
vips_error("heifsave", _("%d-bit colour depth not supported"),
heif->bitdepth);
return -1;
@@ -730,14 +719,10 @@ vips_foreign_save_heif_build(VipsObject *object)
@@ -756,14 +745,10 @@ vips_foreign_save_heif_build(VipsObject *object)
}

#define UC VIPS_FORMAT_UCHAR
Expand All @@ -57,7 +57,7 @@ index 1111111..2222222 100644
};

static void
@@ -772,7 +757,7 @@ vips_foreign_save_heif_class_init(VipsForeignSaveHeifClass *class)
@@ -798,7 +783,7 @@ vips_foreign_save_heif_class_init(VipsForeignSaveHeifClass *class)
_("Number of bits per pixel"),
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET(VipsForeignSaveHeif, bitdepth),
Expand All @@ -66,7 +66,7 @@ index 1111111..2222222 100644

VIPS_ARG_BOOL(class, "lossless", 13,
_("Lossless"),
@@ -825,7 +810,7 @@ vips_foreign_save_heif_init(VipsForeignSaveHeif *heif)
@@ -851,7 +836,7 @@ vips_foreign_save_heif_init(VipsForeignSaveHeif *heif)
{
heif->ctx = heif_context_alloc();
heif->Q = 50;
Expand Down
Loading

0 comments on commit ea91b64

Please sign in to comment.