forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / libraries / libgdiplus / default.nix
blob63efe5430537fd39085534dfdbe75277aa36e2ab
1 { lib, stdenv, fetchzip, pkg-config, glib, cairo, Carbon, fontconfig
2 , libtiff, giflib, libjpeg, libpng
3 , libXrender, libexif, autoreconfHook }:
5 stdenv.mkDerivation (finalAttrs: {
6   pname = "libgdiplus";
7   version = "6.1";
9   # Using source archive to avoid fetching Git submodules.
10   # Git repo: https://github.com/mono/libgdiplus
11   src = fetchzip {
12     url = "https://download.mono-project.com/sources/libgdiplus/libgdiplus-${finalAttrs.version}.tar.gz";
13     hash = "sha256-+lP9ETlw3s0RUliQT1uBWZ2j6o3V9EECBQSppOYFq4Q=";
14   };
16   patches = [
17     # Fix pkg-config lookup when cross-compiling.
18     ./configure-pkg-config.patch
19   ];
21   NIX_LDFLAGS = "-lgif";
23   outputs = [ "out" "dev" ];
25   hardeningDisable = [ "format" ];
27   nativeBuildInputs = [ autoreconfHook pkg-config ];
29   configureFlags = lib.optional stdenv.cc.isClang "--host=${stdenv.hostPlatform.system}";
31   enableParallelBuilding = true;
33   buildInputs =
34     [ glib cairo fontconfig libtiff giflib
35       libjpeg libpng libXrender libexif
36     ]
37     ++ lib.optional stdenv.hostPlatform.isDarwin Carbon;
39   postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
40     ln -s $out/lib/libgdiplus.0.dylib $out/lib/libgdiplus.so
41   '';
43   checkPhase = ''
44     make check -w
45   '';
47   meta = with lib; {
48     description = "Mono library that provides a GDI+-compatible API on non-Windows operating systems";
49     homepage = "https://www.mono-project.com/docs/gui/libgdiplus/";
50     platforms = platforms.unix;
51     license = licenses.mit;
52   };