forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / is / iscc / package.nix
blob03f231ca365c9b38c4df684a5c9398afd77b0d7c
1 { stdenv
2 , fetchurl
3 , innoextract
4 , runtimeShell
5 , wineWow64Packages
6 , lib
7 }:
9 let
10   version = "6.2.2";
11   majorVersion = builtins.substring 0 1 version;
13 stdenv.mkDerivation rec {
14   pname = "iscc";
15   inherit version;
16   src = fetchurl {
17     url = "https://files.jrsoftware.org/is/${majorVersion}/innosetup-${version}.exe";
18     hash = "sha256-gRfRDQCirTOhOQl46jhyhhwzDgh5FEEKY3eyLExbhWM=";
19   };
20   nativeBuildInputs = [
21     innoextract
22     wineWow64Packages.stable
23   ];
24   unpackPhase = ''
25     runHook preUnpack
26     innoextract $src
27     runHook postUnpack
28   '';
29   dontBuild = true;
30   installPhase = ''
31     runHook preInstall
32     mkdir -p "$out/bin"
33     cp -r ./app/* "$out/bin"
35     cat << 'EOF' > "$out/bin/iscc"
36     #!${runtimeShell}
37     export PATH=${wineWow64Packages.stable}/bin:$PATH
38     export WINEDLLOVERRIDES="mscoree=" # disable mono
40     # Solves PermissionError: [Errno 13] Permission denied: '/homeless-shelter/.wine'
41     export HOME=$(mktemp -d)
43     wineInputFile=$(${wineWow64Packages.stable}/bin/wine winepath -w $1)
44     ${wineWow64Packages.stable}/bin/wine "$out/bin/ISCC.exe" "$wineInputFile"
45     EOF
47     substituteInPlace $out/bin/iscc \
48       --replace "\$out" "$out"
50     chmod +x "$out/bin/iscc"
52     runHook postInstall
53   '';
56   meta = with lib; {
57     description = "Compiler for Inno Setup, a tool for creating Windows installers";
58     homepage = "https://jrsoftware.org/isinfo.php";
59     changelog = "https://jrsoftware.org/files/is6-whatsnew.htm";
60     license = licenses.unfreeRedistributable;
61     maintainers = [ ];
62     platforms = wineWow64Packages.stable.meta.platforms;
63   };