depot/third_party/nixpkgs/pkgs/servers/nosql/ferretdb/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

46 lines
1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, nixosTests
}:
buildGoModule rec {
pname = "ferretdb";
version = "1.17.0";
src = fetchFromGitHub {
owner = "FerretDB";
repo = "FerretDB";
rev = "v${version}";
hash = "sha256-GHUIr43rcA+H9FLQrrnTKLggyujGE0Is0VisLkL/EQI=";
};
postPatch = ''
echo v${version} > build/version/version.txt
echo nixpkgs > build/version/package.txt
'';
vendorHash = "sha256-Mgc+TpK7XnRCT/CLDyW7fIs6jB2LbYlTceiytErIj+U=";
CGO_ENABLED = 0;
subPackages = [ "cmd/ferretdb" ];
# tests in cmd/ferretdb are not production relevant
doCheck = false;
# the binary panics if something required wasn't set during compilation
doInstallCheck = true;
installCheckPhase = ''
$out/bin/ferretdb --version | grep ${version}
'';
passthru.tests = nixosTests.ferretdb;
meta = with lib; {
description = "A truly Open Source MongoDB alternative";
homepage = "https://www.ferretdb.io/";
license = licenses.asl20;
maintainers = with maintainers; [ dit7ya noisersup julienmalka ];
};
}