Merge pull request #249688 from NixOS/open-pdf-sign/use-finalAttrs-pattern

open-pdf-sign: use `finalAttrs` pattern
This commit is contained in:
Pol Dellaiera 2023-08-17 10:35:39 +02:00 committed by GitHub
commit 580d1b42ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,21 +1,29 @@
{ lib, stdenv, fetchurl, makeWrapper, jre, nix-update-script }:
{ fetchurl
, jre
, lib
, makeBinaryWrapper
, nix-update-script
, stdenv
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
version = "0.1.6";
pname = "open-pdf-sign";
src = fetchurl {
url = "https://github.com/open-pdf-sign/open-pdf-sign/releases/download/v${version}/open-pdf-sign.jar";
sha256 = "sha256-GpMDgN4P8neHOQsXtg2AKXNeCMnv3nEHH50ZVU0uVvY=";
url = "https://github.com/open-pdf-sign/open-pdf-sign/releases/download/v${finalAttrs.version}/open-pdf-sign.jar";
hash = "sha256-GpMDgN4P8neHOQsXtg2AKXNeCMnv3nEHH50ZVU0uVvY=";
};
nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [
makeBinaryWrapper
];
buildCommand = ''
install -Dm644 $src $out/lib/open-pdf-sign.jar
mkdir -p $out/bin
makeWrapper ${jre}/bin/java $out/bin/open-pdf-sign \
makeWrapper ${lib.getExe jre} $out/bin/open-pdf-sign \
--add-flags "-jar $out/lib/open-pdf-sign.jar"
'';
@ -23,12 +31,12 @@ stdenv.mkDerivation rec {
updateScript = nix-update-script { };
};
meta = with lib; {
meta = {
description = "Digitally sign PDF files from your commandline";
homepage = "https://github.com/open-pdf-sign/open-pdf-sign";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.asl20;
maintainers = with maintainers; [ drupol ];
platforms = platforms.unix;
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ drupol ];
platforms = lib.platforms.unix;
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
};
}
})