diff options
author | B. Watson <urchlay@slackware.uk> | 2023-08-16 03:00:46 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-08-19 09:15:33 +0700 |
commit | eb1a9b0c9cf3703c88eb76a76d663f75a8c55995 (patch) | |
tree | 799f9d9fc59e3b4a182708e553c24cd69bfe58a6 | |
parent | 04942805df0afd3d82fbe7d1794e94b1d06f451d (diff) |
development/tcc: Update for v0.9.27+20230811_d1c1077, new maint.
Signed-off-by: B. Watson <urchlay@slackware.uk>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | development/tcc/README | 14 | ||||
-rw-r--r-- | development/tcc/git2tarxz.sh | 42 | ||||
-rw-r--r-- | development/tcc/tcc.SlackBuild | 50 | ||||
-rw-r--r-- | development/tcc/tcc.info | 10 |
4 files changed, 81 insertions, 35 deletions
diff --git a/development/tcc/README b/development/tcc/README index 8ca2da690e9f..b646f335ad18 100644 --- a/development/tcc/README +++ b/development/tcc/README @@ -1,8 +1,16 @@ +tcc (Tiny C Compiler) + Tiny C Compiler is a very fast C compiler. Unlike other C compilers, -it is meant to be self-relying: you do not need an external -assembler or linker because TCC does that for you. +it is meant to be self-relying: you do not need an external assembler +or linker because TCC does that for you. + TCC supports ANSI C and most of ISO C99 and many GNUC extensions, including inline assembly. tcc was written by Fabrice Bellard and is distributed under the GNU Lesser General Public License. -In order to have cross compiler support, pass CROSS=yes to the script. +Currently, tcc development happens in the github repo at +https://github.com/TinyCC/tinycc + +By default, both native and cross compilers for various systems (Win32, +Win64, ARM, OSX, etc) are built. If you want to skip the cross +compilers, pass CROSS=no to the script. diff --git a/development/tcc/git2tarxz.sh b/development/tcc/git2tarxz.sh new file mode 100644 index 000000000000..bad13e8b98ef --- /dev/null +++ b/development/tcc/git2tarxz.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# Create source tarball from git repo, with generated version +# number. + +# Note that this script doesn't need to be run as root. It does +# need to be able to write to the current directory it's run from. + +# Takes one optional argument, which is the commit or tag to create +# a tarball of. With no arg, HEAD is used. + +PRGNAM=tcc +CLONE_URL=https://github.com/TinyCC/tinycc + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +GIT_SHA=$( git rev-parse --short HEAD ) +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) +VERSION=$( cat VERSION )+${DATE}_${GIT_SHA} + +rm -rf .git +find . -name .gitignore -print0 | xargs -0 rm -f + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR $PRGNAM-$VERSION +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=$VERSION" diff --git a/development/tcc/tcc.SlackBuild b/development/tcc/tcc.SlackBuild index ba4a94dcd11a..0faa04ae868d 100644 --- a/development/tcc/tcc.SlackBuild +++ b/development/tcc/tcc.SlackBuild @@ -25,6 +25,14 @@ # # Markus Reichelt, slackbuilds@mareichelt.de, 0xCCEEF115 # in memoriam of Georg Ohler +# Now maintained by B. Watson (urchlay@slackware.uk). + +# 20230815 bkw: +# - take over maintenance. +# - update for 0.9.27+20230811_d1c1077. +# - make CROSS=yes the default. +# - add TODO and USES to the doc dir. +# - mention github repo in README. # 20230627 bkw: Modified by SlackBuilds.org, BUILD=2: # - add doinst.sh and douninst.sh to manage /usr/info/dir. @@ -32,8 +40,8 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=tcc -VERSION=${VERSION:-20220221_308d8d1} -BUILD=${BUILD:-2} +VERSION=${VERSION:-0.9.27+20230811_d1c1077} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -45,9 +53,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -77,21 +82,16 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz cd $PRGNAM-$VERSION chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; - -if [ "$CROSS" = "yes" ]; then - OPT="--enable-cross" - else OPT="" -fi +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + + +[ "${CROSS:-yes}" = "yes" ] && CROSSOPT="--enable-cross" -mkdir -p $PKG/usr/bin $PKG/usr/man/man1 $PKG/usr/doc $PKG/usr/include +DOC=/usr/doc/$PRGNAM-$VERSION +PKGDOC=$PKG/$DOC CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -99,23 +99,19 @@ CXXFLAGS="$SLKCFLAGS" \ --prefix=/usr \ --sharedir=/usr \ --libdir=/usr/lib$LIBDIRSUFFIX \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ - $OPT + --docdir=$DOC \ + $CROSSOPT make make -j1 test make install DESTDIR=$PKG -find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true - -find $PKG/usr/man -type f -exec gzip -9 {} \; -for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done - +strip $PKG/usr/bin/* +gzip -9 $PKG/usr/man/man1/* gzip -9 $PKG/usr/info/*.info -cp -a README* Changelog* COPYING RELICENSING examples/ $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cp -a README* Changelog* COPYING RELICENSING TODO USES examples/ $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/development/tcc/tcc.info b/development/tcc/tcc.info index 93a388f4193e..d745794999e8 100644 --- a/development/tcc/tcc.info +++ b/development/tcc/tcc.info @@ -1,10 +1,10 @@ PRGNAM="tcc" -VERSION="20220221_308d8d1" +VERSION="0.9.27+20230811_d1c1077" HOMEPAGE="http://www.tinycc.org/" -DOWNLOAD="https://ponce.cc/slackware/sources/repo/tcc-20220221_308d8d1.tar.xz" -MD5SUM="51de1d1e70c73d07143338554332b227" +DOWNLOAD="https://slackware.uk/~urchlay/src/tcc-0.9.27+20230811_d1c1077.tar.xz" +MD5SUM="de548a69fba89a1e6d0712a9ddf2bdf9" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="Markus Reichelt" -EMAIL="slackbuilds@mareichelt.de" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" |