1{
2 lib,
3 stdenv,
4 fetchurl,
5 makeDesktopItem,
6 openjdk21,
7 gtk3,
8 glib,
9 adwaita-icon-theme,
10 wrapGAppsHook3,
11 libXtst,
12 which,
13}:
14let
15 jre = openjdk21;
16in
17stdenv.mkDerivation (finalAttrs: {
18 pname = "smartgit";
19 version = "24.1.4";
20
21 src = fetchurl {
22 url = "https://www.syntevo.com/downloads/smartgit/smartgit-linux-${
23 builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version
24 }.tar.gz";
25 hash = "sha256-1JKFSIGUE8b1yWBg41x+HRWgmg5prZF2+ND/SId4NVs=";
26 };
27
28 nativeBuildInputs = [ wrapGAppsHook3 ];
29
30 buildInputs = [
31 jre
32 adwaita-icon-theme
33 gtk3
34 ];
35
36 preFixup = ''
37 gappsWrapperArgs+=( \
38 --prefix PATH : ${
39 lib.makeBinPath [
40 jre
41 which
42 ]
43 } \
44 --prefix LD_LIBRARY_PATH : ${
45 lib.makeLibraryPath [
46 gtk3
47 glib
48 libXtst
49 ]
50 } \
51 --prefix SMARTGIT_JAVA_HOME : ${jre} \
52 )
53 # add missing shebang for start script
54 sed -i $out/bin/smartgit \
55 -e '1i#!/bin/bash'
56 '';
57
58 installPhase = ''
59 runHook preInstall
60
61 sed -i '/ --login/d' bin/smartgit.sh
62 mkdir -pv $out/{bin,share/applications,share/icons/hicolor/scalable/apps/}
63 cp -av ./{dictionaries,lib} $out/
64 cp -av bin/smartgit.sh $out/bin/smartgit
65 ln -sfv $out/bin/smartgit $out/bin/smartgithg
66
67 cp -av $desktopItem/share/applications/* $out/share/applications/
68 for icon_size in 32 48 64 128 256; do
69 path=$icon_size'x'$icon_size
70 icon=bin/smartgit-$icon_size.png
71 mkdir -p $out/share/icons/hicolor/$path/apps
72 cp $icon $out/share/icons/hicolor/$path/apps/smartgit.png
73 done
74
75 cp -av bin/smartgit.svg $out/share/icons/hicolor/scalable/apps/
76
77 runHook postInstall
78 '';
79
80 desktopItem = makeDesktopItem {
81 name = "smartgit";
82 exec = "smartgit";
83 comment = finalAttrs.meta.description;
84 icon = "smartgit";
85 desktopName = "SmartGit";
86 categories = [
87 "Development"
88 "RevisionControl"
89 ];
90 mimeTypes = [
91 "x-scheme-handler/git"
92 "x-scheme-handler/smartgit"
93 "x-scheme-handler/sourcetree"
94 ];
95 startupNotify = true;
96 startupWMClass = "smartgit";
97 keywords = [ "git" ];
98 };
99
100 meta = {
101 description = "Git GUI client";
102 longDescription = ''
103 SmartGit is a multi-platform Git GUI client, free to use for active Open Source developers and users from academic institutions.
104 Command line Git is required.
105 '';
106 homepage = "https://www.syntevo.com/smartgit/";
107 changelog = "https://www.syntevo.com/smartgit/changelog-${lib.versions.majorMinor finalAttrs.version}.txt";
108 license = lib.licenses.unfree;
109 mainProgram = "smartgit";
110 platforms = lib.platforms.linux;
111 maintainers = with lib.maintainers; [
112 jraygauthier
113 tmssngr
114 ];
115 };
116})