Commit: 8293866825426568dff4901890754c97eb5366d8 Parent: 28dc12f8505085643bc368db5463c89ccd5a1ba5 Author: Randy Palamar Date: Tue, 19 Sep 2023 07:36:19 -0600 dev-lang/tcc: update to 0.9.28rc this also switches to using gentoo's ebuild but with +static Diffstat:
A | dev-lang/tcc/Manifest | | | 1 | + |
A | dev-lang/tcc/tcc-0.9.28_p20230917.ebuild | | | 93 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
D | sys-devel/tcc/Manifest | | | 1 | - |
D | sys-devel/tcc/tcc-0.9.27.ebuild | | | 26 | -------------------------- |
4 files changed, 94 insertions(+), 27 deletions(-)
diff --git a/dev-lang/tcc/Manifest b/dev-lang/tcc/Manifest @@ -0,0 +1 @@ +DIST tcc-0.9.28_p20230917.tar.gz 951475 BLAKE2B d17bb64ae5922e9826915167a5e71ff6884baebfe1bb587027652b0fe030ef2cec4e3d85d9f9d0152ee48549c5b3124823ecc3d949ea8fb096660bd46dc9537a SHA512 16bf5251e935a5831ec4936f235d3ce4a9029a3f69b85b3c30ff7b4b2c869f68970dedb1bdc23b365695cda83d58708952f3cbb6aaa0fce6d940385322f36fd7 diff --git a/dev-lang/tcc/tcc-0.9.28_p20230917.ebuild b/dev-lang/tcc/tcc-0.9.28_p20230917.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +MY_COMMIT="507fbacabdc91f5d138c1c992e7c9ad39277bc47" +DESCRIPTION="A very small C compiler for ix86/amd64" +HOMEPAGE="https://bellard.org/tcc/ https://repo.or.cz/tinycc.git/" + +if [[ ${PV} == *9999* ]]; then + EGIT_REPO_URI="https://repo.or.cz/r/tinycc.git" + inherit git-r3 +elif [[ ${PV} == *_p* ]] ; then + SRC_URI="https://repo.or.cz/tinycc.git/snapshot/${MY_COMMIT}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}"/tinycc-507fbac +else + SRC_URI="https://download.savannah.gnu.org/releases/tinycc/${P}.tar.bz2" +fi + +LICENSE="LGPL-2.1" +SLOT="0" +if [[ ${PV} != *9999* ]] ; then + KEYWORDS="~amd64 ~arm64 ~riscv ~x86 ~amd64-linux" +fi + +BDEPEND="dev-lang/perl" # doc generation +IUSE="+static test" +RESTRICT="!test? ( test )" + +src_prepare() { + default + + # Don't strip + sed -i \ + -e 's|$(INSTALL) -s|$(INSTALL)|' \ + -e 's|STRIP_yes = -s|STRIP_yes =|' \ + Makefile || die + + # Fix examples + sed -i -e '1{ + i#! /usr/bin/tcc -run + /^#!/d + }' examples/ex*.c || die + sed -i -e '1s/$/ -lX11/' examples/ex4.c || die + + # bug 888115 + sed -i -e "s|/usr/local/bin/tcc|/usr/bin/tcc|g" tcc-doc.texi || die + + # Fix texi2html invocation + sed -i -e 's/-number//' Makefile || die + sed -i -e 's/--sections//' Makefile || die +} + +src_configure() { + local libc + + use test && unset CFLAGS LDFLAGS # Tests run with CC=tcc etc, they will fail hard otherwise + # better fixes welcome, it feels wrong to hack the env like this + + use elibc_musl && libc=musl + + if use static; then + LDFLAGS="${LDFLAGS} -static" + fi + + # not autotools, so call configure directly + ./configure --cc="$(tc-getCC)" \ + $(use_enable static) \ + ${libc:+--config-${libc}} \ + --prefix="${EPREFIX}/usr" \ + --libdir="${EPREFIX}/usr/$(get_libdir)" \ + --docdir="${EPREFIX}/usr/share/doc/${PF}" +} + +src_compile() { + emake AR="$(tc-getAR)" LDFLAGS="${LDFLAGS}" +} + +src_test() { + # this is using tcc bits that don't know as-needed etc. + TCCFLAGS="" emake test +} + +src_install() { + emake DESTDIR="${D}" install + + dodoc Changelog README TODO VERSION + #dohtml tcc-doc.html + exeinto /usr/share/doc/${PF}/examples + doexe examples/ex*.c +} diff --git a/sys-devel/tcc/Manifest b/sys-devel/tcc/Manifest @@ -1 +0,0 @@ -DIST tcc-0.9.27.tar.bz2 634999 BLAKE2B 9a76dac9f54fa0b64a72e874cfec9a4bd9b938d244d064b2e76bd31acfb9e48fdbdb8895132634be1dee4302293405bf75606a6804c8178afa8fd30daa53b73a SHA512 835184292d97c07f0ff7b36ec550e855e649b04e23c7e2a1c706d223409eb60708dc1ae969f28eba45e56c8b96ae56936b93caf9d8a13ac5adf119014d5367a7 diff --git a/sys-devel/tcc/tcc-0.9.27.ebuild b/sys-devel/tcc/tcc-0.9.27.ebuild @@ -1,26 +0,0 @@ -EAPI=7 - -DESCRIPTION="A very small C compiler for ix86/amd64" -HOMEPAGE="http://bellard.org/tcc/" -SRC_URI="http://download.savannah.gnu.org/releases/tinycc/${P}.tar.bz2" - -LICENSE="LGPL-2.1" -SLOT="0" - -IUSE="+static" - -src_configure() { - if use static; then - LDFLAGS="${LDFLAGS} -static" - fi - - econf --extra-ldflags="${LDFLAGS}" \ - --prefix="${EPREFIX}${LOCAL_PREFIX}" \ - --config-musl \ - $(use_enable static) -} - -src_install() { - emake DESTDIR="${D}" install - einstalldocs -}