xviewer: Support avif, heif, jxl, webp (#533936)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
docbook_xsl,
|
||||
exempi,
|
||||
gdk-pixbuf,
|
||||
@@ -25,6 +26,11 @@
|
||||
yelp-tools,
|
||||
xapp,
|
||||
xapp-symbolic-icons,
|
||||
gnome,
|
||||
libavif,
|
||||
libheif,
|
||||
libjxl,
|
||||
webp-pixbuf-loader,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
@@ -38,6 +44,14 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-ayd91gVLuSUVlCxaPSBbx7hg4tthVTaBEnl5V9YYbQw=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# build: Add support for GIRepository-2.0.
|
||||
(fetchpatch {
|
||||
url = "https://github.com/linuxmint/xviewer/commit/74d7d4ba2584c658ae6fb87208543671664943cc.patch";
|
||||
hash = "sha256-lL4MTvC2RvdVZ4O5RaYyK+1sHnLGPYzGNbZ99aN22U8=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
docbook_xsl
|
||||
gobject-introspection
|
||||
@@ -66,16 +80,19 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
xapp
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# Switch to girepository-2.0
|
||||
substituteInPlace src/main.c \
|
||||
--replace-fail "#include <girepository.h>" "#include <girepository/girepository.h>" \
|
||||
--replace-fail "g_irepository_get_option_group" "gi_repository_get_option_group"
|
||||
|
||||
substituteInPlace src/xviewer-plugin-engine.c \
|
||||
--replace-fail "#include <girepository.h>" "#include <girepository/girepository.h>" \
|
||||
--replace-fail "g_irepository_get_default" "gi_repository_dup_default" \
|
||||
--replace-fail "g_irepository_require" "gi_repository_require"
|
||||
postInstall = ''
|
||||
# In postInstall to run before gappsWrapperArgsHook.
|
||||
export GDK_PIXBUF_MODULE_FILE="${
|
||||
gnome._gdkPixbufCacheBuilder_DO_NOT_USE {
|
||||
extraLoaders = [
|
||||
libavif
|
||||
libheif.lib
|
||||
libjxl
|
||||
librsvg
|
||||
webp-pixbuf-loader
|
||||
];
|
||||
}
|
||||
}"
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
|
||||
Reference in New Issue
Block a user