depot/third_party/nixpkgs/pkgs/tools/networking/edgedb/default.nix

93 lines
2 KiB
Nix

{
stdenv,
lib,
patchelf,
fetchFromGitHub,
rustPlatform,
makeBinaryWrapper,
pkg-config,
curl,
openssl,
xz,
substituteAll,
# for passthru.tests:
edgedb,
testers,
}:
rustPlatform.buildRustPackage rec {
pname = "edgedb";
version = "6.0.0";
src = fetchFromGitHub {
owner = "edgedb";
repo = "edgedb-cli";
rev = "refs/tags/v${version}";
hash = "sha256-GBtqAHmXHgsWRXelOQ9i3R0VL8OqcASfpWU/EJaimNo=";
fetchSubmodules = true;
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"edgedb-derive-0.5.2" = "sha256-r1KWnIbX/TV2ZK/WXtYaNsGOqxMeykD1bgFyA992FGE=";
"edgeql-parser-0.1.0" = "sha256-qyY8mvZhLgQJgT7ZtxkyhpQMCLPGAIzw/E64rMiOAkw=";
"rexpect-0.5.0" = "sha256-vstAL/fJWWx7WbmRxNItKpzvgGF3SvJDs5isq9ym/OA=";
"scram-0.7.0" = "sha256-QTPxyXBpMXCDkRRJEMYly1GKp90khrwwuMI1eHc2H+Y=";
"serde_str-1.0.0" = "sha256-CMBh5lxdQb2085y0jc/DrV6B8iiXvVO2aoZH/lFFjak=";
"test-utils-0.1.0" = "sha256-u29t7o+iBw3ja0LdbsQVntQMm5j4a2pDIyDfAvDGHiI=";
"warp-0.3.6" = "sha256-knDt2aw/PJ0iabhKg+okwwnEzCY+vQVhE7HKCTM6QbE=";
};
};
nativeBuildInputs = [
makeBinaryWrapper
pkg-config
];
buildInputs =
[
curl
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
openssl
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
xz
];
checkFeatures = [ ];
patches = [
(substituteAll {
src = ./0001-dynamically-patchelf-binaries.patch;
inherit patchelf;
dynamicLinker = stdenv.cc.bintools.dynamicLinker;
})
];
env = {
OPENSSL_NO_VENDOR = true;
};
doCheck = false;
passthru.tests.version = testers.testVersion {
package = edgedb;
command = "edgedb --version";
};
meta = {
description = "EdgeDB cli";
homepage = "https://www.edgedb.com/docs/cli/index";
license = with lib.licenses; [
asl20
# or
mit
];
maintainers = with lib.maintainers; [
ahirner
kirillrdy
];
mainProgram = "edgedb";
};
}