summary refs log tree commit diff
path: root/pkgs/applications/misc/robomongo/default.nix
blob: af5285909c6ce29c620b2e0787be407b67a120e2 (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
{ lib, stdenv, fetchurl, zlib, glib, xorg, dbus, fontconfig,
  freetype, xkeyboard_config, makeDesktopItem, makeWrapper }:

stdenv.mkDerivation rec {
  pname = "robomongo";
  version = "0.9.0";

  src = fetchurl {
    url = "https://download.robomongo.org/${version}/linux/robomongo-${version}-linux-x86_64-0786489.tar.gz";
    sha256 = "1q8ahdz3afcw002p8dl2pybzkq4srk6bnikrz216yx1gswivdcad";
  };

  icon = fetchurl {
    url = "https://github.com/Studio3T/robomongo/raw/${version}/trash/install/linux/robomongo.png";
    sha256 = "15li8536x600kkfkb3h6mw7y0f2ljkv951pc45dpiw036vldibv2";
  };

  desktopItem = makeDesktopItem {
    name = "robomongo";
    exec = "robomongo";
    icon = icon;
    comment = "Query GUI for mongodb";
    desktopName = "Robomongo";
    genericName = "MongoDB management tool";
    categories = "Development;IDE;mongodb;";
  };

  nativeBuildInputs = [makeWrapper];

  ldLibraryPath = lib.makeLibraryPath [
    stdenv.cc.cc
    zlib
    glib
    xorg.libXi
    xorg.libxcb
    xorg.libXrender
    xorg.libX11
    xorg.libSM
    xorg.libICE
    xorg.libXext
    dbus
    fontconfig
    freetype
  ];

  installPhase = ''
    BASEDIR=$out/lib/robomongo

    mkdir -p $BASEDIR/bin
    cp bin/* $BASEDIR/bin

    mkdir -p $BASEDIR/lib
    cp -r lib/* $BASEDIR/lib

    mkdir -p $out/share/applications
    cp $desktopItem/share/applications/* $out/share/applications

    mkdir -p $out/share/icons
    cp ${icon} $out/share/icons/robomongo.png

    patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $BASEDIR/bin/robomongo

    mkdir $out/bin

    makeWrapper $BASEDIR/bin/robomongo $out/bin/robomongo \
      --suffix LD_LIBRARY_PATH : ${ldLibraryPath} \
      --suffix QT_XKB_CONFIG_ROOT : ${xkeyboard_config}/share/X11/xkb
  '';

  meta = {
    homepage = "https://robomongo.org/";
    description = "Query GUI for mongodb";
    platforms = lib.intersectLists lib.platforms.linux lib.platforms.x86_64;
    license = lib.licenses.gpl3;
    maintainers = [ lib.maintainers.eperuffo ];
  };
}