aboutsummaryrefslogtreecommitdiff
path: root/nix/winscp.nix
blob: 10d3cb2891185fde006f0e8e7fe4d5959e09a295 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
pkgs:

pkgs.stdenv.mkDerivation rec {
  pname = "winscp";
  version = "5.19.6";

  src = pkgs.fetchzip {
    url = "https://winscp.net/download/WinSCP-${version}-Portable.zip";
    sha256 = "sha256-8+6JuT0b1fFQ6etaFTMSjIKvDGzmJoHAuByXiqCBzu0=";
    stripRoot = false;
  };

  buildPhase = ''
    cat > winscp <<EOF
#!${pkgs.bash}/bin/bash

WINEDEBUG=-all
${pkgs.winePackages.minimal}/bin/wine $out/opt/WinSCP.com
EOF
  '';

  installPhase = ''
    mkdir -p $out/{bin,opt}
    cp {WinSCP.com,WinSCP.exe} $out/opt
    cp winscp $out/bin
    chmod +x $out/bin/winscp
  '';
}