···
+
common-updater-scripts,
stdenv.mkDerivation (finalAttrs: {
+
finalAttrs.passthru.sources.${stdenv.hostPlatform.system}
+
or (throw "Unsupported platform for mongodb-ce: ${stdenv.hostPlatform.system}");
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
···
install -Dm 755 bin/mongod -t $out/bin
install -Dm 755 bin/mongos -t $out/bin
# Only enable the version install check on darwin.
# On Linux, this would fail as mongod relies on tcmalloc, which
# requires access to `/sys/devices/system/cpu/possible`.
# See https://github.com/NixOS/nixpkgs/issues/377016
doInstallCheck = stdenv.hostPlatform.isDarwin;
+
nativeInstallCheckInputs = [ versionCheckHook ];
+
versionCheckProgram = "${placeholder "out"}/bin/mongod";
+
versionCheckProgramArg = "--version";
+
"x86_64-linux" = fetchurl {
+
url = "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2404-${finalAttrs.version}.tgz";
+
hash = "sha256-dmXt+OxvDaJRXEn3hNoiYZ9ob//tmQp2lsU2XunTNLM=";
+
"aarch64-linux" = fetchurl {
+
url = "https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-ubuntu2404-${finalAttrs.version}.tgz";
+
hash = "sha256-9FdODnUqzquSKk86BN5OL+fEO07hGYg1VAtytp7ehFM=";
+
"x86_64-darwin" = fetchurl {
+
url = "https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-${finalAttrs.version}.tgz";
+
hash = "sha256-LUUhqfgP1tIupe517TdLL97jUvBZsCvzMey3JtMVTmg=";
+
"aarch64-darwin" = fetchurl {
+
url = "https://fastdl.mongodb.org/osx/mongodb-macos-arm64-${finalAttrs.version}.tgz";
+
hash = "sha256-9SFfRbIWVXPupxvqmQlkacmcthycu840VIupCNBf7Ew=";
script = writeShellApplication {
name = "${finalAttrs.pname}-updateScript";
···
# Check if the new version is available for download, if not, exit
curl -s https://www.mongodb.com/try/download/community-edition/releases | pup 'h3:not([id]) text{}' | grep "$NEW_VERSION"
+
if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then
echo "The new version same as the old version."
+
for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do
+
update-source-version "mongodb-ce" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform"
···
maintainers = with lib.maintainers; [ drupol ];
+
platforms = lib.attrNames finalAttrs.passthru.sources;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];