nixpkgs/pkgs/tools/misc/mongodb-compass/default.nix

102 lines
2.4 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, dpkg
, alsaLib, at-spi2-atk, at-spi2-core, atk, cairo, cups, curl, dbus, expat, fontconfig, freetype, glib
2020-10-25 19:38:25 +00:00
, gnome2, gdk-pixbuf, gtk3, pango, libnotify, libsecret, libuuid, libxcb, nspr, nss, systemd, xorg, wrapGAppsHook }:
2018-05-09 02:14:37 +00:00
let
2020-11-19 07:15:50 +00:00
version = "1.23.0";
2018-05-09 02:14:37 +00:00
2021-01-15 09:19:50 +00:00
rpath = lib.makeLibraryPath [
2018-05-09 02:14:37 +00:00
alsaLib
at-spi2-atk
at-spi2-core
2018-05-09 02:14:37 +00:00
atk
cairo
cups
curl
dbus
expat
fontconfig
freetype
glib
gnome2.GConf
2020-10-25 19:38:25 +00:00
gdk-pixbuf
gtk3
pango
2018-05-09 02:14:37 +00:00
libnotify
libsecret
libuuid
2018-05-09 02:14:37 +00:00
libxcb
nspr
nss
stdenv.cc.cc
systemd
xorg.libxkbfile
xorg.libX11
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libXScrnSaver
] + ":${stdenv.cc.cc.lib}/lib64";
src =
if stdenv.hostPlatform.system == "x86_64-linux" then
2018-05-09 02:14:37 +00:00
fetchurl {
url = "https://downloads.mongodb.com/compass/mongodb-compass_${version}_amd64.deb";
2020-11-19 07:15:50 +00:00
sha256 = "1kmhki4kq28z8h249p4imcpb0nz2dx5bmpv8ldhhqh3rcq5vzxsv";
2018-05-09 02:14:37 +00:00
}
else
throw "MongoDB compass is not supported on ${stdenv.hostPlatform.system}";
2018-05-09 02:14:37 +00:00
in stdenv.mkDerivation {
2019-08-13 21:52:01 +00:00
pname = "mongodb-compass";
inherit version;
2018-05-09 02:14:37 +00:00
inherit src;
2020-10-25 19:38:25 +00:00
buildInputs = [ dpkg wrapGAppsHook gtk3 ];
2019-06-19 15:45:34 +00:00
dontUnpack = true;
2018-05-09 02:14:37 +00:00
buildCommand = ''
IFS=$'\n'
# The deb file contains a setuid binary, so 'dpkg -x' doesn't work here
dpkg --fsys-tarfile $src | tar --extract
mkdir -p $out
mv usr/* $out
# cp -av $out/usr/* $out
2018-05-09 02:14:37 +00:00
rm -rf $out/share/lintian
# The node_modules are bringing in non-linux files/dependencies
2018-05-09 02:14:37 +00:00
find $out -name "*.app" -exec rm -rf {} \; || true
find $out -name "*.dll" -delete
find $out -name "*.exe" -delete
2018-05-09 02:14:37 +00:00
# Otherwise it looks "suspicious"
chmod -R g-w $out
2018-05-09 02:14:37 +00:00
for file in `find $out -type f -perm /0111 -o -name \*.so\*`; do
echo "Manipulating file: $file"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true
patchelf --set-rpath ${rpath}:$out/lib/mongodb-compass "$file" || true
2018-05-09 02:14:37 +00:00
done
2019-11-18 18:26:27 +00:00
wrapGAppsHook $out/bin/mongodb-compass
2018-05-09 02:14:37 +00:00
'';
meta = with lib; {
2018-05-09 02:14:37 +00:00
description = "The GUI for MongoDB";
homepage = "https://www.mongodb.com/products/compass";
2018-05-09 02:14:37 +00:00
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
};
}