public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/tor/files/, net-vpn/tor/
Date: Thu, 10 Nov 2022 07:13:37 +0000 (UTC)	[thread overview]
Message-ID: <1668063974.3fbcbcd0cdc8cc1730feb90334317fdf2172112e.sam@gentoo> (raw)

commit:     3fbcbcd0cdc8cc1730feb90334317fdf2172112e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 10 07:06:14 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Nov 10 07:06:14 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3fbcbcd0

net-vpn/tor: fix -Wstrict-prototypes

Closes: https://bugs.gentoo.org/879747
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../tor-0.4.7.10-strict-prototypes-clang16.patch   |  75 ++++++++++++
 net-vpn/tor/tor-0.4.7.10-r1.ebuild                 | 127 +++++++++++++++++++++
 2 files changed, 202 insertions(+)

diff --git a/net-vpn/tor/files/tor-0.4.7.10-strict-prototypes-clang16.patch b/net-vpn/tor/files/tor-0.4.7.10-strict-prototypes-clang16.patch
new file mode 100644
index 000000000000..9317b6b215b7
--- /dev/null
+++ b/net-vpn/tor/files/tor-0.4.7.10-strict-prototypes-clang16.patch
@@ -0,0 +1,75 @@
+https://gitlab.torproject.org/tpo/core/tor/-/commit/ee38514cc4372bfb7d01ee96a1110d600a30e061
+
+From ee38514cc4372bfb7d01ee96a1110d600a30e061 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Tue, 8 Nov 2022 06:42:59 +0000
+Subject: [PATCH] build: fix -Wstrict-prototypes (Clang 16)
+
+Clang 16 warns on -Wstrict-prototypes in preparation for C23 which can
+among other things, lead to some configure tests silently failing/returning the wrong result.
+
+Fixes this error:
+```
+-ignoreme: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
++ignoreme: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
+ main ()
+```
+
+For more information, see LWN.net [0] or LLVM's Discourse [1], gentoo-dev@ [2],
+or the (new) c-std-porting mailing list [3].
+
+[0] https://lwn.net/Articles/913505/
+[1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
+[2] https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
+[3] hosted at lists.linux.dev.
+
+Bug: https://bugs.gentoo.org/879747
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/configure.ac
++++ b/configure.ac
+@@ -1982,7 +1982,7 @@ AC_CACHE_CHECK([whether memset(0) sets pointers to NULL], tor_cv_null_is_zero,
+ #ifdef HAVE_STDDEF_H
+ #include <stddef.h>
+ #endif
+-int main () { char *p1,*p2; p1=NULL; memset(&p2,0,sizeof(p2));
++int main (void) { char *p1,*p2; p1=NULL; memset(&p2,0,sizeof(p2));
+ return memcmp(&p1,&p2,sizeof(char*))?1:0; }]])],
+        [tor_cv_null_is_zero=yes],
+        [tor_cv_null_is_zero=no],
+@@ -2006,7 +2006,7 @@ AC_CACHE_CHECK([whether memset(0) sets doubles to 0.0], tor_cv_dbl0_is_zero,
+ #ifdef HAVE_STDDEF_H
+ #include <stddef.h>
+ #endif
+-int main () { double d1,d2; d1=0; memset(&d2,0,sizeof(d2));
++int main (void) { double d1,d2; d1=0; memset(&d2,0,sizeof(d2));
+ return memcmp(&d1,&d2,sizeof(d1))?1:0; }]])],
+        [tor_cv_dbl0_is_zero=yes],
+        [tor_cv_dbl0_is_zero=no],
+@@ -2031,7 +2031,7 @@ AC_CACHE_CHECK([whether we can malloc(0) safely.], tor_cv_malloc_zero_works,
+ #ifdef HAVE_STDDEF_H
+ #include <stddef.h>
+ #endif
+-int main () { return malloc(0)?0:1; }]])],
++int main (void) { return malloc(0)?0:1; }]])],
+        [tor_cv_malloc_zero_works=yes],
+        [tor_cv_malloc_zero_works=no],
+        [tor_cv_malloc_zero_works=cross])])
+@@ -2049,7 +2049,7 @@ fi
+ # whether we seem to be in a 2s-complement world.
+ AC_CACHE_CHECK([whether we are using 2s-complement arithmetic], tor_cv_twos_complement,
+ [AC_RUN_IFELSE([AC_LANG_SOURCE(
+-[[int main () { int problem = ((-99) != (~99)+1);
++[[int main (void) { int problem = ((-99) != (~99)+1);
+ return problem ? 1 : 0; }]])],
+        [tor_cv_twos_complement=yes],
+        [tor_cv_twos_complement=no],
+@@ -2069,7 +2069,7 @@ fi
+ # What does shifting a negative value do?
+ AC_CACHE_CHECK([whether right-shift on negative values does sign-extension], tor_cv_sign_extend,
+ [AC_RUN_IFELSE([AC_LANG_SOURCE(
+-[[int main () { int okay = (-60 >> 8) == -1; return okay ? 0 : 1; }]])],
++[[int main (void) { int okay = (-60 >> 8) == -1; return okay ? 0 : 1; }]])],
+        [tor_cv_sign_extend=yes],
+        [tor_cv_sign_extend=no],
+        [tor_cv_sign_extend=cross])])
+GitLab

diff --git a/net-vpn/tor/tor-0.4.7.10-r1.ebuild b/net-vpn/tor/tor-0.4.7.10-r1.ebuild
new file mode 100644
index 000000000000..42aab32d686a
--- /dev/null
+++ b/net-vpn/tor/tor-0.4.7.10-r1.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit python-any-r1 readme.gentoo-r1 systemd verify-sig
+
+MY_PV="$(ver_rs 4 -)"
+MY_PF="${PN}-${MY_PV}"
+DESCRIPTION="Anonymizing overlay network for TCP"
+HOMEPAGE="https://www.torproject.org/"
+SRC_URI="https://www.torproject.org/dist/${MY_PF}.tar.gz
+	https://archive.torproject.org/tor-package-archive/${MY_PF}.tar.gz
+	verify-sig? (
+		https://dist.torproject.org/${MY_PF}.tar.gz.sha256sum
+		https://dist.torproject.org/${MY_PF}.tar.gz.sha256sum.asc
+	)"
+S="${WORKDIR}/${MY_PF}"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+if [[ ${PV} != *_alpha* && ${PV} != *_beta* && ${PV} != *_rc* ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~ppc-macos"
+fi
+IUSE="caps doc lzma +man scrypt seccomp selinux +server systemd tor-hardening test zstd"
+RESTRICT="!test? ( test )"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/torproject.org.asc
+
+BDEPEND="verify-sig? ( >=sec-keys/openpgp-keys-tor-20220216 )"
+DEPEND="
+	dev-libs/libevent:=[ssl]
+	sys-libs/zlib
+	caps? ( sys-libs/libcap )
+	man? ( app-text/asciidoc )
+	dev-libs/openssl:0=[-bindist(-)]
+	lzma? ( app-arch/xz-utils )
+	scrypt? ( app-crypt/libscrypt )
+	seccomp? ( >=sys-libs/libseccomp-2.4.1 )
+	systemd? ( sys-apps/systemd )
+	zstd? ( app-arch/zstd )"
+RDEPEND="
+	acct-user/tor
+	acct-group/tor
+	${DEPEND}
+	selinux? ( sec-policy/selinux-tor )"
+
+# bug #764260
+DEPEND+="
+	test? (
+		${DEPEND}
+		${PYTHON_DEPS}
+	)"
+
+DOCS=()
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.2.7.4-torrc.sample.patch
+	"${FILESDIR}"/${P}-strict-prototypes-clang16.patch
+)
+
+# EAPI 8 tries to append it but it doesn't exist here
+# bug #831311 etc
+QA_CONFIGURE_OPTIONS="--disable-static"
+
+pkg_setup() {
+	use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+	if use verify-sig; then
+		cd "${DISTDIR}" || die
+		verify-sig_verify_detached ${MY_PF}.tar.gz.sha256sum{,.asc}
+		verify-sig_verify_unsigned_checksums \
+			${MY_PF}.tar.gz.sha256sum sha256 ${MY_PF}.tar.gz
+		cd "${WORKDIR}" || die
+	fi
+
+	default
+}
+
+src_configure() {
+	use doc && DOCS+=( README.md ChangeLog ReleaseNotes doc/HACKING )
+	export ac_cv_lib_cap_cap_init=$(usex caps)
+	econf \
+		--localstatedir="${EPREFIX}/var" \
+		--disable-all-bugs-are-fatal \
+		--enable-system-torrc \
+		--disable-android \
+		--disable-html-manual \
+		--disable-libfuzzer \
+		--enable-missing-doc-warnings \
+		--disable-module-dirauth \
+		--enable-pic \
+		--disable-restart-debugging \
+		--disable-zstd-advanced-apis  \
+		$(use_enable man asciidoc) \
+		$(use_enable man manpage) \
+		$(use_enable lzma) \
+		$(use_enable scrypt libscrypt) \
+		$(use_enable seccomp) \
+		$(use_enable server module-relay) \
+		$(use_enable systemd) \
+		$(use_enable tor-hardening gcc-hardening) \
+		$(use_enable tor-hardening linker-hardening) \
+		$(use_enable test unittests) \
+		$(use_enable test coverage) \
+		$(use_enable zstd)
+}
+
+src_install() {
+	default
+	readme.gentoo_create_doc
+
+	newconfd "${FILESDIR}"/tor.confd tor
+	newinitd "${FILESDIR}"/tor.initd-r9 tor
+	systemd_dounit "${FILESDIR}"/tor.service
+
+	keepdir /var/lib/tor
+
+	fperms 750 /var/lib/tor
+	fowners tor:tor /var/lib/tor
+
+	insinto /etc/tor/
+	newins "${FILESDIR}"/torrc-r2 torrc
+}


             reply	other threads:[~2022-11-10  7:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10  7:13 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-04-26  3:51 [gentoo-commits] repo/gentoo:master commit in: net-vpn/tor/files/, net-vpn/tor/ Sam James
2021-02-19 16:04 Sam James
2019-12-08 17:04 Anthony G. Basile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1668063974.3fbcbcd0cdc8cc1730feb90334317fdf2172112e.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox