From d5bbebb2f77ae0704b6c457f60ae45822771fa21 Mon Sep 17 00:00:00 2001 From: Nathaniel Barragan Date: Sat, 7 Dec 2019 04:19:27 -0800 Subject: [PATCH] New package: cc65-2.18 --- srcpkgs/cc65/template | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 srcpkgs/cc65/template diff --git a/srcpkgs/cc65/template b/srcpkgs/cc65/template new file mode 100644 index 00000000000..c398a02137e --- /dev/null +++ b/srcpkgs/cc65/template @@ -0,0 +1,39 @@ +# Template file for 'cc65' +pkgname=cc65 +version=2.18 +revision=1 +short_desc="Freeware C compiler for 6502 based systems" +maintainer="Nathaniel Barragan " +license="Zlib" +homepage="https://cc65.github.io/" +distfiles="https://github.com/cc65/cc65/archive/V${version}.tar.gz" +checksum=d14a22fb87c7bcbecd8a83d5362d5d317b19c6ce2433421f2512f28293a6eaab + +pre_build() { + vsed -i src/Makefile -e 's/CC =/CC ?=/' -e 's/AR =/AR ?=/' +} + +do_build() { + if [[ $CROSS_BUILD != "" ]]; then + triple=$(echo $XBPS_CROSS_BASE | sed -E "s/(\/.*\/)*//") + echo "Cross build detected. Using cross build method" + oldcflags=$CFLAGS + # We need to modify the CFLAGS to take out any architecture specific flags that are needed for cross compiling + CFLAGS=$(echo $CFLAGS | sed -e "s/-m\S*//" -e "s/-I\S*//") + make bin ${makejobs} PREFIX=/usr CC=gcc AR=ar + make lib ${makejobs} PREFIX=/usr + CFLAGS=$oldcflags + make -C src clean + make bin ${makejobs} PREFIX=/usr CROSS_COMPILE=$triple + else + make ${makejobs} PREFIX=/usr + fi +} + +do_install() { + make install DESTDIR=$PKGDESTDIR PREFIX=/usr +} + +post_install() { + vlicense LICENSE +}