1{ copyDesktopItems
2, fetchurl
3, glib
4, gnome
5, gtk3
6, jre
7, lib
8, makeDesktopItem
9, stdenv
10, wrapGAppsHook3
11}:
12
13stdenv.mkDerivation rec {
14 pname = "deepgit";
15 version = "4.4";
16
17 src = fetchurl {
18 url = "https://www.syntevo.com/downloads/deepgit/deepgit-linux-${lib.replaceStrings [ "." ] [ "_" ] version}.tar.gz";
19 hash = "sha256-ILqwXDyW7/hZzoSxxaxv4bF5xsB/JFaOBYAJFb7xmdk=";
20 };
21
22 nativeBuildInputs = [
23 copyDesktopItems
24 wrapGAppsHook3
25 ];
26
27 buildInputs = [
28 gnome.adwaita-icon-theme
29 gtk3
30 jre
31 ];
32
33 preFixup = ''
34 gappsWrapperArgs+=(
35 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ glib gtk3 ]}
36 --set DEEPGIT_JAVA_HOME ${jre}
37 )
38 patchShebangs bin/deepgit.sh
39 '';
40
41 desktopItems = [(makeDesktopItem rec {
42 name = pname;
43 desktopName = "DeepGit";
44 keywords = [ "git" ];
45 comment = "Git-Client";
46 categories = [
47 "Development"
48 "RevisionControl"
49 ];
50 terminal = false;
51 startupNotify = true;
52 startupWMClass = desktopName;
53 exec = pname;
54 mimeTypes = [
55 "x-scheme-handler/${pname}"
56 "x-scheme-handler/sourcetree"
57 ];
58 icon = pname;
59 })];
60
61 installPhase = ''
62 runHook preInstall
63
64 mkdir -pv $out/{bin,share/icons/hicolor/scalable/apps/}
65 cp -a lib license.html $out
66 mv bin/deepgit.sh $out/bin/deepgit
67
68 for icon_size in 32 48 64 128 256; do
69 path=$icon_size'x'$icon_size
70 icon=bin/deepgit-$icon_size.png
71 mkdir -p $out/share/icons/hicolor/$path/apps
72 cp $icon $out/share/icons/hicolor/$path/apps/deepgit.png
73 done
74
75 runHook postInstall
76 '';
77
78 meta = with lib; {
79 description = "A tool to investigate the history of source code";
80 homepage = "https://www.syntevo.com/deepgit";
81 changelog = "https://www.syntevo.com/deepgit/changelog.txt";
82 license = licenses.unfree;
83 maintainers = with maintainers; [ urandom ];
84 platforms = platforms.linux;
85 mainProgram = "deepgit";
86 };
87}