1 { lib, stdenv, fetchFromGitHub, jdk8, maven, makeWrapper, jre8_headless, pcsclite, proot, zlib }:
4 mavenJdk8 = maven.override {
11 # One of the deps that are downloaded and run needs zlib.
12 export LD_LIBRARY_PATH="${lib.makeLibraryPath [zlib]}"
13 # Give access to ELF interpreter under FHS path, to be able to run
15 "${lib.getExe proot}" -b "${stdenv.cc.libc}/lib:/lib64" mvn "$@"
19 mavenJdk8.buildMavenPackage rec {
20 pname = "global-platform-pro";
22 GPPRO_VERSION = "v20.01.23-0-g5ad373b"; # git describe --tags --always --long --dirty
24 src = fetchFromGitHub {
25 owner = "martinpaljak";
26 repo = "GlobalPlatformPro";
28 sha256 = "sha256-z38I61JR4oiAkImkbwcvXoK5QsdoR986dDrOzhHsCeY=";
31 mvnHash = "sha256-Qbx1cNKFtSEnzhFImtCz2psYts2yhTDKzjmBBZavWwU=";
33 nativeBuildInputs = [ jdk8 makeWrapper ];
35 # Fix build error due to missing .git directory:
36 # Failed to execute goal pl.project13.maven:git-commit-id-plugin:4.0.0:revision (retrieve-git-info) on project gppro: .git directory is not found! Please specify a valid [dotGitDirectory] in your pom.xml -> [Help 1]
37 mvnParameters = "-Dmaven.gitcommitid.skip=true";
40 preConfigure = defineMvnWrapper;
43 preConfigure = defineMvnWrapper;
46 mkdir -p "$out/lib/java" "$out/share/java"
47 cp tool/target/gp.jar "$out/share/java"
48 makeWrapper "${jre8_headless}/bin/java" "$out/bin/gp" \
49 --add-flags "-jar '$out/share/java/gp.jar'" \
50 --prefix LD_LIBRARY_PATH : "${lib.getLib pcsclite}/lib"
54 description = "Command-line utility for managing applets and keys on Java Cards";
56 This command-line utility can be used to manage applets and keys
57 on Java Cards. It is made available as the `gp` executable.
59 The executable requires the PC/SC daemon running for correct execution.
60 If you run NixOS, it can be enabled with `services.pcscd.enable = true;`.
62 homepage = "https://github.com/martinpaljak/GlobalPlatformPro";
63 sourceProvenance = with sourceTypes; [
67 license = with licenses; [ lgpl3 ];
68 maintainers = with maintainers; [ ekleog ];