about summary refs log tree commit diff
path: root/pkgs/applications/version-management/gittyup/default.nix
blob: 5bcfa1c8eac76afd1ac7a7b7e6b6f56eb5277a52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{ lib
, stdenv
, fetchFromGitHub
, cmake
, cmark
, darwin
, git
, libssh2
, lua5_4
, hunspell
, ninja
, openssl
, pkg-config
, qtbase
, qttools
, wrapQtAppsHook
}:

stdenv.mkDerivation rec {
  pname = "gittyup";
  version = "1.2.2";

  src = fetchFromGitHub {
    owner = "Murmele";
    repo = "Gittyup";
    rev = "gittyup_v${version}";
    hash = "sha256-JJ20vls/NGkm0xV+vDguvuW5yqhOQf83TMvnn5Kx4IE=";
    fetchSubmodules = true;
  };

  cmakeFlags = [
    "-DBUILD_SHARED_LIBS=OFF"
    "-DUSE_SYSTEM_CMARK=ON"
    "-DUSE_SYSTEM_GIT=ON"
    "-DUSE_SYSTEM_HUNSPELL=ON"
    # upstream uses its own fork of libgit2 as of 1.2.2, however this may change in the future
    # "-DUSE_SYSTEM_LIBGIT2=ON"
    "-DUSE_SYSTEM_LIBSSH2=ON"
    "-DUSE_SYSTEM_LUA=ON"
    "-DUSE_SYSTEM_OPENSSL=ON"
  ];

  nativeBuildInputs = [
    cmake
    ninja
    pkg-config
    wrapQtAppsHook
  ];

  buildInputs = [
    cmark
    git
    hunspell
    libssh2
    lua5_4
    openssl
    qtbase
    qttools
  ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
    CoreFoundation
    Security
  ]);

  postInstall = ''
    mkdir -p $out/bin

    # Move binaries to the proper place
    # TODO: Tweak in the next release: https://github.com/Murmele/Gittyup/commit/5b93e7e514b887fafb00a8158be5986e6c12b2e3
    mv $out/Gittyup $out/bin/gittyup
    mv $out/{indexer,relauncher} $out/bin

    # Those are not program libs, just some Qt5 libs that the build system leaks for some reason
    rm -f $out/*.so.*
    rm -rf $out/{include,lib,Plugins,Resources}
 '' + lib.optionalString stdenv.isLinux ''
    # Install icons
    install -Dm0644 ${src}/rsrc/Gittyup.iconset/gittyup_logo.svg $out/share/icons/hicolor/scalable/apps/gittyup.svg
    for res in 16x16 32x32 64x64 128x128 256x256 512x512; do
      install -Dm0644 ${src}/rsrc/Gittyup.iconset/icon_$res.png $out/share/icons/hicolor/$res/apps/gittyup.png
    done

    # Install desktop file
    install -Dm0644 ${src}/rsrc/linux/com.github.Murmele.Gittyup.desktop $out/share/applications/gittyup.desktop
    # TODO: Remove in the next release: https://github.com/Murmele/Gittyup/commit/5b93e7e514b887fafb00a8158be5986e6c12b2e3
    substituteInPlace $out/share/applications/gittyup.desktop \
      --replace "Exec=Gittyup" "Exec=gittyup"
  '';

  meta = with lib; {
    description = "A graphical Git client designed to help you understand and manage your source code history";
    homepage = "https://murmele.github.io/Gittyup";
    license = with licenses; [ mit ];
    maintainers = with maintainers; [ thiagokokada ];
    platforms = platforms.unix;
    broken = stdenv.isDarwin;
  };
}