Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

globalplatform: init at 2.4.0-unreleased #392260

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

StarGate01
Copy link
Member

This PR adds the libraries and tools of https://github.com/kaoh/globalplatform , most notably the gpshell smartcard management tool. It provides a similar functionality to the already packaged global-platform-pro software, but uses scripted batch processing instead of an interactive CLI.

I wanted to package the upstream 2.4.0 tagged release directly, but since then some very useful PRs were accepted, without which the software does not even compile properly on NixOS. I have also taken care to enable and run all provided automatic tests.

I have added support for Darwin on a best-effort basis, but I do not have a system to test with. Upstream claims to support it.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@JayRovacsek
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 392260


aarch64-darwin

✅ 1 package built:
  • globalplatform

Copy link
Contributor

@bjornfor bjornfor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, another gpshell user :-)

I have a local expression that I didn't upstream yet. Here's the notable differences against mine:

  • Version 2.4.0 can be used directly if adding this little snippet:
+  # Fails on out-of-source builds. Proposed fix here:                                                                                                                                                                                                                                                                                                                                                                                                                                        
+  # https://github.com/kaoh/globalplatform/pull/96                                                                                                                                                                                                                                                                                                                                                                                                                                           
+  dontUseCmakeBuildDir = true;                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+  postPatch = ''                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+    # Fix incorrect version number.                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+    substituteInPlace gpshell/src/gpshell.1.md \                                                                                                                                                                                                                                                                                                                                                                                                                                             
+        --replace-fail "2.2.0" "${finalAttrs.version}"                                                                                                                                                                                                                                                                                                                                                                                                                                       
+  '';                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

And I ended up with this license:

+    # https://github.com/kaoh/globalplatform/issues/81 ("Clarify license for GPShell")                                                                                                                                                                                                                                                                                                                                                                                                       
+    license = lib.licenses.gpl3Plus;                                                                                                                                                                                                                                                                                                                                                                                                                                                         

@StarGate01
Copy link
Member Author

StarGate01 commented Mar 23, 2025

@bjornfor Thank you for your suggestions, I have implemented the license change.

Since there were quite some PRs merged into upstream which make building easier (cmake, versions, etc - also one of my own fixes which I need to be there, kaoh/globalplatform#101), I kind of don't want to pull in a whole range of PRs as separate patches, and would instead suggest to build this unreleased version. What do you think?

@bjornfor
Copy link
Contributor

I kind of don't want to pull in a whole range of PRs as separate patches, and would instead suggest to build this unreleased version. What do you think?

Ok :-) (I didn't know about the additional PRs.)

# The user has to specify custom plugin locations by setting LD_LIBRARY_PATH.

postFixup = ''
patchelf $out/lib/libglobalplatform.so --add-rpath "$out/lib"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Darwin builds seems to be failing on this. I'm not familiar enough with darwin to suggest a solution. Is it common for darwin to use patchelf?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a conditional call to install_name_tool, which seems to be the equivalent for Darwin. I'll see what the builder says to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants