at v192 54 lines 1.7 kB view raw
1{ fetchurl, stdenv, pkgconfig 2, libgpgerror, libassuan, libcap ? null, ncurses ? null, gtk2 ? null, qt4 ? null 3}: 4 5let 6 mkFlag = pfxTrue: pfxFalse: cond: name: "--${if cond then pfxTrue else pfxFalse}-${name}"; 7 mkEnable = mkFlag "enable" "disable"; 8 mkWith = mkFlag "with" "without"; 9 hasX = gtk2 != null || qt4 != null; 10in 11with stdenv.lib; 12stdenv.mkDerivation rec { 13 name = "pinentry-0.9.5"; 14 15 src = fetchurl { 16 url = "mirror://gnupg/pinentry/${name}.tar.bz2"; 17 sha256 = "1338hj1h3sh34897120y30x12b64wyj3xjzzk5asm2hdzhxgsmva"; 18 }; 19 20 buildInputs = [ libgpgerror libassuan libcap gtk2 ncurses qt4 ]; 21 22 prePatch = '' 23 substituteInPlace pinentry/pinentry-curses.c --replace ncursesw ncurses 24 ''; 25 26 # configure cannot find moc on its own 27 preConfigure = stdenv.lib.optionalString (qt4 != null) '' 28 export QTDIR="${qt4}" 29 export MOC="${qt4}/bin/moc" 30 ''; 31 32 configureFlags = [ 33 (mkWith (libcap != null) "libcap") 34 (mkWith (hasX) "x") 35 (mkEnable (ncurses != null) "pinentry-curses") 36 (mkEnable true "pinentry-tty") 37 (mkEnable (gtk2 != null) "pinentry-gtk2") 38 (mkEnable (qt4 != null) "pinentry-qt4") 39 ]; 40 41 nativeBuildInputs = [ pkgconfig ]; 42 43 meta = { 44 homepage = "http://gnupg.org/aegypten2/"; 45 description = "GnuPG's interface to passphrase input"; 46 license = stdenv.lib.licenses.gpl2Plus; 47 platforms = stdenv.lib.platforms.all; 48 longDescription = '' 49 Pinentry provides a console and (optional) GTK+ and Qt GUIs allowing users 50 to enter a passphrase when `gpg' or `gpg2' is run and needs it. 51 ''; 52 maintainers = [ stdenv.lib.maintainers.ttuegel ]; 53 }; 54}