1{
2 stdenv,
3 lib,
4 fetchurl,
5 cairo,
6 pango,
7 libpng,
8 expat,
9 fontconfig,
10 gtk2,
11 xorg,
12 autoPatchelfHook,
13}:
14stdenv.mkDerivation (finalAttrs: {
15 pname = "hterm";
16 version = "0.8.9";
17
18 src =
19 let
20 versionWithoutDots = builtins.replaceStrings [ "." ] [ "" ] finalAttrs.version;
21 in
22 if stdenv.targetPlatform.is64bit then
23 fetchurl {
24 url = "https://www.der-hammer.info/terminal/hterm${versionWithoutDots}-linux-64.tgz";
25 hash = "sha256-DY+X7FaU1UBbNf/Kgy4TzBZiocQ4/TpJW3KLW1iu0M0=";
26 }
27 else
28 fetchurl {
29 url = "https://www.der-hammer.info/terminal/hterm${versionWithoutDots}-linux-32.tgz";
30 hash = "sha256-7wJFCpeXNMX94tk0QVc0T22cbv3ODIswFge5Cs0JhI8=";
31 };
32 sourceRoot = ".";
33
34 nativeBuildInputs = [ autoPatchelfHook ];
35
36 buildInputs = [
37 cairo
38 pango
39 libpng
40 expat
41 fontconfig.lib
42 gtk2
43 xorg.libSM
44 ];
45
46 installPhase = ''
47 runHook preInstall
48 install -m755 -D hterm $out/bin/hterm
49 install -m644 -D desktop/hterm.png $out/share/pixmaps/hterm.png
50 install -m644 -D desktop/hterm.desktop $out/share/applications/hterm.desktop
51 runHook postInstall
52 '';
53
54 passthru = {
55 updateScript = ./update.sh;
56 };
57
58 meta = {
59 homepage = "https://www.der-hammer.info/pages/terminal.html";
60 changelog = "https://www.der-hammer.info/terminal/CHANGELOG.txt";
61 description = "Terminal program for serial communication";
62 # See https://www.der-hammer.info/terminal/LICENSE.txt
63 license = lib.licenses.unfree;
64 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
65 platforms = [
66 "x86_64-linux"
67 "i686-linux"
68 ];
69 maintainers = with lib.maintainers; [ zebreus ];
70 mainProgram = "hterm";
71 };
72})