diff --git a/srcpkgs/gdk-pixbuf/patches/fix-cross.patch b/srcpkgs/gdk-pixbuf/patches/fix-cross.patch new file mode 100644 index 00000000000..4b86e9ebc14 --- /dev/null +++ b/srcpkgs/gdk-pixbuf/patches/fix-cross.patch @@ -0,0 +1,93 @@ +Source: Cogitri +Upstream: No +Reason: fixes cross-compilation by running generators against the host system and compiling them against it too. + +--- gdk-pixbuf/meson.build ++++ gdk-pixbuf/meson.build +@@ -291,11 +291,16 @@ foreach bin: gdkpixbuf_bin + set_variable(bin_name.underscorify(), bin) + endforeach + ++if meson.is_cross_build() ++ gdk_pixbuf_query_loaders = find_program('gdk-pixbuf-query-loaders', native: true) ++endif ++ + # The 'loaders.cache' used for testing, so we don't accidentally + # load the installed cache; we always build it by default + loaders_cache = custom_target('loaders.cache', + output: 'loaders.cache', + capture: true, ++ depends: gdkpixbuf, + command: [ + gdk_pixbuf_query_loaders, + dynamic_loaders, +--- meson.build ++++ meson.build +@@ -212,6 +212,15 @@ endif + + gdk_pixbuf_deps = [ mathlib_dep, gobject_dep, gmodule_dep, gio_dep, shared_mime_dep, medialib_dep ] + ++# cross deps ++if meson.is_cross_build() ++ gobject_dep_native = dependency('gobject-2.0', version: glib_req_version, native: true) ++ gmodule_dep_native = dependency('gmodule-no-export-2.0', native: true) ++ gio_dep_native = dependency('gio-2.0', native: true) ++ gdk_pixbuf_dep_native = dependency('gdk-pixbuf-2.0', native: true) ++ native_deps = [ gobject_dep_native, gmodule_dep_native, gio_dep_native, gdk_pixbuf_dep_native ] ++endif ++ + # Check if we can build shared modules + build_modules = gmodule_dep.get_pkgconfig_variable('gmodule_supported') == 'true' + gdk_pixbuf_conf.set('USE_GMODULE', build_modules) +@@ -396,7 +405,6 @@ endif + # i18n + subdir('po') + +-subdir('tests') + subdir('thumbnailer') + + # Documentation +--- thumbnailer/meson.build ++++ thumbnailer/meson.build +@@ -6,7 +6,36 @@ executable('gdk-pixbuf-thumbnailer', + ], + dependencies: gdk_pixbuf_deps + [ gdkpixbuf_dep ], + install: true) ++if meson.is_cross_build() ++cc = meson.get_compiler('c') + ++gdk_pixbuf_print_mime_types = executable('gdk-pixbuf-print-mime-types', ++ 'gdk-pixbuf-print-mime-types.c', ++ c_args: common_cflags, ++ dependencies: native_deps, ++ native: true, ++ include_directories: include_directories('..')) ++ ++custom_target('thumbnailer', ++ input: 'gdk-pixbuf-thumbnailer.thumbnailer.in', ++ output: 'gdk-pixbuf-thumbnailer.thumbnailer', ++ command: [ ++ gen_thumbnailer, ++ '--printer=@0@'.format('/usr/bin/gdk-pixbuf-thumbnailer'), ++ '--pixdata=@0@'.format('/usr/bin/gdk-pixbuf-pixdata'), ++ '--loaders=@0@'.format('/usr/bin/gdk-pixbuf-query-loaders'), ++ '--bindir=@0@'.format(gdk_pixbuf_bindir), ++ '@INPUT@', ++ '@OUTPUT@', ++ ], ++ depends: [ ++ gdk_pixbuf_print_mime_types, ++ gdk_pixbuf_pixdata, ++ loaders_cache, ++ ], ++ install: true, ++ install_dir: join_paths(gdk_pixbuf_datadir, 'thumbnailers')) ++else + gdk_pixbuf_print_mime_types = executable('gdk-pixbuf-print-mime-types', + 'gdk-pixbuf-print-mime-types.c', + c_args: common_cflags, +@@ -31,3 +60,4 @@ custom_target('thumbnailer', + ], + install: true, + install_dir: join_paths(gdk_pixbuf_datadir, 'thumbnailers')) ++endif diff --git a/srcpkgs/gdk-pixbuf/template b/srcpkgs/gdk-pixbuf/template index 1277f423f0f..4d3ae68139d 100644 --- a/srcpkgs/gdk-pixbuf/template +++ b/srcpkgs/gdk-pixbuf/template @@ -1,35 +1,36 @@ # Template file for 'gdk-pixbuf' pkgname=gdk-pixbuf -version=2.36.12 +version=2.38.0 revision=1 -build_style=gnu-configure -configure_args="$(vopt_enable gir introspection) --without-libjasper - --with-included-loaders=png --with-x11 gio_can_sniff=yes" -hostmakedepends="automake gettext-devel glib-devel libtool pkg-config - $(vopt_if gir 'gobject-introspection')" -makedepends="libX11-devel libglib-devel libpng-devel tiff-devel" +build_style=meson +configure_args="-Dgir=$(vopt_if gir true false) -Djasper=false + -Dpng=true -Dx11=true -Dinstalled_tests=false" +hostmakedepends="gettext-devel glib-devel pkg-config + $(vopt_if gir 'gobject-introspection') libxslt docbook-xsl" +makedepends="libX11-devel libglib-devel libpng-devel tiff-devel + shared-mime-info" short_desc="Image loading library for The GTK+ toolkit (v2)" maintainer="Juan RP " -homepage="https://wiki.gnome.org/Projects/GdkPixbuf" license="GPL-2.0-or-later" +homepage="https://wiki.gnome.org/Projects/GdkPixbuf" distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz" -checksum=fff85cf48223ab60e3c3c8318e2087131b590fd6f1737e42cb3759a3b427a334 +checksum=dd50973c7757bcde15de6bcd3a6d462a445efd552604ae6435a0532fbbadae47 # Package build options build_options="gir" # Disable gir for cross builds. -if [ -z "$CROSS_BUILD" ]; then +if [ "$CROSS_BUILD" ]; then + hostmakedepends+=" gdk-pixbuf-devel" +else build_options_default="gir" fi pre_configure() { - sed -i '/SUBDIRS/s/tests//' Makefile.am - autoreconf -fi - # Can't create loaders.cache with cross compiled modules if [ "$CROSS_BUILD" ]; then touch gdk-pixbuf/loaders.cache fi + sed -i "s|subdir('tests')||g" -i meson.build } gdk-pixbuf-xlib_package() { @@ -38,6 +39,7 @@ gdk-pixbuf-xlib_package() { vmove usr/lib/libgdk_pixbuf_xlib*.so.* } } + gdk-pixbuf-devel_package() { depends="${makedepends} ${sourcepkg}-xlib>=${version}_${revision} ${sourcepkg}>=${version}_${revision}" short_desc+=" - development files" @@ -50,6 +52,5 @@ gdk-pixbuf-devel_package() { if [ "$build_option_gir" ]; then vmove usr/share/gir-1.0 fi - vmove usr/share/gtk-doc } }