From 99181fe9138193ac50f99d70627ef02075bd5bf5 Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Tue, 23 Jul 2024 22:54:39 -0700 Subject: [PATCH 1/2] haskellPackages.pdftotext: unbreak Fixes https://github.com/NixOS/nixpkgs/issues/319365 Build of pdftotext was broken caused by a recent cabal change introduced via https://github.com/haskell/cabal/pull/9200 --- .../haskell-modules/configuration-common.nix | 13 +++++++++++++ .../configuration-hackage2nix/broken.yaml | 1 - .../haskell-modules/hackage-packages.nix | 2 -- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 93b0f8f805577..b8b802d9a3258 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -3121,4 +3121,17 @@ self: super: { sha256 = "sha256-1QEaoO8BTdvfFzMrybrf0v7cK0NbYrWOj4Mqexr+ylc="; }) super.avro; + pdftotext = overrideCabal (drv: { + postPatch = '' + # Fixes https://todo.sr.ht/~geyaeb/haskell-pdftotext/6 + substituteInPlace pdftotext.cabal --replace-quiet c-sources cxx-sources + + # Fix cabal ignoring cxx because the cabal format version is too old + substituteInPlace pdftotext.cabal --replace-quiet ">=1.10" 2.2 + + # Fix wrong license name that breaks recent cabal version + substituteInPlace pdftotext.cabal --replace-quiet BSD3 BSD-3-Clause + '' + (drv.postPatch or ""); + }) (doJailbreak (addExtraLibrary pkgs.pkg-config (addExtraLibrary pkgs.poppler super.pdftotext))); + } // import ./configuration-tensorflow.nix {inherit pkgs haskellLib;} self super diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml index e148c058b4006..31fbd0963723e 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml @@ -4430,7 +4430,6 @@ broken-packages: - pdfinfo # failure in job https://hydra.nixos.org/build/233214432 at 2023-09-02 - pdf-slave-template # failure in job https://hydra.nixos.org/build/233217870 at 2023-09-02 - pdf-toolbox-viewer # failure in job https://hydra.nixos.org/build/233196461 at 2023-09-02 - - pdftotext # failure in job https://hydra.nixos.org/build/233242086 at 2023-09-02 - pdynload # failure in job https://hydra.nixos.org/build/233226504 at 2023-09-02 - PeanoWitnesses # failure in job https://hydra.nixos.org/build/233207451 at 2023-09-02 - pecoff # failure in job https://hydra.nixos.org/build/233231268 at 2023-09-02 diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix index 9634ee6bb4ce1..9eef3b059e623 100644 --- a/pkgs/development/haskell-modules/hackage-packages.nix +++ b/pkgs/development/haskell-modules/hackage-packages.nix @@ -233563,9 +233563,7 @@ self: { testToolDepends = [ hspec-discover ]; description = "Extracts text from PDF using poppler"; license = lib.licenses.bsd3; - hydraPlatforms = lib.platforms.none; mainProgram = "pdftotext.hs"; - broken = true; }) {poppler-cpp = null;}; "pdynload" = callPackage From 52fb468f16e8bc1bd0a2e0de2c87b11c38abbf01 Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Tue, 23 Jul 2024 22:56:50 -0700 Subject: [PATCH 2/2] haskellPackages.pdftotext: add mpscholten as maintainer --- .../haskell-modules/configuration-hackage2nix/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml index 25acdf1e4a462..1de5ba12adfe6 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml @@ -663,6 +663,7 @@ package-maintainers: - typerep-map - minio-hs - smtp-mail + - pdftotext unsupported-platforms: Allure: [ platforms.darwin ]