diff options
author | David Seifert <soap@gentoo.org> | 2020-09-16 20:18:03 +0200 |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2020-09-16 20:18:03 +0200 |
commit | 714471c19ab313808e0d2c8ac44217fdbbcfd665 (patch) | |
tree | 8e937b7152a819bc73cbe209aaec72e72e0db553 /dev-embedded/picp | |
parent | dev-embedded/picasm: Port to EAPI 7 (diff) | |
download | gentoo-714471c19ab313808e0d2c8ac44217fdbbcfd665.tar.gz gentoo-714471c19ab313808e0d2c8ac44217fdbbcfd665.tar.bz2 gentoo-714471c19ab313808e0d2c8ac44217fdbbcfd665.zip |
dev-embedded/picp: Port to EAPI 7
Closes: https://bugs.gentoo.org/722590
Closes: https://bugs.gentoo.org/742197
Package-Manager: Portage-3.0.7, Repoman-3.0.1
Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'dev-embedded/picp')
-rw-r--r-- | dev-embedded/picp/files/picp-0.6.8-C99-stdbool.patch | 83 | ||||
-rw-r--r-- | dev-embedded/picp/files/picp-0.6.8-makefile.patch | 87 | ||||
-rw-r--r-- | dev-embedded/picp/picp-0.6.8.ebuild | 43 |
3 files changed, 196 insertions, 17 deletions
diff --git a/dev-embedded/picp/files/picp-0.6.8-C99-stdbool.patch b/dev-embedded/picp/files/picp-0.6.8-C99-stdbool.patch new file mode 100644 index 000000000000..f458a5674621 --- /dev/null +++ b/dev-embedded/picp/files/picp-0.6.8-C99-stdbool.patch @@ -0,0 +1,83 @@ +--- a/atoi_base.h ++++ b/atoi_base.h +@@ -17,6 +17,8 @@ + #ifndef __ATOI_BASE_H_ + #define __ATOI_BASE_H_ + ++#include <stdbool.h> ++ + #ifdef WIN32 + #define bool int + #endif +--- a/parse.h ++++ b/parse.h +@@ -17,6 +17,8 @@ + #ifndef __PARSE_H_ + #define __PARSE_H_ + ++#include <stdbool.h> ++ + bool GetNextByte(FILE *theFile, unsigned int *address, unsigned char *data); + void InitParse(); + +--- a/picsnoop/dos/serial.h ++++ b/picsnoop/dos/serial.h +@@ -2,7 +2,7 @@ + #ifndef __SERIAL_H_
+ #define __SERIAL_H_
+
+-#define bool int
++#include <stdbool.h>
+
+ #define KEYINT int86(0x16, ®s, ®s)
+ #define KBHEAD 0x41a
+@@ -10,15 +10,12 @@ +
+
+ #ifndef FALSE
+-#define FALSE 0
++#define FALSE false
+ #endif
+ #ifndef TRUE
+-#define TRUE 1
++#define TRUE true
+ #endif
+
+-#define false FALSE
+-#define true TRUE
+-
+ #define INUM1 12 // interrupt vector for com1
+ #define INUM2 11 // interrupt vector for com2
+
+--- a/picsnoop/serial.h ++++ b/picsnoop/serial.h +@@ -2,6 +2,8 @@ + #ifndef __SERIAL_H_ + #define __SERIAL_H_ + ++#include <stdbool.h> ++ + #ifdef WIN32 + #define bool int + #endif +--- a/record.c ++++ b/record.c +@@ -49,6 +49,7 @@ + //----------------------------------------------------------------------------- + + #include <stdio.h> ++#include <stdbool.h> + + #ifdef WIN32 + #include <windows.h> +--- a/serial.h ++++ b/serial.h +@@ -17,6 +17,8 @@ + #ifndef __SERIAL_H_ + #define __SERIAL_H_ + ++#include <stdbool.h> ++ + #ifdef WIN32 + #define bool int + #endif diff --git a/dev-embedded/picp/files/picp-0.6.8-makefile.patch b/dev-embedded/picp/files/picp-0.6.8-makefile.patch new file mode 100644 index 000000000000..7bad31af4d88 --- /dev/null +++ b/dev-embedded/picp/files/picp-0.6.8-makefile.patch @@ -0,0 +1,87 @@ +--- a/fixchksum/Makefile ++++ b/fixchksum/Makefile +@@ -2,11 +2,9 @@ + # Makefile for fixchksum + # + +-CC=gcc + APP=fixchksum +-INCLUDES=-I. +-OPTIONS=-O2 -Wall +-CFLAGS=$(INCLUDES) $(OPTIONS) ++CPPFLAGS+=-I. ++CFLAGS+=-Wall -std=gnu99 + SRCS=fixchksum.c + OBJECTS = fixchksum.o + +@@ -17,10 +15,6 @@ + + all: $(APP) + +-$(APP): $(OBJECTS) +- $(CC) $(OBJECTS) -o $(APP) +- strip $(APP) +- + clean: + rm -f $(APP).o + rm -f $(APP) +--- a/Makefile ++++ b/Makefile +@@ -3,11 +3,9 @@ + # PIC programmer interface + # + +-CC=gcc + APP=picp +-INCLUDES=-I. +-OPTIONS=-O2 -Wall -x c++ +-CFLAGS=$(INCLUDES) $(OPTIONS) ++CPPFLAGS+=-I. ++CFLAGS+=-Wall -std=gnu99 + SRCS=main.c serial.c record.c parse.c atoi_base.c + OBJECTS = main.o serial.o record.o parse.o atoi_base.o + +@@ -19,16 +17,7 @@ + all: $(APP) convert convertshort + + $(APP): $(OBJECTS) +- $(CC) $(OBJECTS) -lstdc++ -o $(APP) +- strip $(APP) +- +-convert: convert.c +- $(CC) -O2 -Wall -o convert convert.c +- strip convert +- +-convertshort: convertshort.c +- $(CC) -O2 -Wall -o convertshort convertshort.c +- strip convertshort ++ $(CC) $(LDFLAGS) $(OBJECTS) -o $(APP) + + clean: + rm -f *.o +--- a/picsnoop/Makefile ++++ b/picsnoop/Makefile +@@ -3,12 +3,9 @@ + # + + APP=picsnoop +-CC=gcc + +-INCLUDES= +-OPTIONS=-O2 -Wall -x c++ +-CFLAGS=$(INCLUDES) $(OPTIONS) +-OBJECTS = picsnoop.o serial.o ++CFLAGS+=-Wall -std=gnu99 ++OBJECTS = serial.o + + WINCC=/usr/local/cross-tools/bin/i386-mingw32msvc-gcc + WINCFLAGS=-Wall -O2 -fomit-frame-pointer -s -I/usr/local/cross-tools/include -D_WIN32 -DWIN32 +@@ -18,8 +15,6 @@ + all : $(APP) + + $(APP) : $(OBJECTS) +- $(CC) $(OBJECTS) -lstdc++ -o $(APP) +- strip $(APP) + + clean : + rm -f *.o diff --git a/dev-embedded/picp/picp-0.6.8.ebuild b/dev-embedded/picp/picp-0.6.8.ebuild index 9957ee011e31..491f48e79828 100644 --- a/dev-embedded/picp/picp-0.6.8.ebuild +++ b/dev-embedded/picp/picp-0.6.8.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=4 +EAPI=7 -inherit toolchain-funcs eutils +inherit toolchain-funcs DESCRIPTION="A commandline interface to Microchip's PICSTART+ programmer" HOMEPAGE="http://home.pacbell.net/theposts/picmicro/" @@ -12,30 +12,39 @@ SRC_URI="http://home.pacbell.net/theposts/picmicro/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 x86" -IUSE="" + +PATCHES=( + "${FILESDIR}"/${P}-makefile.patch + "${FILESDIR}"/${P}-errno.patch + "${FILESDIR}"/${P}-C99-stdbool.patch +) src_prepare() { - sed -i -e '/strip/d' \ - -e 's:$(CC):\0 $(LDFLAGS):' \ - {.,fixchksum,picsnoop}/Makefile || die "sed failed" + default - rm -f picsnoop/{picsnoop,*.o} + # remove stale binaries + rm picsnoop/{picsnoop,*.o} || die +} - epatch "${FILESDIR}"/${P}-errno.patch +src_configure() { + tc-export CC } src_compile() { - emake CC=$(tc-getCC) OPTIONS="${CFLAGS} -x c++" - emake -C picsnoop CC=$(tc-getCC) OPTIONS="${CFLAGS} -x c++" - emake -C fixchksum CC=$(tc-getCC) OPTIONS="${CFLAGS}" + emake + emake -C picsnoop + emake -C fixchksum } src_install() { - dobin picp - dobin picsnoop/picsnoop - dobin fixchksum/fixchksum - dodoc README HISTORY LICENSE.TXT NOTES PSCOMMANDS.TXT BugReports.txt TODO + dobin picp picsnoop/picsnoop fixchksum/fixchksum + + einstalldocs + dodoc BugReports.txt HISTORY LICENSE.TXT NOTES PSCOMMANDS.TXT + newdoc picsnoop/README.TXT PICSNOOP.txt newdoc fixchksum/README fixchksum.txt - dohtml PICPmanual.html + + docinto html + dodoc PICPmanual.html } |