nixpkgs-suyu/pkgs/development/tools/nsis/default.nix

75 lines
1.8 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, symlinkJoin
2020-08-19 20:14:31 +02:00
, fetchurl
, fetchzip
, sconsPackages
, zlib
, libiconv
2020-08-19 20:14:31 +02:00
}:
2019-03-06 22:21:08 +01:00
2019-03-14 17:59:21 +01:00
stdenv.mkDerivation rec {
pname = "nsis";
2020-08-19 20:14:31 +02:00
version = "3.06.1";
2019-03-06 22:21:08 +01:00
src =
fetchurl {
2019-03-14 20:32:53 +01:00
url = "mirror://sourceforge/project/nsis/NSIS%203/${version}/nsis-${version}-src.tar.bz2";
2020-08-19 20:14:31 +02:00
sha256 = "1w1z2m982l6j8lw8hy91c3979wbnqglcf4148f9v79vl32znhpcv";
2019-03-06 22:21:08 +01:00
};
srcWinDistributable =
fetchzip {
2019-03-14 20:32:53 +01:00
url = "mirror://sourceforge/project/nsis/NSIS%203/${version}/nsis-${version}.zip";
2020-08-19 20:14:31 +02:00
sha256 = "04qm9jqbcybpwcrjlksggffdyafzwxxcaz9xhjw8w5rb95x7lw5q";
2019-03-06 22:21:08 +01:00
};
2019-03-14 17:53:36 +01:00
postUnpack = ''
mkdir -p $out/share/nsis
cp -avr ${srcWinDistributable}/{Contrib,Include,Plugins,Stubs} \
$out/share/nsis
2020-02-02 10:19:25 +01:00
chmod -R u+w $out/share/nsis
2019-03-14 17:53:36 +01:00
'';
nativeBuildInputs = [ sconsPackages.scons_3_1_2 ];
buildInputs = [ zlib ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
CPPPATH = symlinkJoin {
name = "nsis-includes";
paths = [ zlib.dev ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
};
LIBPATH = symlinkJoin {
name = "nsis-libs";
paths = [ zlib ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
};
2019-03-06 22:21:08 +01:00
2019-03-14 17:53:36 +01:00
sconsFlags = [
"SKIPSTUBS=all"
"SKIPPLUGINS=all"
"SKIPUTILS=all"
"SKIPMISC=all"
"NSIS_CONFIG_CONST_DATA=no"
] ++ lib.optional stdenv.isDarwin "APPEND_LINKFLAGS=-liconv";
2019-03-14 17:53:36 +01:00
preBuild = ''
sconsFlagsArray+=(
"PATH=$PATH"
"CC=$CC"
"CXX=$CXX"
"APPEND_CPPPATH=$CPPPATH/include"
"APPEND_LIBPATH=$LIBPATH/lib"
)
2019-03-14 17:53:36 +01:00
'';
2019-03-06 22:21:08 +01:00
2019-03-14 17:53:36 +01:00
prefixKey = "PREFIX=";
2019-11-04 13:33:53 +01:00
installTargets = [ "install-compiler" ];
2019-03-06 22:21:08 +01:00
meta = with lib; {
description = "A free scriptable win32 installer/uninstaller system that doesn't suck and isn't huge";
homepage = "https://nsis.sourceforge.io/";
2019-03-06 22:21:08 +01:00
license = licenses.zlib;
platforms = platforms.unix;
2019-03-06 22:21:08 +01:00
maintainers = with maintainers; [ pombeirp ];
};
}