-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
tpm2-openssl: init at 1.2.0 #299626
tpm2-openssl: init at 1.2.0 #299626
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it out and it does indeed work as expected.
I have a few suggestions and comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a recursive attribute set instead of finalAttrs and reformat afterwards. See the attached patch for reference. Otherwise LGTM.
diff --git a/pkgs/by-name/tp/tpm2-openssl/package.nix b/pkgs/by-name/tp/tpm2-openssl/package.nix
index a3cce7058653..1a0d6454a3e2 100644
--- a/pkgs/by-name/tp/tpm2-openssl/package.nix
+++ b/pkgs/by-name/tp/tpm2-openssl/package.nix
@@ -6,16 +6,16 @@
, pkg-config
, openssl
, tpm2-tss
-,
}:
-stdenv.mkDerivation (
- finalAttrs: {
+
+stdenv.mkDerivation rec {
pname = "tpm2-openssl";
version = "1.2.0";
+
src = fetchFromGitHub {
owner = "tpm2-software";
repo = "tpm2-openssl";
- rev = finalAttrs.version;
+ rev = version;
hash = "sha256-mZ4Z/GxJFwwfyFd1SAiVlQqOjkFSzsZePeuEZtq8Mcg=";
};
@@ -37,7 +37,7 @@ stdenv.mkDerivation (
'';
prePatch = ''
- echo ${finalAttrs.version} > VERSION
+ echo ${version} > VERSION
'';
meta = with lib; {
@@ -47,5 +47,4 @@ stdenv.mkDerivation (
maintainers = with maintainers; [ stv0g ];
platforms = platforms.linux;
};
- }
-)
+}
Thanks for the review :) I am wondering, why is using |
#119942 and #293452 and this tip on nix.dev suggest we're broadly abandoning |
Fair, I informed myself about this (thanks @WilliButz). Never mind my comments :) |
Result of 1 package failed to build:
|
Okay, I found the issue. It was broken by this recommendation by @SuperSandro2000 Environment variables are not substituted in --- configureFlags = [ "--with-modulesdir=$out/lib/ossl-modules" ];
+++ configureFlags = [ "--with-modulesdir=$$out/lib/ossl-modules" ]; I've seen that this is handled quite inconsistently in Nixpkgs. Some packages are using the escaping with I will draft another PR to align this tree-wide. |
I think you could also use $(out) |
Description of changes
This PR packages tpm2-openssl an OpenSSL Provider for TPM2 integration.
Tested with:
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.