38 rpath = lib.makeLibraryPath [
78 (lib.getLib stdenv.cc.cc)
82 if stdenv.hostPlatform.system == "x86_64-linux" then
84 url = "https://downloads.mongodb.com/compass/mongodb-compass_${version}_amd64.deb";
85 sha256 = "sha256-Db3Xv6kNAPWqeM+vZeG7GieweaThJO0CCuwm6/v4l2s=";
88 throw "MongoDB compass is not supported on ${stdenv.hostPlatform.system}";
89 # NOTE While MongoDB Compass is available to darwin, I do not have resources to test it
90 # Feel free to make a PR adding support if desired
92 in stdenv.mkDerivation {
93 pname = "mongodb-compass";
98 buildInputs = [ dpkg wrapGAppsHook gtk3 ];
104 # The deb file contains a setuid binary, so 'dpkg -x' doesn't work here
105 dpkg --fsys-tarfile $src | tar --extract
110 # cp -av $out/usr/* $out
111 rm -rf $out/share/lintian
113 # The node_modules are bringing in non-linux files/dependencies
114 find $out -name "*.app" -exec rm -rf {} \; || true
115 find $out -name "*.dll" -delete
116 find $out -name "*.exe" -delete
118 # Otherwise it looks "suspicious"
121 for file in `find $out -type f -perm /0111 -o -name \*.so\*`; do
122 echo "Manipulating file: $file"
123 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true
124 patchelf --set-rpath ${rpath}:$out/lib/mongodb-compass "$file" || true
127 wrapGAppsHook $out/bin/mongodb-compass
131 description = "The GUI for MongoDB";
132 maintainers = with maintainers; [ bryanasdev000 ];
133 homepage = "https://github.com/mongodb-js/compass";
134 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
135 license = licenses.sspl;
136 platforms = [ "x86_64-linux" ];