From 2864ef44e391283ccedd0865778725d06cf94397 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 21 Sep 2022 17:41:32 +0200 Subject: [PATCH 1/2] unpaper: 6.1 -> 7.0.0 Migrates the build to meson and ninja and adds support for ffmpeg 5. The package now creates a man page that we divert into a dedicated man output. Adds the paperless test into passthru.tests for good measure. --- pkgs/tools/graphics/unpaper/default.nix | 46 ++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/graphics/unpaper/default.nix b/pkgs/tools/graphics/unpaper/default.nix index 9b8542a86bba..72c63d6cfd2c 100644 --- a/pkgs/tools/graphics/unpaper/default.nix +++ b/pkgs/tools/graphics/unpaper/default.nix @@ -1,16 +1,52 @@ -{ lib, stdenv, fetchurl, buildPackages, pkg-config, ffmpeg_4 }: +{ lib +, stdenv +, fetchurl + +# build +, meson +, ninja +, pkg-config + +# docs +, sphinx + +# runtime +, buildPackages +, ffmpeg_5 + +# tests +, nixosTests +}: stdenv.mkDerivation rec { pname = "unpaper"; - version = "6.1"; + version = "7.0.0"; src = fetchurl { url = "https://www.flameeyes.eu/files/${pname}-${version}.tar.xz"; - sha256 = "0c5rbkxbmy9k8vxjh4cv0bgnqd3wqc99yzw215vkyjslvbsq8z13"; + hash = "sha256-JXX7vybCJxnRy4grWWAsmQDH90cRisEwiD9jQZvkaoA="; }; - nativeBuildInputs = [ pkg-config buildPackages.libxslt.bin ]; - buildInputs = [ ffmpeg_4 ]; + outputs = [ + "out" + "man" + ]; + + nativeBuildInputs = [ + buildPackages.libxslt.bin + meson + ninja + pkg-config + sphinx + ]; + + buildInputs = [ + ffmpeg_5 + ]; + + passthru.tests = { + inherit (nixosTests) paperless; + }; meta = with lib; { homepage = "https://www.flameeyes.eu/projects/unpaper"; From 608a3ef0b71359fb19ecfaaa3c8163dc58058010 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 25 Sep 2022 17:54:23 +0200 Subject: [PATCH 2/2] gscan2pdf: 2.12.6 -> 2.12.8 Adds a patch that fixes ffmpeg 5.1 compatibility --- pkgs/applications/graphics/gscan2pdf/default.nix | 8 ++++++-- .../graphics/gscan2pdf/ffmpeg5-compat.patch | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/graphics/gscan2pdf/ffmpeg5-compat.patch diff --git a/pkgs/applications/graphics/gscan2pdf/default.nix b/pkgs/applications/graphics/gscan2pdf/default.nix index 214688b56f89..fc686ad1f212 100644 --- a/pkgs/applications/graphics/gscan2pdf/default.nix +++ b/pkgs/applications/graphics/gscan2pdf/default.nix @@ -10,13 +10,17 @@ with lib; perlPackages.buildPerlPackage rec { pname = "gscan2pdf"; - version = "2.12.6"; + version = "2.12.8"; src = fetchurl { url = "mirror://sourceforge/gscan2pdf/gscan2pdf-${version}.tar.xz"; - sha256 = "sha256-9ntpUEM3buT3EhneXz9G8bibvzOnEK6Xt0jJcTvLKT0="; + hash = "sha256-dmN2fMBDZqgvdHQryQgjmBHeH/h2dihRH8LkflFYzTk="; }; + patches = [ + ./ffmpeg5-compat.patch + ]; + nativeBuildInputs = [ wrapGAppsHook ]; buildInputs = diff --git a/pkgs/applications/graphics/gscan2pdf/ffmpeg5-compat.patch b/pkgs/applications/graphics/gscan2pdf/ffmpeg5-compat.patch new file mode 100644 index 000000000000..ff522735fe35 --- /dev/null +++ b/pkgs/applications/graphics/gscan2pdf/ffmpeg5-compat.patch @@ -0,0 +1,15 @@ +--- a/t/351_unpaper.t ++++ b/t/351_unpaper.t +@@ -88,8 +88,10 @@ + + # if we use unlike, we no longer + # know how many tests there will be +- if ( $msg !~ +-/(deprecated|Encoder did not produce proper pts, making some up)/ ++ if ( $msg !~ /( deprecated | ++ \Qdoes not contain an image sequence pattern\E | ++ \QEncoder did not produce proper pts, making some up\E | ++ \Quse the -update option\E )/x + ) + { + fail 'no warnings';