putty: build on windows

+18 -5
+18 -5
pkgs/applications/networking/remote/putty/default.nix
··· 1 { stdenv, fetchurl, autoconf, automake, pkgconfig, libtool 2 - , gtk2, halibut, ncurses, perl }: 3 4 stdenv.mkDerivation rec { 5 version = "0.70"; ··· 13 sha256 = "1gmhwwj1y7b5hgkrkxpf4jddjpk9l5832zq5ibhsiicndsfs92mv"; 14 }; 15 16 - preConfigure = '' 17 perl mkfiles.pl 18 ( cd doc ; make ); 19 sed -e '/AM_PATH_GTK(/d' \ ··· 21 -e '/AC_OUTPUT/iAM_PROG_AR' -i configure.ac 22 ./mkauto.sh 23 cd unix 24 ''; 25 26 nativeBuildInputs = [ autoconf automake halibut libtool perl pkgconfig ]; 27 - buildInputs = [ gtk2 ncurses ]; 28 enableParallelBuilding = true; 29 30 - meta = with stdenv.lib; { 31 description = "A Free Telnet/SSH Client"; 32 longDescription = '' 33 PuTTY is a free implementation of Telnet and SSH for Windows and Unix ··· 36 ''; 37 homepage = https://www.chiark.greenend.org.uk/~sgtatham/putty/; 38 license = licenses.mit; 39 - platforms = platforms.linux; 40 }; 41 }
··· 1 { stdenv, fetchurl, autoconf, automake, pkgconfig, libtool 2 + , gtk2, halibut, ncurses, perl 3 + , hostPlatform, lib }: 4 5 stdenv.mkDerivation rec { 6 version = "0.70"; ··· 14 sha256 = "1gmhwwj1y7b5hgkrkxpf4jddjpk9l5832zq5ibhsiicndsfs92mv"; 15 }; 16 17 + preConfigure = lib.optionalString hostPlatform.isUnix '' 18 perl mkfiles.pl 19 ( cd doc ; make ); 20 sed -e '/AM_PATH_GTK(/d' \ ··· 22 -e '/AC_OUTPUT/iAM_PROG_AR' -i configure.ac 23 ./mkauto.sh 24 cd unix 25 + '' + lib.optionalString hostPlatform.isWindows '' 26 + cd windows 27 ''; 28 29 + TOOLPATH = stdenv.cc.targetPrefix; 30 + makefile = if hostPlatform.isWindows then "Makefile.mgw" else null; 31 + 32 + installPhase = if hostPlatform.isWindows then '' 33 + for exe in *.exe; do 34 + install -D $exe $out/bin/$exe 35 + done 36 + '' else null; 37 + 38 nativeBuildInputs = [ autoconf automake halibut libtool perl pkgconfig ]; 39 + buildInputs = [] 40 + ++ lib.optionals hostPlatform.isUnix [ gtk2 ncurses ]; 41 enableParallelBuilding = true; 42 43 + meta = with lib; { 44 description = "A Free Telnet/SSH Client"; 45 longDescription = '' 46 PuTTY is a free implementation of Telnet and SSH for Windows and Unix ··· 49 ''; 50 homepage = https://www.chiark.greenend.org.uk/~sgtatham/putty/; 51 license = licenses.mit; 52 + platforms = platforms.unix ++ platforms.windows; 53 }; 54 }