Gentoo Archives: gentoo-commits

From: Yixun Lan <dlan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/tcc/
Date: Fri, 03 Mar 2023 19:47:01
Message-Id: 1677872802.1d2a55131eb4ebb5e1f3703b9f9b99cf528287f5.dlan@gentoo
1 commit: 1d2a55131eb4ebb5e1f3703b9f9b99cf528287f5
2 Author: Nickolas Raymond Kaczynski <nrk <AT> disroot <DOT> org>
3 AuthorDate: Sat Feb 25 16:28:55 2023 +0000
4 Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 3 19:46:42 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d2a5513
7
8 dev-lang/tcc: add 20230223 snapshot
9
10 Closes: https://github.com/gentoo/gentoo/pull/29788
11 Signed-off-by: Nickolas Raymond Kaczynski <nrk <AT> disroot.org>
12 Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>
13
14 dev-lang/tcc/Manifest | 1 +
15 dev-lang/tcc/tcc-0.9.27_p20230223.ebuild | 88 ++++++++++++++++++++++++++++++++
16 2 files changed, 89 insertions(+)
17
18 diff --git a/dev-lang/tcc/Manifest b/dev-lang/tcc/Manifest
19 index 67b6967077d6..5d342ed19601 100644
20 --- a/dev-lang/tcc/Manifest
21 +++ b/dev-lang/tcc/Manifest
22 @@ -1 +1,2 @@
23 DIST tcc-0.9.27_p20211022.tar.gz 893631 BLAKE2B f1a82498db65a9944f04a6c35897db6ceeea0e5d14ac383acc6b334fb2aa921a0e7b4badf647c101d064ceae1ee8d79ab91674a2d0faa2899b831a57e6148174 SHA512 5f40a0d31d63e876d1fb233758d9f58be2f14807bbc0847b7df3eb6bb8df0946100b58edb5a29caea8770201d02275daf0a3ca7668141151e931204ad7100fb3
24 +DIST tcc-0.9.27_p20230223.tar.gz 944179 BLAKE2B a8f77baf53846987f15a9005e100f109458e89805f0a6c7daafa55f8c22e0b47ca034cd8332839ef2a9e5840baa963e8a9185aa7fe4640ff89e5225f5be201b1 SHA512 335e40229572fa2dad82485d357349e26f4c999ea6622d3d3caa4b8eef357b2c5b56f76565e98073e57691b9adc919ded88ff015f9a95a86ce453392938b42f4
25
26 diff --git a/dev-lang/tcc/tcc-0.9.27_p20230223.ebuild b/dev-lang/tcc/tcc-0.9.27_p20230223.ebuild
27 new file mode 100644
28 index 000000000000..c2d9231863d2
29 --- /dev/null
30 +++ b/dev-lang/tcc/tcc-0.9.27_p20230223.ebuild
31 @@ -0,0 +1,88 @@
32 +# Copyright 1999-2023 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +inherit toolchain-funcs
38 +
39 +MY_COMMIT="29ae3ed4d5b83eec43598d6cd7949bccb41c8083"
40 +DESCRIPTION="A very small C compiler for ix86/amd64"
41 +HOMEPAGE="https://bellard.org/tcc/ https://repo.or.cz/tinycc.git/"
42 +
43 +if [[ ${PV} == *9999* ]]; then
44 + EGIT_REPO_URI="https://repo.or.cz/r/tinycc.git"
45 + inherit git-r3
46 +elif [[ ${PV} == *_p* ]] ; then
47 + SRC_URI="https://repo.or.cz/tinycc.git/snapshot/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
48 + S="${WORKDIR}"/tinycc-29ae3ed
49 +else
50 + SRC_URI="https://download.savannah.gnu.org/releases/tinycc/${P}.tar.bz2"
51 +fi
52 +
53 +LICENSE="LGPL-2.1"
54 +SLOT="0"
55 +if [[ ${PV} != *9999* ]] ; then
56 + KEYWORDS="~amd64 ~arm64 ~riscv ~x86 ~amd64-linux"
57 +fi
58 +
59 +BDEPEND="dev-lang/perl" # doc generation
60 +IUSE="test"
61 +RESTRICT="!test? ( test )"
62 +
63 +src_prepare() {
64 + default
65 +
66 + # Don't strip
67 + sed -i \
68 + -e 's|$(INSTALL) -s|$(INSTALL)|' \
69 + -e 's|STRIP_yes = -s|STRIP_yes =|' \
70 + Makefile || die
71 +
72 + # Fix examples
73 + sed -i -e '1{
74 + i#! /usr/bin/tcc -run
75 + /^#!/d
76 + }' examples/ex*.c || die
77 + sed -i -e '1s/$/ -lX11/' examples/ex4.c || die
78 +
79 + # bug 888115
80 + sed -i -e "s|/usr/local/bin/tcc|/usr/bin/tcc|g" tcc-doc.texi || die
81 +
82 + # Fix texi2html invocation
83 + sed -i -e 's/-number//' Makefile || die
84 + sed -i -e 's/--sections//' Makefile || die
85 +}
86 +
87 +src_configure() {
88 + local libc
89 +
90 + use test && unset CFLAGS LDFLAGS # Tests run with CC=tcc etc, they will fail hard otherwise
91 + # better fixes welcome, it feels wrong to hack the env like this
92 +
93 + use elibc_musl && libc=musl
94 +
95 + # not autotools, so call configure directly
96 + ./configure --cc="$(tc-getCC)" \
97 + ${libc:+--config-${libc}} \
98 + --prefix="${EPREFIX}/usr" \
99 + --libdir="${EPREFIX}/usr/$(get_libdir)" \
100 + --docdir="${EPREFIX}/usr/share/doc/${PF}"
101 +}
102 +
103 +src_compile() {
104 + emake AR="$(tc-getAR)" LDFLAGS="${LDFLAGS}"
105 +}
106 +
107 +src_test() {
108 + # this is using tcc bits that don't know as-needed etc.
109 + TCCFLAGS="" emake test
110 +}
111 +
112 +src_install() {
113 + emake DESTDIR="${D}" install
114 +
115 + dodoc Changelog README TODO VERSION
116 + #dohtml tcc-doc.html
117 + exeinto /usr/share/doc/${PF}/examples
118 + doexe examples/ex*.c
119 +}