Files
nixpkgs/pkgs/by-name/st/stirling-pdf/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

85 lines
2.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchpatch2,
gradle_8,
makeWrapper,
jre,
}:
let
gradle = gradle_8;
in
stdenv.mkDerivation (finalAttrs: {
pname = "stirling-pdf";
version = "1.3.2";
src = fetchFromGitHub {
owner = "Stirling-Tools";
repo = "Stirling-PDF";
rev = "v${finalAttrs.version}";
hash = "sha256-H1nYRUIUVRUGGK+Vonr2v7oM6SfhYEsFk+JJp/4DI4M=";
};
patches = [
# remove timestamp from the header of a generated .properties file
./remove-props-file-timestamp.patch
# Apply fix for building on macOS. Remove when updating the package next time.
(fetchpatch2 {
name = "normalize-path-in-ApplicationPropertiesLogicTest.patch";
url = "https://github.com/Stirling-Tools/Stirling-PDF/commit/93fb62047a6ab85db63305c23dde5e5118e1ae2e.patch";
hash = "sha256-kQNYyRtJ0smuhaoII31k87b7QRBJosK6xlFiQUwobsg=";
})
];
mitmCache = gradle.fetchDeps {
inherit (finalAttrs) pname;
data = ./deps.json;
};
__darwinAllowLocalNetworking = true;
# disable spotless because it tries to fetch files not in deps.json
# and also because it slows down the build process
gradleFlags = [
"-x"
"spotlessApply"
"-DDISABLE_ADDITIONAL_FEATURES=true"
];
doCheck = true;
nativeBuildInputs = [
gradle
gradle.jdk # one of the tests also require that the `java` command is available on the command line
makeWrapper
];
installPhase = ''
runHook preInstall
install -Dm644 ./app/core/build/libs/stirling-pdf-*.jar $out/share/stirling-pdf/Stirling-PDF.jar
makeWrapper ${lib.getExe jre} $out/bin/Stirling-PDF \
--add-flags "-jar $out/share/stirling-pdf/Stirling-PDF.jar"
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = {
changelog = "https://github.com/Stirling-Tools/Stirling-PDF/releases/tag/v${finalAttrs.version}";
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.mit;
mainProgram = "Stirling-PDF";
maintainers = with lib.maintainers; [ tomasajt ];
platforms = jre.meta.platforms;
sourceProvenance = with lib.sourceTypes; [
fromSource
binaryBytecode # deps
];
};
})