build-bazel-package: added rm of extra local folders for toolchain configuration...
[NixPkgs.git] / pkgs / by-name / tr / transgui / package.nix
blob23286a131448c28e92c7429db7fb1270b362d674
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   pkg-config,
6   makeDesktopItem,
7   unzip,
8   fpc,
9   lazarus,
10   libX11,
11   glib,
12   gtk2,
13   gdk-pixbuf,
14   pango,
15   atk,
16   cairo,
17   openssl,
18   unstableGitUpdater,
21 stdenv.mkDerivation rec {
22   pname = "transgui";
23   version = "5.18.0-unstable-2024-10-03";
25   src = fetchFromGitHub {
26     owner = "transmission-remote-gui";
27     repo = "transgui";
28     rev = "8854357ece266e749e8981a93c8002465a93d8f2";
29     hash = "sha256-8ycivjjPeXBdPbqNNlO2hcre6T9sFhqg6vUfCREtd8k=";
30   };
32   nativeBuildInputs = [
33     pkg-config
34     unzip
35   ];
36   buildInputs = [
37     fpc
38     lazarus
39     stdenv.cc
40     libX11
41     glib
42     gtk2
43     gdk-pixbuf
44     pango
45     atk
46     cairo
47     openssl
48   ];
50   NIX_LDFLAGS = ''
51     -L${lib.getLib stdenv.cc.cc}/lib -lX11 -lglib-2.0 -lgtk-x11-2.0
52     -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpango-1.0 -latk-1.0 -lcairo
53     -lc -lcrypto
54   '';
56   postPatch = ''
57     substituteInPlace restranslator.pas --replace /usr/ $out/
58   '';
60   preBuild = ''
61     FPCDIR=${fpc}/lib/fpc/${fpc.version} fpcmake -w
62     lazbuild -B transgui.lpr --lazarusdir=${lazarus}/share/lazarus
63   '';
65   makeFlags = [
66     "FPC=fpc"
67     "PP=fpc"
68     "INSTALL_PREFIX=$(out)"
69   ];
71   LCL_PLATFORM = "gtk2";
73   desktopItem = makeDesktopItem {
74     name = pname;
75     exec = "${pname} %U";
76     icon = pname;
77     type = "Application";
78     comment = meta.description;
79     desktopName = "Transmission Remote GUI";
80     genericName = "BitTorrent Client";
81     categories = [
82       "Network"
83       "FileTransfer"
84       "P2P"
85       "GTK"
86     ];
87     startupNotify = true;
88     mimeTypes = [
89       "application/x-bittorrent"
90       "x-scheme-handler/magnet"
91     ];
92   };
94   postInstall = ''
95     mkdir -p "$out/share/applications"
96     cp $desktopItem/share/applications/* $out/share/applications
97     mkdir -p "$out/share/icons/hicolor/48x48/apps"
98     cp transgui.png "$out/share/icons/hicolor/48x48/apps"
99     mkdir -p "$out/share/transgui"
100     cp -r "./lang" "$out/share/transgui"
101   '';
103   passthru.updateScript = unstableGitUpdater {
104     tagPrefix = "v";
105   };
107   meta = {
108     description = "A cross platform front-end for the Transmission BitTorrent client";
109     homepage = "https://sourceforge.net/p/transgui";
110     license = lib.licenses.gpl2Plus;
111     maintainers = with lib.maintainers; [ ramkromberg ];
112     mainProgram = "transgui";
113     platforms = [
114       "x86_64-linux"
115       "x86_64-darwin"
116     ];
117   };