2020-06-18 07:06:33 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, nixosTests
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, gettext
|
|
|
|
, python3
|
|
|
|
, libxslt
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, docbook_xml_dtd_43
|
2021-05-20 23:08:51 +00:00
|
|
|
, gi-docgen
|
2020-06-18 07:06:33 +00:00
|
|
|
, glib
|
|
|
|
, libtiff
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
2021-05-20 23:08:51 +00:00
|
|
|
, gnome
|
2022-08-12 12:06:08 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, buildPackages
|
2020-06-18 07:06:33 +00:00
|
|
|
, doCheck ? false
|
|
|
|
, makeWrapper
|
2020-10-27 00:29:36 +00:00
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gdk-pixbuf";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "2.42.8";
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
outputs = [ "out" "dev" "man" "devdoc" ]
|
2021-06-28 23:13:55 +00:00
|
|
|
++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-05 17:12:51 +00:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "hKzqOsskEbKRNLMgFaWxqqYoRLGcSx74uJccawdZ9MY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Move installed tests to a separate output
|
|
|
|
./installed-tests-path.patch
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# gdk-pixbuf-thumbnailer is not wrapped therefore strictDeps will work
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
2020-06-18 07:06:33 +00:00
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
gettext
|
|
|
|
python3
|
|
|
|
makeWrapper
|
|
|
|
glib
|
2021-05-20 23:08:51 +00:00
|
|
|
gi-docgen
|
2022-08-12 12:06:08 +00:00
|
|
|
gobject-introspection
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
# for man pages
|
|
|
|
libxslt
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_43
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
fixDarwinDylibNames
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = [ gobject-introspection ];
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
libtiff
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dgio_sniffing=false"
|
2022-08-12 12:06:08 +00:00
|
|
|
"-Dgtk_doc=true"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
chmod +x build-aux/* # patchShebangs only applies to executables
|
|
|
|
patchShebangs build-aux
|
|
|
|
|
|
|
|
substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests"
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
|
|
|
|
# it should be a build-time dep for build
|
|
|
|
# TODO: send upstream
|
|
|
|
substituteInPlace docs/meson.build \
|
|
|
|
--replace "dependency('gi-docgen'," "dependency('gi-docgen', native:true," \
|
|
|
|
--replace "'gi-docgen', req" "'gi-docgen', native:true, req"
|
2021-05-20 23:08:51 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall =
|
2021-05-20 23:08:51 +00:00
|
|
|
''
|
|
|
|
# All except one utility seem to be only useful during building.
|
|
|
|
moveToOutput "bin" "$dev"
|
|
|
|
moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
|
|
|
|
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
# meson erroneously installs loaders with .dylib extension on Darwin.
|
|
|
|
# Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them.
|
2020-04-24 23:36:52 +00:00
|
|
|
for f in $out/${passthru.moduleDir}/*.dylib; do
|
|
|
|
install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
|
|
|
|
mv $f ''${f%.dylib}.so
|
|
|
|
done
|
2022-08-12 12:06:08 +00:00
|
|
|
'' + ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/
|
2022-08-12 12:06:08 +00:00
|
|
|
${stdenv.hostPlatform.emulator buildPackages} $dev/bin/gdk-pixbuf-query-loaders --update-cache
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# The fixDarwinDylibNames hook doesn't patch binaries.
|
2021-02-05 17:12:51 +00:00
|
|
|
preFixup = lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
for f in $out/bin/* $dev/bin/*; do
|
|
|
|
install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
postFixup = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
|
|
|
|
moveToOutput "share/doc" "$devdoc"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB).
|
|
|
|
inherit doCheck;
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
separateDebugInfo = stdenv.isLinux;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
passthru = {
|
2021-05-20 23:08:51 +00:00
|
|
|
updateScript = gnome.updateScript {
|
2020-04-24 23:36:52 +00:00
|
|
|
packageName = pname;
|
2021-05-20 23:08:51 +00:00
|
|
|
versionPolicy = "odd-unstable";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.gdk-pixbuf;
|
|
|
|
};
|
|
|
|
|
|
|
|
# gdk_pixbuf_moduledir variable from gdk-pixbuf-2.0.pc
|
|
|
|
moduleDir = "lib/gdk-pixbuf-2.0/2.10.0/loaders";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A library for image loading and manipulation";
|
2020-06-18 07:06:33 +00:00
|
|
|
homepage = "https://gitlab.gnome.org/GNOME/gdk-pixbuf";
|
2020-12-03 08:41:04 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
|
|
|
|
mainProgram = "gdk-pixbuf-thumbnailer";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|