nsis: enable builds on darwin. (#120903)

Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Maisem Ali 2021-04-29 17:36:54 -07:00 committed by GitHub
parent f3418315d4
commit 0dde9ab531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,11 @@
{ lib, stdenv
{ lib
, stdenv
, symlinkJoin
, fetchurl
, fetchzip
, sconsPackages
, zlib
, libiconv
}:
stdenv.mkDerivation rec {
@ -28,20 +31,34 @@ stdenv.mkDerivation rec {
'';
nativeBuildInputs = [ sconsPackages.scons_3_1_2 ];
buildInputs = [ zlib ];
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 ];
};
sconsFlags = [
"SKIPSTUBS=all"
"SKIPPLUGINS=all"
"SKIPUTILS=all"
"SKIPMISC=all"
"APPEND_CPPPATH=${zlib.dev}/include"
"APPEND_LIBPATH=${zlib}/lib"
"NSIS_CONFIG_CONST_DATA=no"
];
] ++ lib.optional stdenv.isDarwin "APPEND_LINKFLAGS=-liconv";
preBuild = ''
sconsFlagsArray+=("PATH=$PATH")
sconsFlagsArray+=(
"PATH=$PATH"
"CC=$CC"
"CXX=$CXX"
"APPEND_CPPPATH=$CPPPATH/include"
"APPEND_LIBPATH=$LIBPATH/lib"
)
'';
prefixKey = "PREFIX=";
@ -51,7 +68,7 @@ stdenv.mkDerivation rec {
description = "A free scriptable win32 installer/uninstaller system that doesn't suck and isn't huge";
homepage = "https://nsis.sourceforge.io/";
license = licenses.zlib;
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers; [ pombeirp ];
};
}