nixpkgs/pkgs/by-name/qp/qpdf/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

74 lines
1.6 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, cmake
, libjpeg
, perl
, zlib
# for passthru.tests
, cups-filters
, pdfmixtool
, pdfslicer
, python3
, testers
, versionCheckHook
}:
stdenv.mkDerivation (finalAttrs: {
pname = "qpdf";
version = "11.9.1";
src = fetchFromGitHub {
owner = "qpdf";
repo = "qpdf";
rev = "v${finalAttrs.version}";
hash = "sha256-DhrOKjUPgNo61db8av0OTfM8mCNebQocQWtTWdt002s=";
};
outputs = [
"bin"
"doc"
"lib"
"man"
"out"
];
nativeBuildInputs = [ cmake perl ];
buildInputs = [ zlib libjpeg ];
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
preConfigure = ''
patchShebangs qtest/bin/qtest-driver
patchShebangs run-qtest
# qtest needs to know where the source code is
substituteInPlace CMakeLists.txt --replace "run-qtest" "run-qtest --top $src --code $src --bin $out"
'';
doCheck = true;
passthru.tests = {
pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; };
inherit (python3.pkgs) pikepdf;
inherit
cups-filters
pdfmixtool
pdfslicer
;
};
meta = {
homepage = "https://qpdf.sourceforge.io/";
description = "C++ library and set of programs that inspect and manipulate the structure of PDF files";
license = lib.licenses.asl20; # as of 7.0.0, people may stay at artistic2
maintainers = with lib.maintainers; [ abbradar ];
mainProgram = "qpdf";
platforms = lib.platforms.all;
changelog = "https://github.com/qpdf/qpdf/blob/v${finalAttrs.version}/ChangeLog";
pkgConfigModules = [ "libqpdf" ];
};
})