public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-embedded/picp/, dev-embedded/picp/files/
@ 2020-09-16 18:19 David Seifert
  0 siblings, 0 replies; only message in thread
From: David Seifert @ 2020-09-16 18:19 UTC (permalink / raw
  To: gentoo-commits

commit:     714471c19ab313808e0d2c8ac44217fdbbcfd665
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 16 18:18:03 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed Sep 16 18:18:03 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=714471c1

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 <AT> gentoo.org>

 .../picp/files/picp-0.6.8-C99-stdbool.patch        | 83 +++++++++++++++++++++
 dev-embedded/picp/files/picp-0.6.8-makefile.patch  | 87 ++++++++++++++++++++++
 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 00000000000..f458a567462
--- /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, &regs, &regs)
+ #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 00000000000..7bad31af4d8
--- /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 9957ee011e3..491f48e7982 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
 }


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-16 18:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-16 18:19 [gentoo-commits] repo/gentoo:master commit in: dev-embedded/picp/, dev-embedded/picp/files/ David Seifert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox