nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 maven,
5 makeWrapper,
6 stripJavaArchivesHook,
7 makeDesktopItem,
8 copyDesktopItems,
9 jre,
10}:
11maven.buildMavenPackage rec {
12 pname = "verapdf";
13 version = "1.28.2";
14
15 mvnParameters =
16 "-pl '!installer' -Dverapdf.timestamp=1980-01-01T00:00:02Z -Dproject.build.outputTimestamp=1980-01-01T00:00:02Z "
17 +
18 # By default, veraPDF uses version ranges for some components.
19 # These versions are pinned to the package version in order to avoid
20 # non-reproducibility of the maven dependencies.
21 lib.concatMapStringsSep " " (id: "-Dverapdf.${id}.version=${version}") [
22 "library"
23 "pdfbox.validation"
24 "validation"
25 ];
26
27 src = fetchFromGitHub {
28 owner = "veraPDF";
29 repo = "veraPDF-apps";
30 rev = "v${version}";
31 hash = "sha256-tv5iffIQkyjHyulnmagcJuSGbc4tXRYTwB3hSEGLQrc=";
32 };
33
34 patches = [ ./stable-maven-plugins.patch ];
35
36 mvnHash = "sha256-CrpiomKsAyD7SyVzwbjVXy8BoVnkejQVcim+kwVP5Ng=";
37
38 nativeBuildInputs = [
39 makeWrapper
40 stripJavaArchivesHook
41 copyDesktopItems
42 ];
43
44 installPhase = ''
45 runHook preInstall
46
47 mkdir -p $out/bin $out/share
48
49 install -Dm644 greenfield-apps/target/greenfield-apps-${lib.versions.majorMinor version}.0.jar $out/share/verapdf.jar
50
51 makeWrapper ${jre}/bin/java $out/bin/verapdf-gui --add-flags "-jar $out/share/verapdf.jar"
52 makeWrapper ${jre}/bin/java $out/bin/verapdf --add-flags "-cp $out/share/verapdf.jar org.verapdf.apps.GreenfieldCliWrapper"
53
54 install -Dm644 gui/src/main/resources/org/verapdf/gui/images/icon.png $out/share/icons/hicolor/256x256/apps/verapdf.png
55
56 runHook postInstall
57 '';
58
59 desktopItems = [
60 (makeDesktopItem {
61 name = "veraPDF";
62 comment = meta.description;
63 desktopName = "veraPDF";
64 genericName = "PDF/A Conformance Checker";
65 exec = "verapdf-gui";
66 icon = "verapdf";
67 categories = [
68 "Development"
69 "Utility"
70 ];
71 keywords = [ "PDF" ];
72 mimeTypes = [ "application/pdf" ];
73 })
74 ];
75
76 meta = {
77 description = "Command line and GUI industry supported PDF/A and PDF/UA Validation";
78 homepage = "https://github.com/veraPDF/veraPDF-apps";
79 license = [
80 lib.licenses.gpl3Plus
81 # or
82 lib.licenses.mpl20
83 ];
84 mainProgram = "verapdf-gui";
85 maintainers = [
86 lib.maintainers.mohe2015
87 lib.maintainers.kilianar
88 ];
89 };
90}