narsil: bbc8fc5efd779ec885045f9b8d903d0df1bec1b2 -> f5ec6bd6b8013f2a2b74fc45b6f4c5374...
[NixPkgs.git] / pkgs / by-name / ce / certificate-ripper / package.nix
blobea76132ab5b72bdf5e7696533245a96e150baf8c
2   lib,
3   maven,
4   fetchFromGitHub,
5   buildGraalvmNativeImage,
6 }:
8 let
9   pname = "certificate-ripper";
10   version = "2.3.0";
12   jar = maven.buildMavenPackage {
13     pname = "${pname}-jar";
14     inherit version;
16     src = fetchFromGitHub {
17       owner = "Hakky54";
18       repo = "certificate-ripper";
19       rev = version;
20       hash = "sha256-q/UhKLFAre3YUH2W7e+SH4kRM0GIZAUyNJFDm02eL+8=";
21     };
23     patches = [
24       ./pin-default-maven-plguin-versions.patch
25       ./fix-test-temp-dir-path.patch
26     ];
28     mvnHash = "sha256-/iy7DXBAyq8TIpvrd2WAQh+9OApfxCWo1NoGwbzbq7s=";
30     mvnParameters = lib.escapeShellArgs [
31       "-Dproject.build.outputTimestamp=1980-01-01T00:00:02Z" # make timestamp deterministic
32       "-Dtest=!PemExportCommandShould#resolveRootCaOnlyWhenEnabled" # disable test using network
33     ];
35     installPhase = ''
36       install -Dm644 target/crip.jar $out
37     '';
38   };
40 buildGraalvmNativeImage {
41   inherit pname version;
43   src = jar;
45   executable = "crip";
47   # Copied from pom.xml
48   extraNativeImageBuildArgs = [
49     "--no-fallback"
50     "-H:ReflectionConfigurationResources=graalvm_config.json"
51     "-H:EnableURLProtocols=https"
52     "-H:EnableURLProtocols=http"
53   ];
55   meta = {
56     changelog = "https://github.com/Hakky54/certificate-ripper/releases/tag/${version}";
57     description = "CLI tool to extract server certificates";
58     homepage = "https://github.com/Hakky54/certificate-ripper";
59     license = lib.licenses.asl20;
60     maintainers = with lib.maintainers; [ tomasajt ];
61   };