Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/nspr/
Date: Thu, 26 May 2022 06:36:42
Message-Id: 1653546993.ebe79f36d88271da3557eb63f94c22ce89381fb3.juippis@gentoo
1 commit: ebe79f36d88271da3557eb63f94c22ce89381fb3
2 Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 26 06:24:42 2022 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu May 26 06:36:33 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ebe79f36
7
8 dev-libs/nspr: add 4.34
9
10 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
11
12 dev-libs/nspr/Manifest | 1 +
13 dev-libs/nspr/nspr-4.34.ebuild | 124 +++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 125 insertions(+)
15
16 diff --git a/dev-libs/nspr/Manifest b/dev-libs/nspr/Manifest
17 index 658056250be5..154a8b995391 100644
18 --- a/dev-libs/nspr/Manifest
19 +++ b/dev-libs/nspr/Manifest
20 @@ -1 +1,2 @@
21 DIST nspr-4.33.tar.gz 1078948 BLAKE2B b46e1c02ab7e5c442288a2cba2868166adb9461950d35fcd76074e3340734057f2b1bbeb3c700f38edf3710323ffd34576dd644814c379033de2a380c54d4fe3 SHA512 8064f826c977f1302a341ca7a7aaf7977b5d10102062c030b1d42b856638e3408ab262447e8c7cfd5a98879b9b1043d17ceae66fbb1e5ed86d6bc3531f26667e
22 +DIST nspr-4.34.tar.gz 1096407 BLAKE2B 61199c1319578570f9569011a2fea8ec6b8c4e8337b03517d1b0e1a22749a7449feb2152c348f3a1d73fefa7aa5067be460f4cbc1728c479309f4a2592424fdf SHA512 4cfac886c14cf7df4c4b79fa1c3bc92e1b14260c9c3018fa2562060d62fecb4e66c0b4e8f7edf4f4823def784a919d99dde88a89674f0cd8a644310b0569ead4
23
24 diff --git a/dev-libs/nspr/nspr-4.34.ebuild b/dev-libs/nspr/nspr-4.34.ebuild
25 new file mode 100644
26 index 000000000000..62e73fc0c568
27 --- /dev/null
28 +++ b/dev-libs/nspr/nspr-4.34.ebuild
29 @@ -0,0 +1,124 @@
30 +# Copyright 1999-2022 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=8
34 +
35 +inherit autotools toolchain-funcs multilib-minimal
36 +
37 +MIN_PV="$(ver_cut 2)"
38 +
39 +DESCRIPTION="Netscape Portable Runtime"
40 +HOMEPAGE="https://www.mozilla.org/projects/nspr/"
41 +SRC_URI="https://archive.mozilla.org/pub/nspr/releases/v${PV}/src/${P}.tar.gz"
42 +
43 +LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
44 +SLOT="0"
45 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris ~x86-solaris"
46 +IUSE="debug"
47 +
48 +MULTILIB_CHOST_TOOLS=(
49 + /usr/bin/nspr-config
50 +)
51 +
52 +PATCHES=(
53 + "${FILESDIR}"/${PN}-4.23-prtime.patch
54 + "${FILESDIR}"/${PN}-4.7.1-solaris.patch
55 + "${FILESDIR}"/${PN}-4.10.6-solaris.patch
56 + "${FILESDIR}"/${PN}-4.8.4-darwin-install_name.patch
57 + "${FILESDIR}"/${PN}-4.8.9-link-flags.patch
58 + # We do not need to pass -L$libdir via nspr-config --libs
59 + "${FILESDIR}"/${PN}-4.9.5_nspr_config.patch
60 + "${FILESDIR}"/${PN}-4.33-loong.patch
61 +)
62 +
63 +src_prepare() {
64 + cd "${S}"/nspr || die
65 +
66 + default
67 +
68 + use elibc_musl && eapply "${FILESDIR}"/${PN}-4.21-ipv6-musl-support.patch
69 +
70 + # rename configure.in to configure.ac for new autotools compatibility
71 + if [[ -e "${S}"/nspr/configure.in ]] ; then
72 + einfo "Renaming configure.in to configure.ac"
73 + mv "${S}"/nspr/configure.{in,ac} || die
74 + else
75 + elog "configure.in rename logic can be removed from ebuild."
76 + fi
77 +
78 + # We must run eautoconf to regenerate configure
79 + eautoconf
80 +
81 + # make sure it won't find Perl out of Prefix
82 + sed -i -e "s/perl5//g" "${S}"/nspr/configure || die
83 +
84 + # Respect LDFLAGS
85 + sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \
86 + "${S}"/nspr/config/rules.mk || die
87 +}
88 +
89 +multilib_src_configure() {
90 + # We use the standard BUILD_xxx but nspr uses HOST_xxx
91 + tc-export_build_env BUILD_CC
92 + export HOST_CC=${BUILD_CC} HOST_CFLAGS=${BUILD_CFLAGS} HOST_LDFLAGS=${BUILD_LDFLAGS}
93 + tc-export AR AS CC CXX RANLIB
94 + [[ ${CBUILD} != ${CHOST} ]] \
95 + && export CROSS_COMPILE=1 \
96 + || unset CROSS_COMPILE
97 +
98 + local myconf=(
99 + --libdir="${EPREFIX}/usr/$(get_libdir)"
100 + $(use_enable debug)
101 + $(use_enable !debug optimize)
102 + )
103 +
104 + # The configure has some fancy --enable-{{n,x}32,64bit} switches
105 + # that trigger some code conditional to platform & arch. This really
106 + # matters for the few common arches (x86, ppc) but we pass a little
107 + # more of them to be future-proof.
108 +
109 + # use ABI first, this will work for most cases
110 + case "${ABI}" in
111 + alpha|arm|hppa|m68k|o32|ppc|s390|sh|sparc|x86) ;;
112 + n32) myconf+=( --enable-n32 );;
113 + x32) myconf+=( --enable-x32 );;
114 + s390x|*64) myconf+=( --enable-64bit );;
115 + default) # no abi actually set, fall back to old check
116 + einfo "Running a short build test to determine 64bit'ness"
117 + echo > "${T}"/test.c || die
118 + ${CC} ${CFLAGS} ${CPPFLAGS} -c "${T}"/test.c -o "${T}"/test.o || die
119 + case $(file "${T}"/test.o) in
120 + *32-bit*x86-64*) myconf+=( --enable-x32 );;
121 + *64-bit*|*ppc64*|*x86_64*) myconf+=( --enable-64bit );;
122 + *32-bit*|*ppc*|*i386*) ;;
123 + *) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
124 + esac ;;
125 + *) ;;
126 + esac
127 +
128 + # Ancient autoconf needs help finding the right tools.
129 + LC_ALL="C" ECONF_SOURCE="${S}/nspr" \
130 + ac_cv_path_AR="${AR}" \
131 + ac_cv_path_AS="${AS}" \
132 + econf "${myconf[@]}"
133 +}
134 +
135 +multilib_src_install() {
136 + # Their build system is royally confusing, as usual
137 + MINOR_VERSION=${MIN_PV} # Used for .so version
138 + emake DESTDIR="${D}" install
139 +
140 + einfo "removing static libraries as upstream has requested!"
141 + rm "${ED}"/usr/$(get_libdir)/*.a || die "failed to remove static libraries."
142 +
143 + # install nspr-config
144 + dobin config/nspr-config
145 +
146 + # Remove stupid files in /usr/bin
147 + rm "${ED}"/usr/bin/prerr.properties || die
148 +
149 + # This is used only to generate prerr.c and prerr.h at build time.
150 + # No other projects use it, and we don't want to depend on perl.
151 + # Talked to upstream and they agreed w/punting.
152 + rm "${ED}"/usr/bin/compile-et.pl || die
153 +}