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