Skip to content

Commit

Permalink
Merge pull request #214029 from LeSuisse/ripunzip-init-0.4.0
Browse files Browse the repository at this point in the history
ripunzip: init at 1.1.0
  • Loading branch information
LeSuisse authored Jan 3, 2024
2 parents a196989 + 935d25c commit 054533f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
48 changes: 48 additions & 0 deletions pkgs/by-name/ri/ripunzip/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, openssl
, darwin
, pkg-config
, testers
, fetchzip
, ripunzip
}:

rustPlatform.buildRustPackage rec {
pname = "ripunzip";
version = "1.1.0";

src = fetchFromGitHub {
owner = "google";
repo = "ripunzip";
rev = "v${version}";
hash = "sha256-GyP4OPnPKhu9nXYXIfWCVLF/thwWiP0OqAQY/1D05LE=";
};

cargoHash = "sha256-Jv9bCHT5xl/2CPnSuWd9HZuaGOttBC5iAbbpr3jaIhM=";

buildInputs = [ openssl ]
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Security SystemConfiguration ]);
nativeBuildInputs = [ pkg-config ];

setupHook = ./setup-hook.sh;

passthru.tests = {
fetchzipWithRipunzip = testers.invalidateFetcherByDrvHash (fetchzip.override { unzip = ripunzip; }) {
url = "https://github.com/google/ripunzip/archive/cb9caa3ba4b0e27a85e165be64c40f1f6dfcc085.zip";
hash = "sha256-BoErC5VL3Vpvkx6xJq6J+eUJrBnjVEdTuSo7zh98Jy4=";
};
version = testers.testVersion {
package = ripunzip;
};
};

meta = with lib; {
description = "A tool to unzip files in parallel";
homepage = "https://github.com/google/ripunzip";
license = with lib.licenses; [ mit asl20 ];
maintainers = [ maintainers.lesuisse ];
};
}
6 changes: 6 additions & 0 deletions pkgs/by-name/ri/ripunzip/setup-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
unpackCmdHooks+=(_tryRipunzip)
_tryRipunzip() {
if ! [[ "$curSrc" =~ \.zip$ ]]; then return 1; fi

ripunzip unzip-file "$curSrc" 2> /dev/null
}

0 comments on commit 054533f

Please sign in to comment.