From 0818ab9f232d39f4f1a7dc240d0bd955704ce684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 12 Jan 2021 20:37:31 +0700 Subject: [PATCH] pcc: merge pcc-libs template to break cyclic dependdencies. --- srcpkgs/pcc-libs | 1 + srcpkgs/pcc-libs/template | 24 ------ .../{pcc-libs => pcc}/patches/build_PIC.patch | 12 +-- srcpkgs/pcc/patches/void.patch | 4 +- srcpkgs/pcc/patches/x86-build-fix.patch | 4 +- srcpkgs/pcc/template | 73 +++++++++++++++---- 6 files changed, 70 insertions(+), 48 deletions(-) create mode 120000 srcpkgs/pcc-libs delete mode 100644 srcpkgs/pcc-libs/template rename srcpkgs/{pcc-libs => pcc}/patches/build_PIC.patch (64%) diff --git a/srcpkgs/pcc-libs b/srcpkgs/pcc-libs new file mode 120000 index 00000000000..0f083540766 --- /dev/null +++ b/srcpkgs/pcc-libs @@ -0,0 +1 @@ +pcc \ No newline at end of file diff --git a/srcpkgs/pcc-libs/template b/srcpkgs/pcc-libs/template deleted file mode 100644 index bca409786bd..00000000000 --- a/srcpkgs/pcc-libs/template +++ /dev/null @@ -1,24 +0,0 @@ -# Template file for 'pcc-libs' -pkgname=pcc-libs -_snapshot=20190420 -_distver=1.1.0 -version=${_distver}.${_snapshot} -revision=1 -archs="i686* x86_64*" -wrksrc=${pkgname}-${_distver}.BETA -build_style=gnu-configure -configure_args="CC=pcc" -hostmakedepends="flex pcc" -short_desc="Portable C Compiler - Support Libraries" -maintainer="Orphaned " -license="BSD-2-Clause" -homepage="http://pcc.ludd.ltu.se/" -distfiles="http://pcc.ludd.ltu.se/ftp/pub/pcc-beta/${pkgname}-${_distver}.BETA-${_snapshot}.tgz" -checksum=e810aa4d6683e769f490f734b13a296b33c2511ddba646bc526eb85532f1a23a -nodebug=1 -nocross=1 - -post_install() { - sed -n '2,25p' libpcc/cxmuldiv.c > LICENSE - vlicense LICENSE -} diff --git a/srcpkgs/pcc-libs/patches/build_PIC.patch b/srcpkgs/pcc/patches/build_PIC.patch similarity index 64% rename from srcpkgs/pcc-libs/patches/build_PIC.patch rename to srcpkgs/pcc/patches/build_PIC.patch index a11fcff6c3a..3b7eea6a13f 100644 --- a/srcpkgs/pcc-libs/patches/build_PIC.patch +++ b/srcpkgs/pcc/patches/build_PIC.patch @@ -1,7 +1,7 @@ Respect passed CFLAGS to configure and force PIC object generation. ---- csu/linux/Makefile.orig 2011-02-24 12:59:36.988078869 +0100 -+++ csu/linux/Makefile 2011-02-24 13:01:29.434007771 +0100 +--- pcc-libs/csu/linux/Makefile.orig 2011-02-24 12:59:36.988078869 +0100 ++++ pcc-libs/csu/linux/Makefile 2011-02-24 13:01:29.434007771 +0100 @@ -4,7 +4,7 @@ VERSION ?= 0.9.9 PCCLIBDIR ?= /usr/local/lib/pcc/$(TARGET)/$(VERSION)/lib SRCDIR ?= . @@ -11,8 +11,8 @@ Respect passed CFLAGS to configure and force PIC object generation. OBJS = crt0.o crt1.o gcrt1.o crti.o crtn.o crtbegin.o crtend.o ---- libpcc/Makefile.in.orig 2011-02-24 13:02:15.570566278 +0100 -+++ libpcc/Makefile.in 2011-02-24 13:02:33.577393664 +0100 +--- pcc-libs/libpcc/Makefile.in.orig 2011-02-24 13:02:15.570566278 +0100 ++++ pcc-libs/libpcc/Makefile.in 2011-02-24 13:02:33.577393664 +0100 @@ -12,6 +12,7 @@ exec_prefix = @exec_prefix@ libdir = @libdir@ @@ -21,8 +21,8 @@ Respect passed CFLAGS to configure and force PIC object generation. TARGMACH = @targmach@ TARGOS = @targos@ TARGET = @target@ ---- libsoftfloat/Makefile.in.orig 2011-02-24 13:02:54.937188695 +0100 -+++ libsoftfloat/Makefile.in 2011-02-24 13:03:09.281050924 +0100 +--- pcc-libs/libsoftfloat/Makefile.in.orig 2011-02-24 13:02:54.937188695 +0100 ++++ pcc-libs/libsoftfloat/Makefile.in 2011-02-24 13:03:09.281050924 +0100 @@ -12,6 +12,7 @@ exec_prefix = @exec_prefix@ libdir = @libdir@ diff --git a/srcpkgs/pcc/patches/void.patch b/srcpkgs/pcc/patches/void.patch index f38fbc8fded..beb390b8f1e 100644 --- a/srcpkgs/pcc/patches/void.patch +++ b/srcpkgs/pcc/patches/void.patch @@ -1,5 +1,5 @@ ---- os/linux/ccconfig.h.orig 2019-04-21 12:16:53.029059057 +0200 -+++ os/linux/ccconfig.h 2019-04-21 12:18:19.757287684 +0200 +--- pcc/os/linux/ccconfig.h.orig 2019-04-21 12:16:53.029059057 +0200 ++++ pcc/os/linux/ccconfig.h 2019-04-21 12:18:19.757287684 +0200 @@ -39,26 +39,31 @@ #if defined(mach_i386) diff --git a/srcpkgs/pcc/patches/x86-build-fix.patch b/srcpkgs/pcc/patches/x86-build-fix.patch index 2f4f376f1ce..3638bd37ac7 100644 --- a/srcpkgs/pcc/patches/x86-build-fix.patch +++ b/srcpkgs/pcc/patches/x86-build-fix.patch @@ -2,8 +2,8 @@ Fix x86 build failure: only use MULTIARCH_PATH if it's defined :-) --xtraeme ---- cc/cc/cc.c.orig 2014-12-18 14:57:43.961103113 +0100 -+++ cc/cc/cc.c 2014-12-18 14:57:52.881207162 +0100 +--- pcc/cc/cc/cc.c.orig 2014-12-18 14:57:43.961103113 +0100 ++++ pcc/cc/cc/cc.c 2014-12-18 14:57:52.881207162 +0100 @@ -207,9 +207,9 @@ char *cppmdadd[] = CPPMDADD; #endif #ifndef DEFLIBDIRS /* default library search paths */ diff --git a/srcpkgs/pcc/template b/srcpkgs/pcc/template index 718dcb7332d..62178bf99af 100644 --- a/srcpkgs/pcc/template +++ b/srcpkgs/pcc/template @@ -3,31 +3,76 @@ pkgname=pcc _snapshot=20190420 _distver=1.1.0 version=${_distver}.${_snapshot} -revision=2 -wrksrc=${pkgname}-${_distver}.BETA -build_style=gnu-configure +revision=3 +archs="i686* x86_64*" +create_wrksrc=yes configure_args="--enable-tls --enable-native" -hostmakedepends="flex" +hostmakedepends="flex bison" depends="binutils pcc-libs>=${version}" short_desc="Portable C Compiler" maintainer="Orphaned " -license="BSD-2-Clause" +license="BSD-2-Clause, BSD-3-Clause, MIT, BSD-4-Clause" homepage="http://pcc.ludd.ltu.se/" -distfiles="http://pcc.ludd.ltu.se/ftp/pub/pcc-beta/pcc-${_distver}.BETA-${_snapshot}.tgz" -checksum=a114dfca04b8b0559ea5d67b87d2d0fcb2bae2b4d9b9ba16ebc27960b921c812 -nocross=1 +distfiles=" + http://pcc.ludd.ltu.se/ftp/pub/pcc-beta/pcc-${_distver}.BETA-${_snapshot}.tgz + http://pcc.ludd.ltu.se/ftp/pub/pcc-beta/pcc-libs-${_distver}.BETA-${_snapshot}.tgz" +checksum="a114dfca04b8b0559ea5d67b87d2d0fcb2bae2b4d9b9ba16ebc27960b921c812 + e810aa4d6683e769f490f734b13a296b33c2511ddba646bc526eb85532f1a23a" +nocross=yes CFLAGS="-fcommon" -pre_configure() { - vsed -i '/GNUC_MINOR/s,3,1,g' cc/cc/cc.c cc/driver/platform.c +post_extract() { + mv pcc-${_distver}.BETA pcc + mv pcc-libs-${_distver}.BETA pcc-libs } -pre_build() { + +post_patch() { + vsed -i '/GNUC_MINOR/s,3,1,g' pcc/cc/cc/cc.c pcc/cc/driver/platform.c +} + +do_configure() { + cd $wrksrc/pcc + ./configure ${configure_args} --libexecdir=/usr/libexec/pcc + cd $wrksrc/pcc-libs + ./configure ${configure_args} CC=pcc +} + +do_build() { + local _tmp=$wrksrc/tmp + mkdir -p $_tmp/usr/bin + + PATH=$_tmp/usr/bin:$_tmp/usr/libexec/pcc:$PATH + cd $wrksrc/pcc cp common/*.[ch] mip + make ${makejobs} + make DESTDIR=$wrksrc/tmp install + cd $wrksrc/pcc-libs + PATH=$wrksrc/pcc/cc/cc:$PATH + make ${makejobs} } -post_install() { - sed -n '2,27p' arch/i386/code.c > LICENSE - vlicense LICENSE + +do_install() { + cd $wrksrc/pcc + make DESTDIR=$DESTDIR install + sed -n '3,27p' arch/amd64/code.c > LICENSE.3BSD + sed -n '3,25p' arch/amd64/local.c > LICENSE.2BSD + sed -n '3,25p' arch/arm/table.c > LICENSE.MIT + sed -n '3,33p' arch/i386/flocal.c > LICENSE.Caldera + cd $wrksrc/pcc-libs + make DESTDIR=$DESTDIR install # Rename conflicting cpp.1 manpage. mv ${DESTDIR}/usr/share/man/man1/{cpp,pcc-cpp}.1 } + +pcc-libs_package() { + short_desc+=" - libraries" + nodebug=yes + pkg_install() { + vmove usr/lib/pcc + vlicense pcc/LICENSE.3BSD + vlicense pcc/LICENSE.2BSD + vlicense pcc/LICENSE.MIT + vlicense pcc/LICENSE.Caldera + } +}