1 |
commit: cd447c2a8620458f170d749eaebc5f02f05c2fbc |
2 |
Author: Daniel Kenzelmann <gentoo <AT> k8n <DOT> de> |
3 |
AuthorDate: Sat Mar 17 13:00:48 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Mar 23 22:10:04 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd447c2a |
7 |
|
8 |
dev-libs/pigpio: initial pull request (v67) |
9 |
|
10 |
This is a new ebuild for the pigpio library |
11 |
( http://abyz.me.uk/rpi/pigpio/ ) |
12 |
Supports systemd and openrc start files and also optional python support |
13 |
currently needed Makefile patches will be reported/requested upstream |
14 |
|
15 |
Closes: https://bugs.gentoo.org/646570 |
16 |
Closes: https://github.com/gentoo/gentoo/pull/7484 |
17 |
|
18 |
dev-libs/pigpio/Manifest | 1 + |
19 |
dev-libs/pigpio/files/pigpio-67-makefile.patch | 64 ++++++++++++++++++++++++++ |
20 |
dev-libs/pigpio/files/pigpiod.confd | 4 ++ |
21 |
dev-libs/pigpio/files/pigpiod.initd | 7 +++ |
22 |
dev-libs/pigpio/files/pigpiod.systemd | 9 ++++ |
23 |
dev-libs/pigpio/metadata.xml | 12 +++++ |
24 |
dev-libs/pigpio/pigpio-67.ebuild | 40 ++++++++++++++++ |
25 |
7 files changed, 137 insertions(+) |
26 |
|
27 |
diff --git a/dev-libs/pigpio/Manifest b/dev-libs/pigpio/Manifest |
28 |
new file mode 100644 |
29 |
index 00000000000..ed15ca2500f |
30 |
--- /dev/null |
31 |
+++ b/dev-libs/pigpio/Manifest |
32 |
@@ -0,0 +1 @@ |
33 |
+DIST pigpio-67.tar.gz 369268 BLAKE2B a9d59369f5eed4b733e0e5c0e85013a132e55ff63a2393d79a3fb52d1fcb2513559d4dfeea84c4842d6281936b6e116bd81cd63e4542bbcffaf813ee356ee0d1 SHA512 9792f8402ee0dd204f4a975ab0513099a1fe3d398a28b766f412c08d7908e8e307de4cc92b2a2519b6484f15a043bd40008b7707486015c08bda5f97b1e7e00b |
34 |
|
35 |
diff --git a/dev-libs/pigpio/files/pigpio-67-makefile.patch b/dev-libs/pigpio/files/pigpio-67-makefile.patch |
36 |
new file mode 100644 |
37 |
index 00000000000..1df4475eb0a |
38 |
--- /dev/null |
39 |
+++ b/dev-libs/pigpio/files/pigpio-67-makefile.patch |
40 |
@@ -0,0 +1,64 @@ |
41 |
+--- a/Makefile 2018-03-21 19:51:11.711880972 +0100 |
42 |
++++ b/Makefile 2018-03-21 20:51:46.341684595 +0100 |
43 |
+@@ -9,6 +9,9 @@ |
44 |
+ STRIP = $(CROSS_PREFIX)strip |
45 |
+ SHLIB = $(CC) -shared |
46 |
+ STRIPLIB = $(STRIP) --strip-unneeded |
47 |
++LDCONFIG = ldconfig |
48 |
++PYTHON2 = $(shell type -P python2 || echo ':' 2> /dev/null) |
49 |
++PYTHON3 = $(shell type -P python3 || echo ':' 2> /dev/null) |
50 |
+ |
51 |
+ CFLAGS += -O3 -Wall -pthread |
52 |
+ |
53 |
+@@ -23,7 +26,7 @@ |
54 |
+ |
55 |
+ LIB = $(LIB1) $(LIB2) $(LIB3) |
56 |
+ |
57 |
+-ALL = $(LIB) x_pigpio x_pigpiod_if x_pigpiod_if2 pig2vcd pigpiod pigs |
58 |
++ALL = $(LIB) pig2vcd pigpiod pigs |
59 |
+ |
60 |
+ LL1 = -L. -lpigpio -pthread -lrt |
61 |
+ |
62 |
+@@ -64,22 +67,21 @@ |
63 |
+ $(CC) -o x_pigpiod_if2 x_pigpiod_if2.o $(LL3) |
64 |
+ |
65 |
+ pigpiod: pigpiod.o $(LIB1) |
66 |
+- $(CC) -o pigpiod pigpiod.o $(LL1) |
67 |
++ $(CC) $(CFLAGS) $(LDFLAGS) -o pigpiod pigpiod.o $(LL1) |
68 |
+ $(STRIP) pigpiod |
69 |
+ |
70 |
+ pigs: pigs.o command.o |
71 |
+- $(CC) -o pigs pigs.o command.o |
72 |
++ $(CC) $(CFLAGS) $(LDFLAGS) -o pigs pigs.o command.o |
73 |
+ $(STRIP) pigs |
74 |
+ |
75 |
+ pig2vcd: pig2vcd.o |
76 |
+- $(CC) -o pig2vcd pig2vcd.o |
77 |
++ $(CC) $(CFLAGS) $(LDFLAGS) -o pig2vcd pig2vcd.o |
78 |
+ $(STRIP) pig2vcd |
79 |
+ |
80 |
+ clean: |
81 |
+ rm -f *.o *.i *.s *~ $(ALL) |
82 |
+ |
83 |
+ install: $(ALL) |
84 |
+- install -m 0755 -d $(DESTDIR)/opt/pigpio/cgi |
85 |
+ install -m 0755 -d $(DESTDIR)$(includedir) |
86 |
+ install -m 0644 pigpio.h $(DESTDIR)$(includedir) |
87 |
+ install -m 0644 pigpiod_if.h $(DESTDIR)$(includedir) |
88 |
+@@ -92,13 +94,13 @@ |
89 |
+ install -m 0755 pig2vcd $(DESTDIR)$(bindir) |
90 |
+ install -m 0755 pigpiod $(DESTDIR)$(bindir) |
91 |
+ install -m 0755 pigs $(DESTDIR)$(bindir) |
92 |
+- if which python2; then python2 setup.py install; fi |
93 |
+- if which python3; then python3 setup.py install; fi |
94 |
++ $(PYTHON2) setup.py install |
95 |
++ $(PYTHON3) setup.py install |
96 |
+ install -m 0755 -d $(DESTDIR)$(mandir)/man1 |
97 |
+ install -m 0644 *.1 $(DESTDIR)$(mandir)/man1 |
98 |
+ install -m 0755 -d $(DESTDIR)$(mandir)/man3 |
99 |
+ install -m 0644 *.3 $(DESTDIR)$(mandir)/man3 |
100 |
+- ldconfig |
101 |
++ $(LDCONFIG) |
102 |
+ |
103 |
+ uninstall: |
104 |
+ rm -f $(DESTDIR)$(includedir)/pigpio.h |
105 |
|
106 |
diff --git a/dev-libs/pigpio/files/pigpiod.confd b/dev-libs/pigpio/files/pigpiod.confd |
107 |
new file mode 100644 |
108 |
index 00000000000..dbcf8a4c3ef |
109 |
--- /dev/null |
110 |
+++ b/dev-libs/pigpio/files/pigpiod.confd |
111 |
@@ -0,0 +1,4 @@ |
112 |
+# Only listen on local interface by default |
113 |
+# use evironment variables PIGPIO_PORT="8888" and PIGPIO_ADDR="::1" for pigs with local interface |
114 |
+# PIGPIOD_OPTS="-l -p 8888" |
115 |
+PIGPIOD_OPTS="-l" |
116 |
|
117 |
diff --git a/dev-libs/pigpio/files/pigpiod.initd b/dev-libs/pigpio/files/pigpiod.initd |
118 |
new file mode 100644 |
119 |
index 00000000000..2b3f339dbdc |
120 |
--- /dev/null |
121 |
+++ b/dev-libs/pigpio/files/pigpiod.initd |
122 |
@@ -0,0 +1,7 @@ |
123 |
+#!/sbin/openrc-run |
124 |
+# Copyright 1999-2018 Gentoo Foundation |
125 |
+# Distributed under the terms of the GNU General Public License v2 |
126 |
+ |
127 |
+pidfile="/var/run/pigpio.pid" |
128 |
+command="/usr/bin/pigpiod" |
129 |
+command_args="${PIGPIOD_OPTS}" |
130 |
|
131 |
diff --git a/dev-libs/pigpio/files/pigpiod.systemd b/dev-libs/pigpio/files/pigpiod.systemd |
132 |
new file mode 100644 |
133 |
index 00000000000..b1d28a66f82 |
134 |
--- /dev/null |
135 |
+++ b/dev-libs/pigpio/files/pigpiod.systemd |
136 |
@@ -0,0 +1,9 @@ |
137 |
+[Unit] |
138 |
+Description=Pigpio daemon |
139 |
+ |
140 |
+[Service] |
141 |
+Type=simple |
142 |
+ExecStart=/usr/bin/pigpiod |
143 |
+ |
144 |
+[Install] |
145 |
+WantedBy=multi-user.target |
146 |
|
147 |
diff --git a/dev-libs/pigpio/metadata.xml b/dev-libs/pigpio/metadata.xml |
148 |
new file mode 100644 |
149 |
index 00000000000..9344dda7b30 |
150 |
--- /dev/null |
151 |
+++ b/dev-libs/pigpio/metadata.xml |
152 |
@@ -0,0 +1,12 @@ |
153 |
+<?xml version="1.0" encoding="UTF-8"?> |
154 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
155 |
+<pkgmetadata> |
156 |
+ <maintainer type="person"> |
157 |
+ <email>gentoo@×××.de</email> |
158 |
+ <name>Daniel Kenzelmann</name> |
159 |
+ </maintainer> |
160 |
+ <maintainer type="project"> |
161 |
+ <email>proxy-maint@g.o</email> |
162 |
+ <name>Gentoo Proxy Maintainers Project</name> |
163 |
+ </maintainer> |
164 |
+</pkgmetadata> |
165 |
|
166 |
diff --git a/dev-libs/pigpio/pigpio-67.ebuild b/dev-libs/pigpio/pigpio-67.ebuild |
167 |
new file mode 100644 |
168 |
index 00000000000..1975d0a2cf3 |
169 |
--- /dev/null |
170 |
+++ b/dev-libs/pigpio/pigpio-67.ebuild |
171 |
@@ -0,0 +1,40 @@ |
172 |
+# Copyright 1999-2018 Gentoo Foundation |
173 |
+# Distributed under the terms of the GNU General Public License v2 |
174 |
+ |
175 |
+EAPI=6 |
176 |
+ |
177 |
+PYTHON_COMPAT=( python{2_7,3_{4,5,6}} ) |
178 |
+ |
179 |
+inherit distutils-r1 systemd toolchain-funcs |
180 |
+ |
181 |
+DESCRIPTION="A library for the Raspberry which allows control of the GPIOs" |
182 |
+HOMEPAGE="http://abyz.me.uk/rpi/pigpio/index.html" |
183 |
+SRC_URI="https://github.com/joan2937/pigpio/archive/V${PV}.tar.gz -> ${P}.tar.gz" |
184 |
+ |
185 |
+LICENSE="Unlicense" |
186 |
+SLOT="0" |
187 |
+KEYWORDS="~arm" |
188 |
+IUSE="python" |
189 |
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
190 |
+ |
191 |
+DEPEND="" |
192 |
+RDEPEND="${DEPEND}" |
193 |
+ |
194 |
+src_prepare() { |
195 |
+ eapply "${FILESDIR}/${P}-makefile.patch" |
196 |
+ eapply_user |
197 |
+} |
198 |
+ |
199 |
+src_compile() { |
200 |
+ emake CC="$(tc-getCC)" STRIP=: STRIPLIB=: SIZE=: |
201 |
+ use python && distutils-r1_src_compile |
202 |
+} |
203 |
+ |
204 |
+src_install() { |
205 |
+ emake DESTDIR="${D}" LDCONFIG=: PYTHON2=: PYTHON3=: libdir="$(get_libdir)" prefix="/usr" mandir="/usr/share/man" install |
206 |
+ einstalldocs |
207 |
+ newinitd "${FILESDIR}"/pigpiod.initd pigpiod |
208 |
+ newconfd "${FILESDIR}"/pigpiod.confd pigpiod |
209 |
+ systemd_newunit "${FILESDIR}"/pigpiod.systemd pigpiod.service |
210 |
+ use python && distutils-r1_src_install |
211 |
+} |