Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / version-management / deepgit / default.nix
blobd9742a6a8f54e9c6306a1805a2df0001e3a70d08
1 { copyDesktopItems
2 , fetchurl
3 , glib
4 , gnome
5 , gtk3
6 , jre
7 , lib
8 , makeDesktopItem
9 , stdenv
10 , wrapGAppsHook
13 stdenv.mkDerivation rec {
14   pname = "deepgit";
15   version = "4.3.1";
17   src = fetchurl {
18     url = "https://www.syntevo.com/downloads/deepgit/deepgit-linux-${lib.replaceStrings [ "." ] [ "_" ] version}.tar.gz";
19     hash = "sha256-Ovd9MjgpMJvNySW/FPXYVtpLoCSQP1W1nlcNkgI7sgA=";
20   };
22   nativeBuildInputs = [
23     copyDesktopItems
24     wrapGAppsHook
25   ];
27   buildInputs = [
28     gnome.adwaita-icon-theme
29     gtk3
30     jre
31   ];
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   '';
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   })];
61   installPhase = ''
62     runHook preInstall
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
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
75     runHook postInstall
76   '';
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   };