2022-07-14 12:49:19 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, runCommand
|
|
|
|
, patchelf
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2023-03-04 12:14:45 +00:00
|
|
|
, makeBinaryWrapper
|
2022-07-14 12:49:19 +00:00
|
|
|
, pkg-config
|
|
|
|
, curl
|
|
|
|
, Security
|
|
|
|
, CoreServices
|
|
|
|
, libiconv
|
|
|
|
, xz
|
|
|
|
, perl
|
|
|
|
, substituteAll
|
2023-03-04 12:14:45 +00:00
|
|
|
# for passthru.tests:
|
|
|
|
, edgedb
|
|
|
|
, testers
|
2022-07-14 12:49:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "edgedb";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "2.3.1";
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "edgedb";
|
|
|
|
repo = "edgedb-cli";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "v${version}";
|
2023-03-04 12:14:45 +00:00
|
|
|
sha256 = "sha256-iL8tD6cvFVWqsQAk6HBUqdz7MJ3lT2XmExGQvdQdIWs=";
|
2022-07-14 12:49:19 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
cargoSha256 = "sha256-dGeRTo6pFwDKd/nTaA3R9DWGiAL0Dm6jEVR1zhF6/BQ=";
|
2022-07-14 12:49:19 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
nativeBuildInputs = [ makeBinaryWrapper pkg-config perl ];
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [ CoreServices Security libiconv xz ];
|
|
|
|
|
|
|
|
checkFeatures = [ ];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./0001-dynamically-patchelf-binaries.patch;
|
|
|
|
inherit patchelf;
|
|
|
|
dynamicLinker = stdenv.cc.bintools.dynamicLinker;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = edgedb;
|
|
|
|
command = "edgedb --version";
|
|
|
|
};
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "EdgeDB cli";
|
|
|
|
homepage = "https://www.edgedb.com/docs/cli/index";
|
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
|
|
maintainers = [ maintainers.ranfdev ];
|
|
|
|
};
|
|
|
|
}
|