-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Split pinentry flavours and enable udisks2 on install media again #49270
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,13 +1,41 @@ | ||||||
| { fetchurl, fetchpatch, stdenv, lib, pkgconfig | ||||||
| , libgpgerror, libassuan, libcap ? null, libsecret ? null, ncurses ? null, gtk2 ? null, gcr ? null, qt ? null | ||||||
| , enableEmacs ? false | ||||||
| , libgpgerror, libassuan | ||||||
| , ncurses, gtk2, qt | ||||||
| , libcap ? null, libsecret ? null, gcr ? null | ||||||
| , flavours ? [ "curses" "tty" "gtk2" "qt" "gnome3" "emacs" ] | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe use |
||||||
| }: | ||||||
|
|
||||||
| with stdenv.lib; | ||||||
|
|
||||||
| assert isList flavours && flavours != []; | ||||||
|
|
||||||
| let | ||||||
| mkFlag = pfxTrue: pfxFalse: cond: name: "--${if cond then pfxTrue else pfxFalse}-${name}"; | ||||||
| mkFlag = pfxTrue: pfxFalse: cond: name: | ||||||
| "--${if cond then pfxTrue else pfxFalse}-${name}"; | ||||||
| mkEnable = mkFlag "enable" "disable"; | ||||||
| mkWith = mkFlag "with" "without"; | ||||||
|
|
||||||
| mkEnablePinentry = f: | ||||||
| let | ||||||
| info = flavourInfo.${f}; | ||||||
| inputs = info.buildInputs or []; | ||||||
| flag = flavourInfo.${f}.flag or null; | ||||||
| inputsSatifsfied = inputs == [] || all (f: !(isNull f)) inputs; | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And |
||||||
| in | ||||||
| optionalString (flag != null) | ||||||
| (mkEnable (elem f flavours && inputsSatifsfied) ("pinentry-" + flag)); | ||||||
flokli marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| flavourInfo = { | ||||||
| curses = { bin = "curses"; buildInputs = [ ncurses ]; }; | ||||||
| tty = { bin = "tty"; flag = "tty"; }; | ||||||
| gtk2 = { bin = "gtk-2"; flag = "gtk2"; buildInputs = [ gtk2 ]; }; | ||||||
| gnome3 = { bin = "gnome3"; flag = "gnome3"; buildInputs = [ gcr ]; }; | ||||||
| qt = { bin = "qt"; flag = "qt"; buildInputs = [ qt ]; }; | ||||||
| emacs = { bin = "emacs"; flag = "emacs"; buildInputs = []; }; | ||||||
| }; | ||||||
|
|
||||||
| in | ||||||
|
|
||||||
| stdenv.mkDerivation rec { | ||||||
| name = "pinentry-1.1.0"; | ||||||
|
|
||||||
|
|
@@ -16,13 +44,11 @@ stdenv.mkDerivation rec { | |||||
| sha256 = "0w35ypl960pczg5kp6km3dyr000m1hf0vpwwlh72jjkjza36c1v8"; | ||||||
| }; | ||||||
|
|
||||||
| buildInputs = [ libgpgerror libassuan libcap libsecret gtk2 gcr ncurses qt ]; | ||||||
|
|
||||||
| prePatch = '' | ||||||
| substituteInPlace pinentry/pinentry-curses.c --replace ncursesw ncurses | ||||||
| ''; | ||||||
| nativeBuildInputs = [ pkgconfig ]; | ||||||
| buildInputs = [ libgpgerror libassuan libcap libsecret ] | ||||||
| ++ flatten (flip map flavours (f: flavourInfo.${f}.buildInputs or [])); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just
Suggested change
Hopefully, there will not be multiple levels of nested lists. |
||||||
|
|
||||||
| patches = lib.optionals (gtk2 != null) [ | ||||||
| patches = optionals (elem "gtk2" flavours) [ | ||||||
| (fetchpatch { | ||||||
| url = https://sources.debian.org/data/main/p/pinentry/1.1.0-1/debian/patches/0007-gtk2-When-X11-input-grabbing-fails-try-again-over-0..patch; | ||||||
| sha256 = "15r1axby3fdlzz9wg5zx7miv7gqx2jy4immaw4xmmw5skiifnhfd"; | ||||||
|
|
@@ -32,15 +58,24 @@ stdenv.mkDerivation rec { | |||||
| configureFlags = [ | ||||||
| (mkWith (libcap != null) "libcap") | ||||||
| (mkEnable (libsecret != null) "libsecret") | ||||||
| (mkEnable (ncurses != null) "pinentry-curses") | ||||||
| (mkEnable true "pinentry-tty") | ||||||
| (mkEnable enableEmacs "pinentry-emacs") | ||||||
| (mkEnable (gtk2 != null) "pinentry-gtk2") | ||||||
| (mkEnable (gcr != null) "pinentry-gnome3") | ||||||
| (mkEnable (qt != null) "pinentry-qt") | ||||||
| ]; | ||||||
| ] ++ (map mkEnablePinentry (attrNames flavourInfo)); | ||||||
|
|
||||||
| nativeBuildInputs = [ pkgconfig ]; | ||||||
| postInstall = | ||||||
| concatStrings (flip map flavours (f: | ||||||
| let | ||||||
| binary = "pinentry-" + flavourInfo.${f}.bin; | ||||||
| outputVar = "$" + f; | ||||||
| in '' | ||||||
| moveToOutput bin/${binary} ${outputVar} | ||||||
| ln -sf ${outputVar}/bin/${binary} ${outputVar}/bin/pinentry | ||||||
| '')) | ||||||
| + '' | ||||||
| ln -sf ${head flavours}/bin/pinentry-${flavourInfo.${head flavours}.bin} $out/bin/pinentry | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should not this be
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we could even use placeholder now. |
||||||
| ''; | ||||||
|
|
||||||
| outputs = [ "out" ] ++ flavours; | ||||||
|
|
||||||
| passthru = { inherit flavours; }; | ||||||
|
|
||||||
| meta = with stdenv.lib; { | ||||||
| homepage = http://gnupg.org/aegypten2/; | ||||||
|
|
@@ -51,6 +86,6 @@ stdenv.mkDerivation rec { | |||||
| Pinentry provides a console and (optional) GTK+ and Qt GUIs allowing users | ||||||
| to enter a passphrase when `gpg' or `gpg2' is run and needs it. | ||||||
| ''; | ||||||
| maintainers = [ maintainers.ttuegel ]; | ||||||
| maintainers = with maintainers; [ ttuegel fpletz ]; | ||||||
| }; | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2894,10 +2894,12 @@ with pkgs; | |
| gnupg1compat = callPackage ../tools/security/gnupg/1compat.nix { }; | ||
| gnupg1 = gnupg1compat; # use config.packageOverrides if you prefer original gnupg1 | ||
| gnupg20 = callPackage ../tools/security/gnupg/20.nix { | ||
| pinentry = if stdenv.isDarwin then pinentry_mac else pinentry; | ||
| guiSupport = stdenv.isDarwin; | ||
| pinentry = if stdenv.isDarwin then pinentry_mac else pinentry_gtk2; | ||
| }; | ||
| gnupg22 = callPackage ../tools/security/gnupg/22.nix { | ||
| pinentry = if stdenv.isDarwin then pinentry_mac else pinentry; | ||
| guiSupport = stdenv.isDarwin; | ||
| pinentry = if stdenv.isDarwin then pinentry_mac else pinentry_gtk2; | ||
| }; | ||
| gnupg = gnupg22; | ||
|
|
||
|
|
@@ -4735,26 +4737,19 @@ with pkgs; | |
|
|
||
| pinentry = callPackage ../tools/security/pinentry { | ||
| libcap = if stdenv.isDarwin then null else libcap; | ||
| }; | ||
|
|
||
| pinentry_ncurses = self.pinentry.override { | ||
| gtk2 = null; | ||
| }; | ||
|
|
||
| pinentry_emacs = self.pinentry.override { | ||
| enableEmacs = true; | ||
| }; | ||
|
|
||
| pinentry_gnome = self.pinentry.override { | ||
| qt = qt5.qtbase; | ||
| gcr = gnome3.gcr; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }; | ||
|
|
||
| pinentry_qt4 = self.pinentry.override { | ||
| qt = qt4; | ||
| }; | ||
| pinentry_curses = pinentry.curses; | ||
| pinentry_emacs = pinentry.emacs; | ||
| pinentry_gtk2 = pinentry.gtk2; | ||
| pinentry_qt = pinentry.qt; | ||
| pinentry_gnome = pinentry.gnome3; | ||
|
|
||
| pinentry_qt5 = self.pinentry.override { | ||
| qt = qt5.qtbase; | ||
| pinentry_qt4 = pinentry.override { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not need QT4 variant. #33248 |
||
| qt = qt4; | ||
| flavours = [ "qt" "curses" "tty" ]; | ||
| }; | ||
|
|
||
| pinentry_mac = callPackage ../tools/security/pinentry/mac.nix { | ||
|
|
||
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.
Maybe also mention the default behaviour.