2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, fetchzip, pkg-config, glib, cairo, Carbon, fontconfig
|
2020-04-24 23:36:52 +00:00
|
|
|
, libtiff, giflib, libjpeg, libpng
|
|
|
|
, libXrender, libexif, autoreconfHook, fetchpatch }:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libgdiplus";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "6.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# Using source archive to avoid fetching Git submodules.
|
|
|
|
# Git repo: https://github.com/mono/libgdiplus
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://download.mono-project.com/sources/libgdiplus/libgdiplus-${finalAttrs.version}.tar.gz";
|
|
|
|
hash = "sha256-+lP9ETlw3s0RUliQT1uBWZ2j6o3V9EECBQSppOYFq4Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
# Fix pkg-config lookup when cross-compiling.
|
|
|
|
./configure-pkg-config.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
NIX_LDFLAGS = "-lgif";
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
configureFlags = lib.optional stdenv.cc.isClang "--host=${stdenv.hostPlatform.system}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs =
|
|
|
|
[ glib cairo fontconfig libtiff giflib
|
|
|
|
libjpeg libpng libXrender libexif
|
|
|
|
]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin Carbon;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
ln -s $out/lib/libgdiplus.0.dylib $out/lib/libgdiplus.so
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
make check -w
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Mono library that provides a GDI+-compatible API on non-Windows operating systems";
|
|
|
|
homepage = "https://www.mono-project.com/docs/gui/libgdiplus/";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|