2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2020-04-24 23:36:52 +00:00
|
|
|
# Image file formats
|
2022-09-14 18:05:37 +00:00
|
|
|
, libjpeg, libtiff, giflib, libpng, libwebp, libjxl
|
|
|
|
, libspectre
|
2020-04-24 23:36:52 +00:00
|
|
|
# imlib2 can load images from ID3 tags.
|
2022-05-18 14:49:53 +00:00
|
|
|
, libid3tag, librsvg, libheif
|
2021-02-05 17:12:51 +00:00
|
|
|
, freetype , bzip2, pkg-config
|
2022-10-21 18:38:19 +00:00
|
|
|
, x11Support ? true
|
|
|
|
, webpSupport ? true
|
2022-09-14 18:05:37 +00:00
|
|
|
, svgSupport ? false
|
|
|
|
, heifSupport ? false
|
|
|
|
, jxlSupport ? false
|
|
|
|
, psSupport ? false
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
# for passthru.tests
|
|
|
|
, libcaca
|
|
|
|
, diffoscopeMinimal
|
|
|
|
, feh
|
|
|
|
, icewm
|
|
|
|
, openbox
|
|
|
|
, fluxbox
|
|
|
|
, enlightenment
|
2022-10-21 18:38:19 +00:00
|
|
|
, xorg
|
2023-02-16 17:41:37 +00:00
|
|
|
, testers
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-10-21 18:38:19 +00:00
|
|
|
inherit (lib) optional optionals;
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
2023-02-16 17:41:37 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "imlib2";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.11.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-02-16 17:41:37 +00:00
|
|
|
url = "mirror://sourceforge/enlightenment/${finalAttrs.pname}-${finalAttrs.version}.tar.xz";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-9xK2u53K1G2Lj0rVJhDcu667TMgLX9EvkxJNOjgPpr8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
2022-09-14 18:05:37 +00:00
|
|
|
libjpeg libtiff giflib libpng
|
2020-04-24 23:36:52 +00:00
|
|
|
bzip2 freetype libid3tag
|
2022-10-21 18:38:19 +00:00
|
|
|
] ++ optionals x11Support [ xorg.libXft xorg.libXext ]
|
2022-05-18 14:49:53 +00:00
|
|
|
++ optional heifSupport libheif
|
2022-09-14 18:05:37 +00:00
|
|
|
++ optional svgSupport librsvg
|
|
|
|
++ optional webpSupport libwebp
|
|
|
|
++ optional jxlSupport libjxl
|
|
|
|
++ optional psSupport libspectre;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
# Do not build amd64 assembly code on Darwin, because it fails to compile
|
|
|
|
# with unknow directive errors
|
|
|
|
configureFlags = optional stdenv.isDarwin "--enable-amd64=no"
|
2022-05-18 14:49:53 +00:00
|
|
|
++ optional (!svgSupport) "--without-svg"
|
|
|
|
++ optional (!heifSupport) "--without-heif"
|
2020-04-24 23:36:52 +00:00
|
|
|
++ optional (!x11Support) "--without-x";
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit
|
|
|
|
libcaca
|
|
|
|
diffoscopeMinimal
|
|
|
|
feh
|
|
|
|
icewm
|
|
|
|
openbox
|
|
|
|
fluxbox
|
|
|
|
enlightenment;
|
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Image manipulation library";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
This is the Imlib 2 library - a library that does image file loading and
|
|
|
|
saving as well as rendering, manipulation, arbitrary polygon support, etc.
|
|
|
|
It does ALL of these operations FAST. Imlib2 also tries to be highly
|
|
|
|
intelligent about doing them, so writing naive programs can be done
|
|
|
|
easily, without sacrificing speed.
|
|
|
|
'';
|
|
|
|
|
|
|
|
homepage = "https://docs.enlightenment.org/api/imlib2/html";
|
2022-02-10 20:34:41 +00:00
|
|
|
changelog = "https://git.enlightenment.org/legacy/imlib2.git/plain/ChangeLog?h=v${version}";
|
|
|
|
license = licenses.imlib2;
|
2023-02-16 17:41:37 +00:00
|
|
|
pkgConfigModules = [ "imlib2" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-02-16 17:41:37 +00:00
|
|
|
})
|