Files
nixpkgs/pkgs/by-name/is/iscc/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

69 lines
1.8 KiB
Nix

{
stdenv,
fetchurl,
innoextract,
runtimeShell,
wineWow64Packages,
lib,
}:
let
version = "6.2.2";
majorVersion = builtins.substring 0 1 version;
in
stdenv.mkDerivation rec {
pname = "iscc";
inherit version;
src = fetchurl {
url = "https://files.jrsoftware.org/is/${majorVersion}/innosetup-${version}.exe";
hash = "sha256-gRfRDQCirTOhOQl46jhyhhwzDgh5FEEKY3eyLExbhWM=";
};
nativeBuildInputs = [
innoextract
wineWow64Packages.stable
];
unpackPhase = ''
runHook preUnpack
innoextract $src
runHook postUnpack
'';
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p "$out/bin"
cp -r ./app/* "$out/bin"
cat << 'EOF' > "$out/bin/iscc"
#!${runtimeShell}
export PATH=${wineWow64Packages.stable}/bin:$PATH
export WINEDLLOVERRIDES="mscoree=" # disable mono
# Solves PermissionError: [Errno 13] Permission denied: '/homeless-shelter/.wine'
export HOME=$(mktemp -d)
wineInputFile=$(${wineWow64Packages.stable}/bin/wine winepath -w $1)
${wineWow64Packages.stable}/bin/wine "$out/bin/ISCC.exe" "$wineInputFile"
EOF
substituteInPlace $out/bin/iscc \
--replace "\$out" "$out"
chmod +x "$out/bin/iscc"
runHook postInstall
'';
# Stripping causes `$out/bin/Setup.e32` to lose something important and causes the built windows installers to not run on windows "This app can't run on your PC".
# They worked in wine but not on real windows.
dontStrip = 1;
meta = with lib; {
description = "Compiler for Inno Setup, a tool for creating Windows installers";
homepage = "https://jrsoftware.org/isinfo.php";
changelog = "https://jrsoftware.org/files/is6-whatsnew.htm";
license = licenses.unfreeRedistributable;
maintainers = [ ];
platforms = wineWow64Packages.stable.meta.platforms;
};
}