Skip to content

Commit eea8405

Browse files
committed
dev-libs/nspr: Sync with Gentoo
It's from Gentoo commit 5caead31afd6d66482e29c075b2a21675cb99015.
1 parent b6e7672 commit eea8405

File tree

4 files changed

+79
-29
lines changed

4 files changed

+79
-29
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
DIST nspr-4.33.tar.gz 1078948 BLAKE2B b46e1c02ab7e5c442288a2cba2868166adb9461950d35fcd76074e3340734057f2b1bbeb3c700f38edf3710323ffd34576dd644814c379033de2a380c54d4fe3 SHA512 8064f826c977f1302a341ca7a7aaf7977b5d10102062c030b1d42b856638e3408ab262447e8c7cfd5a98879b9b1043d17ceae66fbb1e5ed86d6bc3531f26667e
1+
DIST nspr-4.35.tar.gz 1096974 BLAKE2B c80402d7be9e69ab6d1e768a18d271a8d28900f4cae7df2709d1ab26e100d908f508762bb771d4042aa7152934ce83d495e2102e894c56574187be8040d65629 SHA512 502815833116e25f79ddf71d1526484908aa92fbc55f8a892729cb404a4daafcc0470a89854cd080d2d20299fdb7d9662507c5362c7ae661cbacf308ac56ef7f
Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
From 8c57451f44d7ceb37bfb4ae6e457fc70b1f58d0a Mon Sep 17 00:00:00 2001
2-
From: Moritz Kick <gentoo@blackphoenix.de>
3-
Date: Wed, 20 Mar 2019 13:36:06 -0500
1+
From 2e6a43c751707b6983760669988ba4d2826ffd5b Mon Sep 17 00:00:00 2001
2+
From: Violet Purcell <vimproved@inventati.org>
3+
Date: Sat, 10 Jun 2023 04:37:55 +0000
44
Subject: [PATCH] Added IPv6 compatibility for musl libc
55

6-
Signed-off-by: Moritz Kick <gentoo@blackphoenix.de>
7-
Signed-off-by: Jory Pratt <anarchy@gentoo.org>
8-
---
9-
pr/include/md/_linux.h | 13 +------------
10-
1 file changed, 1 insertion(+), 12 deletions(-)
11-
12-
diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h
13-
index 2370ab8..612184c 100644
146
--- a/pr/include/md/_linux.h
157
+++ b/pr/include/md/_linux.h
16-
@@ -289,33 +289,22 @@ static inline PRInt32 _MD_ATOMIC_SET(PRInt32 *ptr, PRInt32 nv)
8+
@@ -315,33 +315,19 @@ static inline PRInt32 _MD_ATOMIC_SET(PRInt32 *ptr, PRInt32 nv)
179
#endif /* __arm__ */
1810

1911
#define USE_SETJMP
@@ -22,17 +14,17 @@ index 2370ab8..612184c 100644
2214
-#endif
2315
#undef _PR_USE_POLL
2416
#define _PR_STAT_HAS_ONLY_ST_ATIME
25-
#if defined(__alpha) || defined(__ia64__)
17+
-#if defined(__alpha) || defined(__ia64__)
2618
#define _PR_HAVE_LARGE_OFF_T
2719
-#elif (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) \
2820
- || defined(ANDROID)
2921
-#define _PR_HAVE_OFF64_T
30-
#else
22+
-#else
3123
-#define _PR_NO_LARGE_FILES
32-
+#define _PR_HAVE_OFF64_T
33-
#endif
24+
-#endif
3425
-#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) \
3526
- || defined(ANDROID)
27+
+#define _FILE_OFFSET_BITS 64
3628
#define _PR_INET6
3729
#define _PR_HAVE_INET_NTOP
3830
#define _PR_HAVE_GETHOSTBYNAME2
@@ -49,5 +41,5 @@ index 2370ab8..612184c 100644
4941
#define _PR_HAVE_GETHOST_R_INT
5042
#endif
5143
--
52-
2.21.0
44+
2.41.0
5345

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
needed since https://github.com/bminor/musl/commit/25e6fee27f4a293728dd15b659170e7b9c7db9bc
2+
--
3+
diff --git a/pr/include/md/_unixos.h b/pr/include/md/_unixos.h
4+
index 7d444cd..0099d2c 100644
5+
--- a/pr/include/md/_unixos.h
6+
+++ b/pr/include/md/_unixos.h
7+
@@ -589,7 +589,7 @@ typedef off64_t _MDOff64_t;
8+
9+
#elif defined(_PR_HAVE_OFF64_T)
10+
typedef struct stat64 _MDStat64;
11+
-typedef off64_t _MDOff64_t;
12+
+typedef off_t _MDOff64_t;
13+
#elif defined(_PR_HAVE_LARGE_OFF_T)
14+
typedef struct stat _MDStat64;
15+
typedef off_t _MDOff64_t;

sdk_container/src/third_party/portage-stable/dev-libs/nspr/nspr-4.33.ebuild renamed to sdk_container/src/third_party/portage-stable/dev-libs/nspr/nspr-4.35-r2.ebuild

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Copyright 1999-2022 Gentoo Authors
1+
# Copyright 1999-2023 Gentoo Authors
22
# Distributed under the terms of the GNU General Public License v2
33

4-
EAPI=7
4+
EAPI=8
55

6-
inherit autotools toolchain-funcs multilib-minimal
6+
inherit autotools flag-o-matic toolchain-funcs multilib-minimal
77

88
MIN_PV="$(ver_cut 2)"
99

@@ -13,29 +13,34 @@ SRC_URI="https://archive.mozilla.org/pub/nspr/releases/v${PV}/src/${P}.tar.gz"
1313

1414
LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
1515
SLOT="0"
16-
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris ~x86-solaris"
16+
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
1717
IUSE="debug"
1818

1919
MULTILIB_CHOST_TOOLS=(
2020
/usr/bin/nspr-config
2121
)
2222

2323
PATCHES=(
24+
"${FILESDIR}"/${PN}-4.10.6-solaris.patch
2425
"${FILESDIR}"/${PN}-4.23-prtime.patch
2526
"${FILESDIR}"/${PN}-4.7.1-solaris.patch
26-
"${FILESDIR}"/${PN}-4.10.6-solaris.patch
2727
"${FILESDIR}"/${PN}-4.8.4-darwin-install_name.patch
2828
"${FILESDIR}"/${PN}-4.8.9-link-flags.patch
2929
# We do not need to pass -L$libdir via nspr-config --libs
3030
"${FILESDIR}"/${PN}-4.9.5_nspr_config.patch
3131
)
3232

33+
QA_CONFIGURE_OPTIONS="--disable-static"
34+
3335
src_prepare() {
3436
cd "${S}"/nspr || die
3537

3638
default
3739

38-
use elibc_musl && eapply "${FILESDIR}"/${PN}-4.21-ipv6-musl-support.patch
40+
if use elibc_musl; then
41+
eapply "${FILESDIR}"/${PN}-4.21-ipv6-musl-support.patch
42+
eapply "${FILESDIR}"/nspr-4.35-bgo-905998-lfs64-musl.patch
43+
fi
3944

4045
# rename configure.in to configure.ac for new autotools compatibility
4146
if [[ -e "${S}"/nspr/configure.in ]] ; then
@@ -57,6 +62,9 @@ src_prepare() {
5762
}
5863

5964
multilib_src_configure() {
65+
# The build system overrides user optimization level based on a configure flag. #886987
66+
local my_optlvl=$(get-flag '-O*')
67+
6068
# We use the standard BUILD_xxx but nspr uses HOST_xxx
6169
tc-export_build_env BUILD_CC
6270
export HOST_CC=${BUILD_CC} HOST_CFLAGS=${BUILD_CFLAGS} HOST_LDFLAGS=${BUILD_LDFLAGS}
@@ -65,11 +73,15 @@ multilib_src_configure() {
6573
&& export CROSS_COMPILE=1 \
6674
|| unset CROSS_COMPILE
6775

68-
local myconf=(
69-
--libdir="${EPREFIX}/usr/$(get_libdir)"
70-
$(use_enable debug)
71-
$(use_enable !debug optimize)
72-
)
76+
local myconf=( --libdir="${EPREFIX}/usr/$(get_libdir)" )
77+
78+
# Optimization is disabled when debug is enabled.
79+
if use debug; then
80+
myconf+=( --enable-debug )
81+
else
82+
myconf+=( --disable-debug )
83+
myconf+=( --enable-optimize="${my_optlvl}" )
84+
fi
7385

7486
# The configure has some fancy --enable-{{n,x}32,64bit} switches
7587
# that trigger some code conditional to platform & arch. This really
@@ -102,6 +114,37 @@ multilib_src_configure() {
102114
econf "${myconf[@]}"
103115
}
104116

117+
multilib_src_test() {
118+
# https://firefox-source-docs.mozilla.org/nspr/running_nspr_tests.html
119+
cd "${BUILD_DIR}/pr/tests" || die
120+
einfo "Building tests"
121+
emake
122+
123+
einfo "Running test suite"
124+
../../../${P}/${PN}/pr/tests/runtests.pl | tee "${T}"/${ABI}-tests.log
125+
126+
# Needed to check if runtests.pl itself or the tee (somehow) failed
127+
# (can't use die with pipes to check each component)
128+
[[ ${PIPESTATUS[@]} == "0 0" ]] || die "Tests failed to run!"
129+
130+
local known_failures=(
131+
# network-sandbox related?
132+
cltsrv
133+
# network-sandbox related?
134+
gethost
135+
)
136+
137+
local known_failure
138+
for known_failure in "${known_failures[@]}" ; do
139+
sed -i -e "/${known_failure}.*FAILED/d" "${T}"/${ABI}-tests.log || die
140+
done
141+
142+
# But to actually check the test results, we examine the log.
143+
if grep -q "FAILED" "${T}"/${ABI}-tests.log ; then
144+
die "Test failure for ${ABI}!"
145+
fi
146+
}
147+
105148
multilib_src_install() {
106149
# Their build system is royally confusing, as usual
107150
MINOR_VERSION=${MIN_PV} # Used for .so version

0 commit comments

Comments
 (0)