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

Packaging request: nitrocli (tests contain hardcoded python-path) #140644

Closed
Jauchi opened this issue Oct 5, 2021 · 1 comment
Closed

Packaging request: nitrocli (tests contain hardcoded python-path) #140644

Jauchi opened this issue Oct 5, 2021 · 1 comment

Comments

@Jauchi
Copy link

Jauchi commented Oct 5, 2021

Project description
Hello! I would like to request nitrocli, a cli-alternative to nitrokey-app.
It's written in Rust, I tried a little myself already (my first nix package), but the python stuff is going over my head.

This gets to the testing stage, where it fails.
I assume it fails because the testing creates and executes a python script, which won't work because python is not in the path (resulting in file not found):

{ libusb1, hidapi, lib, rustPlatform, fetchFromGitHub }:
rustPlatform.buildRustPackage rec {
  pname = "nitrocli";
  version = "0.4.1";

  src = fetchFromGitHub {
    owner = "d-e-s-o";
    repo = "nitrocli";
    rev = "8a8250f262100a95164a7b0ff8e1ea7d5c17e3a6";
    sha256 = "1lvl6z9xh479dzpdv11wnxdr9amm8np2037bg79i6im6y23jyn4g";
  };

  cargoSha256 = "0k58bckxxc7kjj3swsm5gg2pvxc7dn7k5s0bv1lajx9gxrhrb04n";

  buildInputs = [
    libusb1
    hidapi
  ];

  meta = {
    description = "A command line tool for interacting with Nitrokey devices";
    homepage = "https://github.com/d-e-s-o/nitrocli";
    license = lib.licenses.gpl3Plus;
  };
}

This is the problematic part is right here: https://github.com/d-e-s-o/nitrocli/blob/97fd3be6375c8158ea58e4d9260f4523753d4c10/src/tests/run.rs#L297
The nicest solution would probably be adding python to the environment at build time, but I don't know how (or if) I should even do that.

Metadata

@Artturin
Copy link
Member

Artturin commented Oct 6, 2021

Use substituteInPlace to replace the shebang with the python shebang like is done here https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/science/logic/symbiyosys/default.nix#L35

@Jauchi Jauchi closed this as completed Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants