pcc: merge pcc-libs template

to break cyclic dependdencies.
This commit is contained in:
Đoàn Trần Công Danh 2021-01-12 20:37:31 +07:00
parent 65924c6953
commit f36bb1af83
6 changed files with 69 additions and 48 deletions

1
srcpkgs/pcc-libs Symbolic link
View File

@ -0,0 +1 @@
pcc

View File

@ -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 <orphan@voidlinux.org>"
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
}

View File

@ -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@

View File

@ -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)

View File

@ -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 */

View File

@ -3,31 +3,75 @@ 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 <orphan@voidlinux.org>"
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=$_tmp install
cd $wrksrc/pcc-libs
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
}
}