portage-overlay

personal portage ebuild repository
git clone anongit@rnpnr.xyz:portage-overlay.git
Log | Files | Refs | Feed | README

gnupg-2.4.3.ebuild (5180B)


      1 # Copyright 1999-2023 Gentoo Authors
      2 # Distributed under the terms of the GNU General Public License v2
      3 
      4 EAPI=8
      5 
      6 # Maintainers should:
      7 # 1. Join the "Gentoo" project at https://dev.gnupg.org/project/view/27/
      8 # 2. Subscribe to release tasks like https://dev.gnupg.org/T6159
      9 # (find the one for the current release then subscribe to it +
     10 # any subsequent ones linked within so you're covered for a while.)
     11 
     12 VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/gnupg.asc
     13 # in-source builds are not supported: https://dev.gnupg.org/T6313#166339
     14 inherit flag-o-matic out-of-source multiprocessing systemd toolchain-funcs verify-sig
     15 
     16 MY_P="${P/_/-}"
     17 
     18 DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation"
     19 HOMEPAGE="https://gnupg.org/"
     20 SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2"
     21 SRC_URI+=" verify-sig? ( mirror://gnupg/gnupg/${P}.tar.bz2.sig )"
     22 S="${WORKDIR}/${MY_P}"
     23 
     24 LICENSE="GPL-3+"
     25 SLOT="0"
     26 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
     27 IUSE="bzip2 doc ldap nls readline selinux +smartcard ssl test +tofu tpm tools usb user-socket wks-server"
     28 RESTRICT="!test? ( test )"
     29 REQUIRED_USE="test? ( tofu )"
     30 
     31 # Existence of executables is checked during configuration.
     32 # Note: On each bump, update dep bounds on each version from configure.ac!
     33 DEPEND="
     34 	>=dev-libs/libassuan-2.5.0
     35 	>=dev-libs/libgcrypt-1.9.1:=
     36 	>=dev-libs/libgpg-error-1.46
     37 	>=dev-libs/libksba-1.6.3
     38 	>=dev-libs/npth-1.2
     39 	>=net-misc/curl-7.10
     40 	sys-libs/zlib
     41 	bzip2? ( app-arch/bzip2 )
     42 	ldap? ( net-nds/openldap:= )
     43 	readline? ( sys-libs/readline:0= )
     44 	smartcard? ( usb? ( virtual/libusb:1 ) )
     45 	tofu? ( >=dev-db/sqlite-3.27 )
     46 	tpm? ( >=app-crypt/tpm2-tss-2.4.0:= )
     47 	ssl? ( >=net-libs/gnutls-3.0:0= )
     48 "
     49 RDEPEND="
     50 	${DEPEND}
     51 	|| (
     52 		app-crypt/pinentry
     53 		app-crypt/pinentry-dmenu
     54 	)
     55 	nls? ( virtual/libintl )
     56 	selinux? ( sec-policy/selinux-gpg )
     57 	wks-server? ( virtual/mta )
     58 "
     59 BDEPEND="
     60 	virtual/pkgconfig
     61 	doc? ( sys-apps/texinfo )
     62 	nls? ( sys-devel/gettext )
     63 	verify-sig? ( sec-keys/openpgp-keys-gnupg )
     64 "
     65 
     66 DOCS=(
     67 	ChangeLog NEWS README THANKS TODO VERSION
     68 	doc/FAQ doc/DETAILS doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER
     69 )
     70 
     71 PATCHES=(
     72 	"${FILESDIR}"/${PN}-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch
     73 	"${FILESDIR}"/${PN}-2.4.2-fix-emacs.patch
     74 	"${FILESDIR}"/${P}-no-ldap.patch
     75 )
     76 
     77 src_prepare() {
     78 	default
     79 }
     80 
     81 my_src_configure() {
     82 	# Upstream don't support LTO, bug #854222.
     83 	filter-lto
     84 
     85 	local myconf=(
     86 		$(use_enable bzip2)
     87 		$(use_enable nls)
     88 		$(use_enable smartcard scdaemon)
     89 		$(use_enable ssl gnutls)
     90 		$(use_enable test all-tests)
     91 		$(use_enable test tests)
     92 		$(use_enable tofu)
     93 		$(use_enable tofu keyboxd)
     94 		$(use_enable tofu sqlite)
     95 		$(usex tpm '--with-tss=intel' '--disable-tpm2d')
     96 		$(use smartcard && use_enable usb ccid-driver || echo '--disable-ccid-driver')
     97 		$(use_enable wks-server wks-tools)
     98 		$(use_with ldap)
     99 		$(use_with readline)
    100 
    101 		# Hardcode mailprog to /usr/libexec/sendmail even if it does not exist.
    102 		# As of GnuPG 2.3, the mailprog substitution is used for the binary called
    103 		# by wks-client & wks-server; and if it's autodetected but not not exist at
    104 		# build time, then then 'gpg-wks-client --send' functionality will not
    105 		# work. This has an unwanted side-effect in stage3 builds: there was a
    106 		# [R]DEPEND on virtual/mta, which also brought in virtual/logger, bloating
    107 		# the build where the install guide previously make the user chose the
    108 		# logger & mta early in the install.
    109 		--with-mailprog=/usr/libexec/sendmail
    110 
    111 		--disable-ntbtls
    112 		--enable-gpgsm
    113 		--enable-large-secmem
    114 
    115 		CC_FOR_BUILD="$(tc-getBUILD_CC)"
    116 		GPG_ERROR_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-gpg-error-config"
    117 		KSBA_CONFIG="${ESYSROOT}/usr/bin/ksba-config"
    118 		LIBASSUAN_CONFIG="${ESYSROOT}/usr/bin/libassuan-config"
    119 		LIBGCRYPT_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-libgcrypt-config"
    120 		NPTH_CONFIG="${ESYSROOT}/usr/bin/npth-config"
    121 
    122 		$("${S}/configure" --help | grep -o -- '--without-.*-prefix')
    123 	)
    124 
    125 	if use prefix && use usb; then
    126 		# bug #649598
    127 		append-cppflags -I"${ESYSROOT}/usr/include/libusb-1.0"
    128 	fi
    129 
    130 	# bug #663142
    131 	if use user-socket; then
    132 		myconf+=( --enable-run-gnupg-user-socket )
    133 	fi
    134 
    135 	# glib fails and picks up clang's internal stdint.h causing weird errors
    136 	tc-is-clang && export gl_cv_absolute_stdint_h="${ESYSROOT}"/usr/include/stdint.h
    137 
    138 	econf "${myconf[@]}"
    139 }
    140 
    141 my_src_compile() {
    142 	default
    143 
    144 	use doc && emake -C doc html
    145 }
    146 
    147 my_src_test() {
    148 	export TESTFLAGS="--parallel=$(makeopts_jobs)"
    149 
    150 	default
    151 }
    152 
    153 my_src_install() {
    154 	emake DESTDIR="${D}" install
    155 
    156 	use tools && dobin tools/{gpgconf,gpgsplit,gpg-check-pattern} tools/make-dns-cert
    157 
    158 	dosym gpg /usr/bin/gpg2
    159 	dosym gpgv /usr/bin/gpgv2
    160 	echo ".so man1/gpg.1" > "${ED}"/usr/share/man/man1/gpg2.1 || die
    161 	echo ".so man1/gpgv.1" > "${ED}"/usr/share/man/man1/gpgv2.1 || die
    162 
    163 	dodir /etc/env.d
    164 	echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg || die
    165 
    166 	use doc && dodoc doc/gnupg.html/*
    167 }
    168 
    169 my_src_install_all() {
    170 	einstalldocs
    171 
    172 	use tools && dobin tools/{convert-from-106,mail-signed-keys,lspgpot}
    173 	use doc && dodoc doc/*.png
    174 }