From d777e147c07817afbb88083d93784541b1b35b22 Mon Sep 17 00:00:00 2001 From: Julius de Bruijn Date: Tue, 20 Jun 2023 15:29:36 +0200 Subject: [PATCH] dynein: init at 0.2.1 --- .../tools/database/dynein/default.nix | 48 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 52 insertions(+) create mode 100644 pkgs/development/tools/database/dynein/default.nix diff --git a/pkgs/development/tools/database/dynein/default.nix b/pkgs/development/tools/database/dynein/default.nix new file mode 100644 index 000000000000..af88654101c2 --- /dev/null +++ b/pkgs/development/tools/database/dynein/default.nix @@ -0,0 +1,48 @@ +{ fetchFromGitHub +, lib +, Security +, openssl +, pkg-config +, rustPlatform +, stdenv +}: + +rustPlatform.buildRustPackage rec { + pname = "dynein"; + version = "0.2.1"; + + src = fetchFromGitHub { + owner = "awslabs"; + repo = "dynein"; + rev = "v${version}"; + sha256 = "sha256-QhasTFGOFOjzNKdQtA+eBhKy51O4dFt6vpeIAIOM2rQ="; + }; + + # Use system openssl. + OPENSSL_NO_VENDOR = 1; + + cargoHash = "sha256-QyhoYgqBfK6LCdtLuo0feVCgIMPueYeA8MMGspGLbGQ="; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ + openssl + ] ++ lib.optionals stdenv.isDarwin [ Security ]; + + preBuild = '' + export OPENSSL_DIR=${lib.getDev openssl} + export OPENSSL_LIB_DIR=${lib.getLib openssl}/lib + ''; + + # The integration tests will start downloading docker image of DynamoDB, which + # will naturally fail for nix build. The CLI tests do not need DynamoDB. + cargoTestFlags = [ "cli_tests" ]; + + meta = with lib; { + description = "DynamoDB CLI written in Rust"; + homepage = "https://github.com/awslabs/dynein"; + license = licenses.asl20; + platforms = platforms.unix; + maintainers = with maintainers; [ pimeys ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4bb79eaebcf1..84ae3abd383c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -555,6 +555,10 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security; }; + dynein = callPackage ../development/tools/database/dynein { + inherit (darwin.apple_sdk.frameworks) Security; + }; + ea = callPackage ../tools/misc/ea { }; each = callPackage ../tools/text/each { };