pdfcpu: 0.12.1 → 0.13.0 (#536888)
This commit is contained in:
@@ -9,13 +9,13 @@
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "pdfcpu";
|
||||
version = "0.12.1";
|
||||
version = "0.13.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pdfcpu";
|
||||
repo = "pdfcpu";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-xAWzn32evg3PmHlevL38P06zOof3a4mmLmNuFfO2gAU=";
|
||||
hash = "sha256-o+gg/XdsPotmuk+H62Bzu4zG9Zu2HABlr4S/YhbtCiI=";
|
||||
# Apparently upstream requires that the compiled executable will know the
|
||||
# commit hash and the date of the commit. This information is also presented
|
||||
# in the output of `pdfcpu version` which we use as a sanity check in the
|
||||
@@ -33,12 +33,12 @@ buildGoModule (finalAttrs: {
|
||||
postFetch = ''
|
||||
cd "$out"
|
||||
git rev-parse HEAD > $out/COMMIT
|
||||
git log -1 --pretty=%cd --date=format:'%Y-%m-%dT%H:%M:%SZ' > $out/SOURCE_DATE
|
||||
git log -1 --pretty=%cd --date=format:'%Y-%m-%d %H:%M:%S UTC' > $out/SOURCE_DATE
|
||||
find "$out" -name .git -print0 | xargs -0 rm -rf
|
||||
'';
|
||||
};
|
||||
|
||||
vendorHash = "sha256-5+zHlHp/8Jp9TE87IUgJqQHDINNe7ah34jPW/n5ORz8=";
|
||||
vendorHash = "sha256-yieD29GFQQrYVbYNwFHDQX9l0KOKu0usng1OPoaVBZ8=";
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
@@ -48,8 +48,10 @@ buildGoModule (finalAttrs: {
|
||||
|
||||
# ldflags based on metadata from git and source
|
||||
preBuild = ''
|
||||
ldflags+=" -X main.commit=$(cat COMMIT)"
|
||||
ldflags+=" -X main.date=$(cat SOURCE_DATE)"
|
||||
ldflags+=(
|
||||
"-X 'main.commit=$(cat COMMIT)'"
|
||||
"-X 'main.date=$(cat SOURCE_DATE)'"
|
||||
)
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -77,9 +79,9 @@ buildGoModule (finalAttrs: {
|
||||
if stdenv.hostPlatform.isDarwin then "Library/Application Support" else ".config"
|
||||
}"/pdfcpu
|
||||
versionOutput="$($out/bin/pdfcpu version)"
|
||||
for part in ${finalAttrs.version} $(cat COMMIT | cut -c1-8) $(cat SOURCE_DATE); do
|
||||
for part in ${finalAttrs.version} "$(cut -c1-8 COMMIT)" "$(cat SOURCE_DATE)"; do
|
||||
if [[ ! "$versionOutput" =~ "$part" ]]; then
|
||||
echo version output did not contain expected part $part . Output was:
|
||||
echo version output did not contain expected part \"$part\" . Output was:
|
||||
echo "$versionOutput"
|
||||
exit 3
|
||||
fi
|
||||
@@ -90,6 +92,7 @@ buildGoModule (finalAttrs: {
|
||||
|
||||
meta = {
|
||||
description = "PDF processor written in Go";
|
||||
changelog = "https://pdfcpu.io/changelog/";
|
||||
homepage = "https://pdfcpu.io";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ doronbehar ];
|
||||
|
||||
Reference in New Issue
Block a user