2021-12-06 16:07:01 +00:00
|
|
|
{
|
|
|
|
alsa-lib,
|
|
|
|
at-spi2-atk,
|
|
|
|
at-spi2-core,
|
|
|
|
atk,
|
|
|
|
cairo,
|
|
|
|
cups,
|
|
|
|
curl,
|
|
|
|
dbus,
|
|
|
|
dpkg,
|
|
|
|
expat,
|
|
|
|
fetchurl,
|
|
|
|
fontconfig,
|
|
|
|
freetype,
|
|
|
|
gdk-pixbuf,
|
|
|
|
glib,
|
|
|
|
gtk3,
|
|
|
|
lib,
|
|
|
|
libdrm,
|
|
|
|
libnotify,
|
|
|
|
libsecret,
|
|
|
|
libuuid,
|
|
|
|
libxcb,
|
|
|
|
libxkbcommon,
|
|
|
|
mesa,
|
|
|
|
nspr,
|
|
|
|
nss,
|
|
|
|
pango,
|
|
|
|
stdenv,
|
|
|
|
systemd,
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3,
|
2021-12-06 16:07:01 +00:00
|
|
|
xorg,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.43.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
rpath = lib.makeLibraryPath [
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2020-09-25 04:45:31 +00:00
|
|
|
at-spi2-atk
|
|
|
|
at-spi2-core
|
2020-04-24 23:36:52 +00:00
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
curl
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2021-12-06 16:07:01 +00:00
|
|
|
gdk-pixbuf
|
2020-04-24 23:36:52 +00:00
|
|
|
glib
|
2020-10-27 00:29:36 +00:00
|
|
|
gtk3
|
2021-12-06 16:07:01 +00:00
|
|
|
libdrm
|
2020-04-24 23:36:52 +00:00
|
|
|
libnotify
|
2020-09-25 04:45:31 +00:00
|
|
|
libsecret
|
|
|
|
libuuid
|
2020-04-24 23:36:52 +00:00
|
|
|
libxcb
|
2021-12-06 16:07:01 +00:00
|
|
|
libxkbcommon
|
|
|
|
mesa
|
2020-04-24 23:36:52 +00:00
|
|
|
nspr
|
|
|
|
nss
|
2021-12-06 16:07:01 +00:00
|
|
|
pango
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.cc.cc
|
|
|
|
systemd
|
|
|
|
xorg.libX11
|
2021-12-06 16:07:01 +00:00
|
|
|
xorg.libXScrnSaver
|
2020-04-24 23:36:52 +00:00
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXtst
|
2021-12-06 16:07:01 +00:00
|
|
|
xorg.libxkbfile
|
|
|
|
xorg.libxshmfence
|
|
|
|
(lib.getLib stdenv.cc.cc)
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src =
|
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
|
|
|
url = "https://downloads.mongodb.com/compass/mongodb-compass_${version}_amd64.deb";
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-hzPhF0NGwv+Lm+q5SoS8qv10UmuKf4RarGMkEeCxp9w=";
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
throw "MongoDB compass is not supported on ${stdenv.hostPlatform.system}";
|
2022-08-12 12:06:08 +00:00
|
|
|
# NOTE While MongoDB Compass is available to darwin, I do not have resources to test it
|
|
|
|
# Feel free to make a PR adding support if desired
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
pname = "mongodb-compass";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
inherit src;
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
buildInputs = [ dpkg wrapGAppsHook3 gtk3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
IFS=$'\n'
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
# 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
|
2020-04-24 23:36:52 +00:00
|
|
|
rm -rf $out/share/lintian
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
# The node_modules are bringing in non-linux files/dependencies
|
2020-04-24 23:36:52 +00:00
|
|
|
find $out -name "*.app" -exec rm -rf {} \; || true
|
|
|
|
find $out -name "*.dll" -delete
|
|
|
|
find $out -name "*.exe" -delete
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Otherwise it looks "suspicious"
|
|
|
|
chmod -R g-w $out
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2020-04-24 23:36:52 +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
|
2020-09-25 04:45:31 +00:00
|
|
|
patchelf --set-rpath ${rpath}:$out/lib/mongodb-compass "$file" || true
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapGAppsHook $out/bin/mongodb-compass
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The GUI for MongoDB";
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ bryanasdev000 ];
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://github.com/mongodb-js/compass";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.sspl;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "mongodb-compass";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|