1{
2 stdenv,
3 lib,
4 fetchurl,
5 cmake,
6 perl,
7 pkg-config,
8 gtk3,
9 ncurses,
10 copyDesktopItems,
11 makeDesktopItem,
12}:
13
14stdenv.mkDerivation rec {
15 version = "0.83";
16 pname = "putty";
17
18 src = fetchurl {
19 urls = [
20 "https://the.earth.li/~sgtatham/putty/${version}/${pname}-${version}.tar.gz"
21 "ftp://ftp.wayne.edu/putty/putty-website-mirror/${version}/${pname}-${version}.tar.gz"
22 ];
23 hash = "sha256-cYd3wT1j0N/5H+AxYrwqBbTfyLCCdjTNYLUc79/2McY=";
24 };
25
26 nativeBuildInputs = [
27 cmake
28 perl
29 pkg-config
30 copyDesktopItems
31 ];
32 buildInputs = lib.optionals stdenv.hostPlatform.isUnix [
33 gtk3
34 ncurses
35 ];
36 enableParallelBuilding = true;
37
38 desktopItems = [
39 (makeDesktopItem {
40 name = "PuTTY SSH Client";
41 exec = "putty";
42 icon = "putty";
43 desktopName = "PuTTY";
44 comment = "Connect to an SSH server with PuTTY";
45 categories = [
46 "GTK"
47 "Network"
48 ];
49 })
50 (makeDesktopItem {
51 name = "PuTTY Terminal Emulator";
52 exec = "pterm";
53 icon = "pterm";
54 desktopName = "Pterm";
55 comment = "Start a PuTTY terminal session";
56 categories = [
57 "GTK"
58 "System"
59 "Utility"
60 "TerminalEmulator"
61 ];
62 })
63 ];
64
65 meta = with lib; {
66 description = "Free Telnet/SSH Client";
67 longDescription = ''
68 PuTTY is a free implementation of Telnet and SSH for Windows and Unix
69 platforms, along with an xterm terminal emulator.
70 It is written and maintained primarily by Simon Tatham.
71 '';
72 homepage = "https://www.chiark.greenend.org.uk/~sgtatham/putty/";
73 license = licenses.mit;
74 platforms = platforms.unix ++ platforms.windows;
75 };
76}