summary refs log tree commit diff
path: root/pkgs/applications/misc/redis-desktop-manager/default.nix
blob: bee7058293d926c1c0621eed267212892a910f49 (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
{ stdenv, lib, fetchgit, pkgconfig, libssh2
, qtbase, qtdeclarative, qtgraphicaleffects, qtimageformats, qtquickcontrols
, qtsvg, qttools, qtquick1, qtcharts
, qmake
}:

let
  breakpad_lss = fetchgit {
    url = "https://chromium.googlesource.com/linux-syscall-support";
    rev = "08056836f2b4a5747daff75435d10d649bed22f6";
    sha256 = "1ryshs2nyxwa0kn3rlbnd5b3fhna9vqm560yviddcfgdm2jyg0hz";
  };

in

stdenv.mkDerivation rec {
  pname = "redis-desktop-manager";
  version = "0.9.1";

  src = fetchgit {
    url = "https://github.com/uglide/RedisDesktopManager.git";
    fetchSubmodules = true;
    rev = "refs/tags/${version}";
    sha256 = "0yd4i944d4blw8jky0nxl7sfkkj975q4d328rdcbhizwvf6dx81f";
  };

  nativeBuildInputs = [ pkgconfig qmake ];
  buildInputs = [
    libssh2 qtbase qtdeclarative qtgraphicaleffects qtimageformats
    qtquick1 qtquickcontrols qtsvg qttools qtcharts
  ];

  dontUseQmakeConfigure = true;

  NIX_CFLAGS_COMPILE = [ "-Wno-error=deprecated" ];

  # Disable annoying update reminder
  postPatch = ''
    sed -i s/'^\s*initUpdater();'/'\/\/initUpdater():'/ src/app/app.cpp
  '';

  buildPhase = ''
    srcdir=$PWD

    cat <<EOF > src/version.h
#ifndef RDM_VERSION
    #define RDM_VERSION "${version}-120"
#endif // !RDM_VERSION
EOF

    cd $srcdir/3rdparty/gbreakpad
    cp -r ${breakpad_lss} src/third_party/lss
    chmod +w -R src/third_party/lss
    touch README

    cd $srcdir/3rdparty/crashreporter
    qmake CONFIG+=release DESTDIR="$srcdir/rdm/bin/linux/release" QMAKE_LFLAGS_RPATH=""
    make

    cd $srcdir/3rdparty/gbreakpad
    ./configure
    make

    cd $srcdir/src
    qmake
    make
  '';

  installPhase = ''
    mkdir -p $out/bin
    instdir="$srcdir/bin/linux/release"
    cp $instdir/rdm $out/bin
  '';

  meta = with lib; {
    description = "Cross-platform open source Redis DB management tool";
    homepage = https://redisdesktop.com/;
    license = licenses.lgpl21;
    platforms = platforms.linux;
    maintainers = with maintainers; [ cstrahan ];
  };
}