summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gmail.com>2021-04-16 22:58:56 +0000
committerEmmanuele Bassi <ebassi@gmail.com>2021-04-16 22:58:56 +0000
commit0cc1b8b936269c4e8935ae1a7536da8aad3e3a74 (patch)
tree5d24b31456c69a1728146c8ba34784023e2f5f15
parente365006ee0ead8632437781a4e304297285c47a6 (diff)
parent993e75a9d3165512a3f472c3a154f975d7193f18 (diff)
downloadgdk-pixbuf-0cc1b8b936269c4e8935ae1a7536da8aad3e3a74.tar.gz
Merge branch 'ebassi/for-master' into 'master'
Build fixes See merge request GNOME/gdk-pixbuf!114
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--gdk-pixbuf/gdk-pixbuf-io.c16
-rw-r--r--gdk-pixbuf/io-bmp.c8
-rw-r--r--meson.build35
-rw-r--r--subprojects/libjpeg.wrap2
5 files changed, 42 insertions, 21 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 19f7516d3..7887596f0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -64,7 +64,7 @@ macos:
tags:
- macos
before_script:
- - pip3 install --user meson==0.56
+ - pip3 install --user meson==0.56.2
- pip3 install --user ninja
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
script:
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index eb442e3bc..182781178 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -393,6 +393,7 @@ gdk_pixbuf_io_init_modules (const char *filename,
channel = g_io_channel_new_file (filename, "r", &local_error);
if (!channel) {
+ char *filename_utf8 = g_filename_display_name (filename);
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_INVALID_ARGUMENT,
@@ -401,9 +402,10 @@ gdk_pixbuf_io_init_modules (const char *filename,
"Try running the command\n"
" gdk-pixbuf-query-loaders > %s\n"
"to make things work again for the time being.",
- filename, local_error->message, filename);
+ filename_utf8, local_error->message, filename_utf8);
g_clear_error (&local_error);
g_string_free (tmp_buf, TRUE);
+ g_free (filename_utf8);
return FALSE;
}
@@ -544,11 +546,13 @@ gdk_pixbuf_io_init_modules (const char *filename,
g_io_channel_unref (channel);
if (g_slist_length (file_formats) <= num_formats) {
+ char *filename_utf8 = g_filename_display_name (filename);
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_INITIALIZED,
"No new GdkPixbufModule loaded from '%s'",
- filename);
+ filename_utf8);
+ g_free (filename_utf8);
return FALSE;
}
#endif
@@ -797,11 +801,13 @@ gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module,
module = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
if (!module) {
+ char *path_utf8 = g_filename_display_name (path);
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_FAILED,
_("Unable to load image-loading module: %s: %s"),
- path, g_module_error ());
+ path_utf8, g_module_error ());
+ g_free (path_utf8);
return FALSE;
}
@@ -812,11 +818,13 @@ gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module,
(* fill_vtable) (image_module);
return TRUE;
} else {
+ char *path_utf8 = g_filename_display_name (path);
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_FAILED,
_("Image-loading module %s does not export the proper interface; perhaps it’s from a different gdk-pixbuf version?"),
- path);
+ path_utf8);
+ g_free (path_utf8);
return FALSE;
}
}
diff --git a/gdk-pixbuf/io-bmp.c b/gdk-pixbuf/io-bmp.c
index b2d2a4f16..f2daf90ca 100644
--- a/gdk-pixbuf/io-bmp.c
+++ b/gdk-pixbuf/io-bmp.c
@@ -1307,10 +1307,10 @@ gdk_pixbuf__bmp_image_load_increment(gpointer data,
case READ_STATE_PALETTE:
if (!DecodeColormap (context->buff, context, error)) {
- g_set_error (error,
- GDK_PIXBUF_ERROR,
- GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
- _("Error while decoding colormap"));
+ g_set_error_literal (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Error while decoding colormap"));
return FALSE;
}
break;
diff --git a/meson.build b/meson.build
index 4724bf5cc..8328fcbc3 100644
--- a/meson.build
+++ b/meson.build
@@ -297,7 +297,7 @@ if get_option('png')
# that will bypass --wrap-mode and cause issues for distro packagers.
# See: https://mesonbuild.com/Reference-manual.html#dependency
if not png_dep.found()
- png_dep = dependency('', required: false, fallback: 'libpng')
+ png_dep = dependency('', required: false, fallback: ['libpng', 'png_dep'])
if png_dep.found()
enabled_loaders += 'png'
loaders_deps += png_dep
@@ -324,25 +324,38 @@ endif
# Don't check and build the jpeg loader if native_windows_loaders is true
if get_option('jpeg') and not native_windows_loaders
- if cc.has_header('jpeglib.h')
+ jpeg_dep = dependency('libjpeg', required: false)
+
+ if not jpeg_dep.found() and cc.has_header('jpeglib.h')
jpeg_dep = cc.find_library('jpeg', required: false)
if cc.get_id() == 'msvc' and not jpeg_dep.found()
# The IJG JPEG library builds the .lib file as libjpeg.lib in its MSVC build system,
# so look for it as well when jpeg.lib cannot be found
jpeg_dep = cc.find_library('libjpeg', required: false)
endif
+ endif
- if not jpeg_dep.found()
- jpeg_dep = dependency('libjpeg', required: false, fallback: 'libjpeg')
- endif
+ # If we couldn't find libjpeg in our include/linker paths,
+ # then use pkg-config, and if that fails, fall back to the
+ # wrap
+ if not jpeg_dep.found()
+ jpeg_dep = dependency('libjpeg', required: false, fallback: ['libjpeg', 'jpeg_dep'])
+ endif
+
+ if jpeg_dep.found()
+ enabled_loaders += 'jpeg'
+ loaders_deps += jpeg_dep
- if jpeg_dep.found() and cc.has_function('jpeg_destroy_decompress', dependencies: jpeg_dep)
- enabled_loaders += 'jpeg'
- loaders_deps += jpeg_dep
+ if jpeg_dep.type_name() == 'internal'
+ has_destroy_decompress = true
+ has_simple_progression = true
+ else
+ has_destroy_decompress = cc.has_function('jpeg_destroy_decompress', dependencies: jpeg_dep)
+ has_simple_progression = cc.has_function('jpeg_simple_progression', dependencies: jpeg_dep)
+ endif
- gdk_pixbuf_conf.set('HAVE_PROGRESSIVE_JPEG',
- cc.has_function('jpeg_simple_progression',
- dependencies: jpeg_dep))
+ if has_destroy_decompress and has_simple_progression
+ gdk_pixbuf_conf.set('HAVE_PROGRESSIVE_JPEG', has_simple_progression)
endif
endif
endif
diff --git a/subprojects/libjpeg.wrap b/subprojects/libjpeg.wrap
index 1433fce3a..54a7fe624 100644
--- a/subprojects/libjpeg.wrap
+++ b/subprojects/libjpeg.wrap
@@ -2,7 +2,7 @@
directory = jpeg-9c
source_url = http://ijg.org/files/jpegsrc.v9c.tar.gz
source_filename = jpegsrc.v9c.tar.gz
-source_hash = 650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122
+source_hash = 1e9793e1c6ba66e7e0b6e5fe7fd0f9e935cc697854d5737adec54d93e5b3f730
patch_url = https://wrapdb.mesonbuild.com/v1/projects/libjpeg/9c/3/get_zip
patch_filename = libjpeg-9c-3-wrap.zip
patch_hash = 2d66676d254be9198d8b6b62a798d6858c7f7cea9ed0e93809d6c035351a9bba