forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / ic / icoutils / package.nix
blob1806699b1c23bb6af14d12215fc4ce25327cf22c
1 { lib, stdenv, fetchurl, fetchpatch, autoreconfHook, libpng, perl, perlPackages, makeWrapper }:
3 stdenv.mkDerivation rec {
4   pname = "icoutils";
5   version = "0.32.3";
7   src = fetchurl {
8     url = "mirror://savannah/icoutils/icoutils-${version}.tar.bz2";
9     sha256 = "1q66cksms4l62y0wizb8vfavhmf7kyfgcfkynil3n99s0hny1aqp";
10   };
12   patches = [
13     # Fixes a linker failure with newer versions of ld64 due to not supporting nested archives.
14     (fetchpatch {
15       url = "https://git.savannah.nongnu.org/cgit/icoutils.git/patch/?id=aa3572119bfe34484025f37dbbc4d5070f735908";
16       hash = "sha256-4YCI+SYT2bCBNegkpN5jcfi6gOeec65TmCABr98HHB4=";
17     })
18   ];
20   nativeBuildInputs = [ autoreconfHook makeWrapper ];
21   buildInputs = [ libpng perl ];
22   propagatedBuildInputs = [ perlPackages.LWP ];
24   # Fixes build failures on Darwin. These should be defined in `TargetConditional.h`, but it’s failing anyway.
25   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DTARGET_OS_IPHONE=0 -DTARGET_OS_EMBEDDED=0";
27   postPatch = ''
28     patchShebangs extresso/extresso
29     patchShebangs extresso/extresso.in
30     patchShebangs extresso/genresscript
31     patchShebangs extresso/genresscript.in
32   '';
34   preFixup = ''
35     wrapProgram $out/bin/extresso --prefix PERL5LIB : $PERL5LIB
36     wrapProgram $out/bin/genresscript --prefix PERL5LIB : $PERL5LIB
37   '';
39   meta = {
40     homepage = "https://www.nongnu.org/icoutils/";
41     description = "Set of programs to deal with Microsoft Windows(R) icon and cursor files";
42     license = lib.licenses.gpl3Plus;
43     platforms = with lib.platforms; linux ++ darwin;
44   };