nixpkgs/pkgs/by-name/ns/nsis/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

77 lines
1.9 KiB
Nix

{ lib
, stdenv
, symlinkJoin
, fetchurl
, fetchzip
, scons
, zlib
, libiconv
}:
stdenv.mkDerivation rec {
pname = "nsis";
version = "3.06.1";
src =
fetchurl {
url = "mirror://sourceforge/project/nsis/NSIS%203/${version}/nsis-${version}-src.tar.bz2";
sha256 = "1w1z2m982l6j8lw8hy91c3979wbnqglcf4148f9v79vl32znhpcv";
};
srcWinDistributable =
fetchzip {
url = "mirror://sourceforge/project/nsis/NSIS%203/${version}/nsis-${version}.zip";
sha256 = "04qm9jqbcybpwcrjlksggffdyafzwxxcaz9xhjw8w5rb95x7lw5q";
};
postUnpack = ''
mkdir -p $out/share/nsis
cp -avr ${srcWinDistributable}/{Contrib,Include,Plugins,Stubs} \
$out/share/nsis
chmod -R u+w $out/share/nsis
'';
nativeBuildInputs = [ scons ];
buildInputs = [ zlib ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
CPPPATH = symlinkJoin {
name = "nsis-includes";
paths = [ zlib.dev ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
};
LIBPATH = symlinkJoin {
name = "nsis-libs";
paths = [ zlib ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
};
sconsFlags = [
"SKIPSTUBS=all"
"SKIPPLUGINS=all"
"SKIPUTILS=all"
"SKIPMISC=all"
"NSIS_CONFIG_CONST_DATA=no"
] ++ lib.optional stdenv.hostPlatform.isDarwin "APPEND_LINKFLAGS=-liconv";
preBuild = ''
sconsFlagsArray+=(
"PATH=$PATH"
"CC=$CC"
"CXX=$CXX"
"APPEND_CPPPATH=$CPPPATH/include"
"APPEND_LIBPATH=$LIBPATH/lib"
)
'';
prefixKey = "PREFIX=";
installTargets = [ "install-compiler" ];
meta = with lib; {
description = "Free scriptable win32 installer/uninstaller system that doesn't suck and isn't huge";
homepage = "https://nsis.sourceforge.io/";
license = licenses.zlib;
platforms = platforms.unix;
maintainers = with maintainers; [ pombeirp ];
mainProgram = "makensis";
broken = stdenv.hostPlatform.isDarwin;
};
}