Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-embedded/picp/, dev-embedded/picp/files/
Date: Wed, 16 Sep 2020 18:19:25
Message-Id: 1600280283.714471c19ab313808e0d2c8ac44217fdbbcfd665.soap@gentoo
1 commit: 714471c19ab313808e0d2c8ac44217fdbbcfd665
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 16 18:18:03 2020 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 16 18:18:03 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=714471c1
7
8 dev-embedded/picp: Port to EAPI 7
9
10 Closes: https://bugs.gentoo.org/722590
11 Closes: https://bugs.gentoo.org/742197
12 Package-Manager: Portage-3.0.7, Repoman-3.0.1
13 Signed-off-by: David Seifert <soap <AT> gentoo.org>
14
15 .../picp/files/picp-0.6.8-C99-stdbool.patch | 83 +++++++++++++++++++++
16 dev-embedded/picp/files/picp-0.6.8-makefile.patch | 87 ++++++++++++++++++++++
17 dev-embedded/picp/picp-0.6.8.ebuild | 43 ++++++-----
18 3 files changed, 196 insertions(+), 17 deletions(-)
19
20 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
21 new file mode 100644
22 index 00000000000..f458a567462
23 --- /dev/null
24 +++ b/dev-embedded/picp/files/picp-0.6.8-C99-stdbool.patch
25 @@ -0,0 +1,83 @@
26 +--- a/atoi_base.h
27 ++++ b/atoi_base.h
28 +@@ -17,6 +17,8 @@
29 + #ifndef __ATOI_BASE_H_
30 + #define __ATOI_BASE_H_
31 +
32 ++#include <stdbool.h>
33 ++
34 + #ifdef WIN32
35 + #define bool int
36 + #endif
37 +--- a/parse.h
38 ++++ b/parse.h
39 +@@ -17,6 +17,8 @@
40 + #ifndef __PARSE_H_
41 + #define __PARSE_H_
42 +
43 ++#include <stdbool.h>
44 ++
45 + bool GetNextByte(FILE *theFile, unsigned int *address, unsigned char *data);
46 + void InitParse();
47 +
48 +--- a/picsnoop/dos/serial.h
49 ++++ b/picsnoop/dos/serial.h
50 +@@ -2,7 +2,7 @@
51 + #ifndef __SERIAL_H_
52 + #define __SERIAL_H_
53 +
54 +-#define bool int
55 ++#include <stdbool.h>
56 +
57 + #define KEYINT int86(0x16, &regs, &regs)
58 + #define KBHEAD 0x41a
59 +@@ -10,15 +10,12 @@
60 +
61 +
62 + #ifndef FALSE
63 +-#define FALSE 0
64 ++#define FALSE false
65 + #endif
66 + #ifndef TRUE
67 +-#define TRUE 1
68 ++#define TRUE true
69 + #endif
70 +
71 +-#define false FALSE
72 +-#define true TRUE
73 +-
74 + #define INUM1 12 // interrupt vector for com1
75 + #define INUM2 11 // interrupt vector for com2
76 +
77 +--- a/picsnoop/serial.h
78 ++++ b/picsnoop/serial.h
79 +@@ -2,6 +2,8 @@
80 + #ifndef __SERIAL_H_
81 + #define __SERIAL_H_
82 +
83 ++#include <stdbool.h>
84 ++
85 + #ifdef WIN32
86 + #define bool int
87 + #endif
88 +--- a/record.c
89 ++++ b/record.c
90 +@@ -49,6 +49,7 @@
91 + //-----------------------------------------------------------------------------
92 +
93 + #include <stdio.h>
94 ++#include <stdbool.h>
95 +
96 + #ifdef WIN32
97 + #include <windows.h>
98 +--- a/serial.h
99 ++++ b/serial.h
100 +@@ -17,6 +17,8 @@
101 + #ifndef __SERIAL_H_
102 + #define __SERIAL_H_
103 +
104 ++#include <stdbool.h>
105 ++
106 + #ifdef WIN32
107 + #define bool int
108 + #endif
109
110 diff --git a/dev-embedded/picp/files/picp-0.6.8-makefile.patch b/dev-embedded/picp/files/picp-0.6.8-makefile.patch
111 new file mode 100644
112 index 00000000000..7bad31af4d8
113 --- /dev/null
114 +++ b/dev-embedded/picp/files/picp-0.6.8-makefile.patch
115 @@ -0,0 +1,87 @@
116 +--- a/fixchksum/Makefile
117 ++++ b/fixchksum/Makefile
118 +@@ -2,11 +2,9 @@
119 + # Makefile for fixchksum
120 + #
121 +
122 +-CC=gcc
123 + APP=fixchksum
124 +-INCLUDES=-I.
125 +-OPTIONS=-O2 -Wall
126 +-CFLAGS=$(INCLUDES) $(OPTIONS)
127 ++CPPFLAGS+=-I.
128 ++CFLAGS+=-Wall -std=gnu99
129 + SRCS=fixchksum.c
130 + OBJECTS = fixchksum.o
131 +
132 +@@ -17,10 +15,6 @@
133 +
134 + all: $(APP)
135 +
136 +-$(APP): $(OBJECTS)
137 +- $(CC) $(OBJECTS) -o $(APP)
138 +- strip $(APP)
139 +-
140 + clean:
141 + rm -f $(APP).o
142 + rm -f $(APP)
143 +--- a/Makefile
144 ++++ b/Makefile
145 +@@ -3,11 +3,9 @@
146 + # PIC programmer interface
147 + #
148 +
149 +-CC=gcc
150 + APP=picp
151 +-INCLUDES=-I.
152 +-OPTIONS=-O2 -Wall -x c++
153 +-CFLAGS=$(INCLUDES) $(OPTIONS)
154 ++CPPFLAGS+=-I.
155 ++CFLAGS+=-Wall -std=gnu99
156 + SRCS=main.c serial.c record.c parse.c atoi_base.c
157 + OBJECTS = main.o serial.o record.o parse.o atoi_base.o
158 +
159 +@@ -19,16 +17,7 @@
160 + all: $(APP) convert convertshort
161 +
162 + $(APP): $(OBJECTS)
163 +- $(CC) $(OBJECTS) -lstdc++ -o $(APP)
164 +- strip $(APP)
165 +-
166 +-convert: convert.c
167 +- $(CC) -O2 -Wall -o convert convert.c
168 +- strip convert
169 +-
170 +-convertshort: convertshort.c
171 +- $(CC) -O2 -Wall -o convertshort convertshort.c
172 +- strip convertshort
173 ++ $(CC) $(LDFLAGS) $(OBJECTS) -o $(APP)
174 +
175 + clean:
176 + rm -f *.o
177 +--- a/picsnoop/Makefile
178 ++++ b/picsnoop/Makefile
179 +@@ -3,12 +3,9 @@
180 + #
181 +
182 + APP=picsnoop
183 +-CC=gcc
184 +
185 +-INCLUDES=
186 +-OPTIONS=-O2 -Wall -x c++
187 +-CFLAGS=$(INCLUDES) $(OPTIONS)
188 +-OBJECTS = picsnoop.o serial.o
189 ++CFLAGS+=-Wall -std=gnu99
190 ++OBJECTS = serial.o
191 +
192 + WINCC=/usr/local/cross-tools/bin/i386-mingw32msvc-gcc
193 + WINCFLAGS=-Wall -O2 -fomit-frame-pointer -s -I/usr/local/cross-tools/include -D_WIN32 -DWIN32
194 +@@ -18,8 +15,6 @@
195 + all : $(APP)
196 +
197 + $(APP) : $(OBJECTS)
198 +- $(CC) $(OBJECTS) -lstdc++ -o $(APP)
199 +- strip $(APP)
200 +
201 + clean :
202 + rm -f *.o
203
204 diff --git a/dev-embedded/picp/picp-0.6.8.ebuild b/dev-embedded/picp/picp-0.6.8.ebuild
205 index 9957ee011e3..491f48e7982 100644
206 --- a/dev-embedded/picp/picp-0.6.8.ebuild
207 +++ b/dev-embedded/picp/picp-0.6.8.ebuild
208 @@ -1,9 +1,9 @@
209 -# Copyright 1999-2014 Gentoo Foundation
210 +# Copyright 1999-2020 Gentoo Authors
211 # Distributed under the terms of the GNU General Public License v2
212
213 -EAPI=4
214 +EAPI=7
215
216 -inherit toolchain-funcs eutils
217 +inherit toolchain-funcs
218
219 DESCRIPTION="A commandline interface to Microchip's PICSTART+ programmer"
220 HOMEPAGE="http://home.pacbell.net/theposts/picmicro/"
221 @@ -12,30 +12,39 @@ SRC_URI="http://home.pacbell.net/theposts/picmicro/${P}.tar.gz"
222 LICENSE="GPL-2"
223 SLOT="0"
224 KEYWORDS="~amd64 x86"
225 -IUSE=""
226 +
227 +PATCHES=(
228 + "${FILESDIR}"/${P}-makefile.patch
229 + "${FILESDIR}"/${P}-errno.patch
230 + "${FILESDIR}"/${P}-C99-stdbool.patch
231 +)
232
233 src_prepare() {
234 - sed -i -e '/strip/d' \
235 - -e 's:$(CC):\0 $(LDFLAGS):' \
236 - {.,fixchksum,picsnoop}/Makefile || die "sed failed"
237 + default
238
239 - rm -f picsnoop/{picsnoop,*.o}
240 + # remove stale binaries
241 + rm picsnoop/{picsnoop,*.o} || die
242 +}
243
244 - epatch "${FILESDIR}"/${P}-errno.patch
245 +src_configure() {
246 + tc-export CC
247 }
248
249 src_compile() {
250 - emake CC=$(tc-getCC) OPTIONS="${CFLAGS} -x c++"
251 - emake -C picsnoop CC=$(tc-getCC) OPTIONS="${CFLAGS} -x c++"
252 - emake -C fixchksum CC=$(tc-getCC) OPTIONS="${CFLAGS}"
253 + emake
254 + emake -C picsnoop
255 + emake -C fixchksum
256 }
257
258 src_install() {
259 - dobin picp
260 - dobin picsnoop/picsnoop
261 - dobin fixchksum/fixchksum
262 - dodoc README HISTORY LICENSE.TXT NOTES PSCOMMANDS.TXT BugReports.txt TODO
263 + dobin picp picsnoop/picsnoop fixchksum/fixchksum
264 +
265 + einstalldocs
266 + dodoc BugReports.txt HISTORY LICENSE.TXT NOTES PSCOMMANDS.TXT
267 +
268 newdoc picsnoop/README.TXT PICSNOOP.txt
269 newdoc fixchksum/README fixchksum.txt
270 - dohtml PICPmanual.html
271 +
272 + docinto html
273 + dodoc PICPmanual.html
274 }