nixpkgs/pkgs/by-name/st/stirling-pdf/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

77 lines
1.8 KiB
Nix
Raw Normal View History

2024-01-23 21:19:18 +01:00
{
lib,
stdenv,
fetchFromGitHub,
gradle_7,
makeWrapper,
jre,
}:
let
gradle = gradle_7;
in
2024-01-23 21:19:18 +01:00
stdenv.mkDerivation (finalAttrs: {
pname = "stirling-pdf";
2024-08-19 20:06:42 +02:00
version = "0.28.3";
2024-01-23 21:19:18 +01:00
src = fetchFromGitHub {
owner = "Stirling-Tools";
repo = "Stirling-PDF";
rev = "v${finalAttrs.version}";
2024-08-19 20:06:42 +02:00
hash = "sha256-88UdJPn9AeLtpKEu3efHm+xj4lheQ0EPyvId4vYskIo=";
2024-01-23 21:19:18 +01:00
};
patches = [
# remove timestamp from the header of a generated .properties file
./remove-props-file-timestamp.patch
];
mitmCache = gradle.fetchDeps {
inherit (finalAttrs) pname;
data = ./deps.json;
};
2024-01-23 21:19:18 +01:00
__darwinAllowLocalNetworking = true;
2024-01-23 21:19:18 +01:00
# disable spotless because it tries to fetch files not in deps.json
# and also because it slows down the build process
2024-08-02 02:03:15 +02:00
gradleFlags = [
"-x"
"spotlessApply"
];
2024-01-23 21:19:18 +01:00
doCheck = true;
2024-01-23 21:19:18 +01:00
nativeBuildInputs = [
gradle
2024-08-02 02:03:15 +02:00
gradle.jdk # one of the tests also require that the `java` command is available on the command line
2024-01-23 21:19:18 +01:00
makeWrapper
];
installPhase = ''
runHook preInstall
install -Dm644 build/libs/Stirling-PDF-*.jar $out/share/stirling-pdf/Stirling-PDF.jar
makeWrapper ${jre}/bin/java $out/bin/Stirling-PDF \
--add-flags "-jar $out/share/stirling-pdf/Stirling-PDF.jar"
runHook postInstall
'';
2024-08-25 11:01:43 +02:00
passthru.updateScript = ./update.sh;
2024-01-23 21:19:18 +01:00
meta = {
2024-08-02 02:03:15 +02:00
changelog = "https://github.com/Stirling-Tools/Stirling-PDF/releases/tag/v${finalAttrs.version}";
2024-01-23 21:19:18 +01:00
description = "Locally hosted web application that allows you to perform various operations on PDF files";
homepage = "https://github.com/Stirling-Tools/Stirling-PDF";
license = lib.licenses.gpl3Only;
mainProgram = "Stirling-PDF";
maintainers = with lib.maintainers; [ tomasajt ];
platforms = jre.meta.platforms;
sourceProvenance = with lib.sourceTypes; [
fromSource
binaryBytecode # deps
];
};
})