diff options
author | Dan McGregor <dan.mcgregor@usask.ca> | 2013-04-29 14:25:57 -0600 |
---|---|---|
committer | Andrei Gherzan <andrei@gherzan.ro> | 2013-11-12 18:37:23 +0200 |
commit | 298e28ff96b17b5f10b29918269c6b591ba9710c (patch) | |
tree | 040cdc45409412fc3859594b00637aedc0db3537 /recipes-devtools | |
parent | fef11f98cf62a9f21472a42382d1ebab37eee806 (diff) | |
download | meta-raspberrypi-298e28ff96b17b5f10b29918269c6b591ba9710c.tar.gz |
wiringpi: Add new package
Commit created from merging:
https://github.com/SaskatoonTechworks/meta-raspberrypi/commit/c8046050db1f0026c1f10e41d95619d86ac7a822
https://github.com/SaskatoonTechworks/meta-raspberrypi/commit/fe2467c0e82ff3d243993bdffde6a24754c3a7f6
https://github.com/SaskatoonTechworks/meta-raspberrypi/commit/72f7705cbac99b834654894b545d5fa431a13b51
Added some minor changes:
* remove PR
* remove tabs
Change-Id: Ia430db732e6c9662f71eca2433d03cce738ca23f
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Diffstat (limited to 'recipes-devtools')
-rw-r--r-- | recipes-devtools/wiringPi/files/Makefiles-install.patch | 202 | ||||
-rw-r--r-- | recipes-devtools/wiringPi/wiringpi_git.bb | 31 |
2 files changed, 233 insertions, 0 deletions
diff --git a/recipes-devtools/wiringPi/files/Makefiles-install.patch b/recipes-devtools/wiringPi/files/Makefiles-install.patch new file mode 100644 index 0000000..cd13064 --- /dev/null +++ b/recipes-devtools/wiringPi/files/Makefiles-install.patch | |||
@@ -0,0 +1,202 @@ | |||
1 | diff --git a/examples/Makefile b/examples/Makefile | ||
2 | index defd510..b84f3de 100644 | ||
3 | --- a/examples/Makefile | ||
4 | +++ b/examples/Makefile | ||
5 | @@ -26,10 +26,10 @@ | ||
6 | #DEBUG = -g -O0 | ||
7 | DEBUG = -O3 | ||
8 | CC = gcc | ||
9 | -INCLUDE = -I/usr/local/include | ||
10 | +INCLUDE = -I../wiringPi | ||
11 | CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
12 | |||
13 | -LDFLAGS = -L/usr/local/lib | ||
14 | +LDFLAGS = -L../wiringPi | ||
15 | LDLIBS = -lwiringPi -lpthread -lm | ||
16 | |||
17 | # Should not alter anything below this line | ||
18 | diff --git a/gpio/Makefile b/gpio/Makefile | ||
19 | index a043962..b1539d9 100644 | ||
20 | --- a/gpio/Makefile | ||
21 | +++ b/gpio/Makefile | ||
22 | @@ -23,13 +23,16 @@ | ||
23 | ################################################################################# | ||
24 | |||
25 | |||
26 | +DESTDIR?=/usr | ||
27 | +PREFIX?=/local | ||
28 | + | ||
29 | #DEBUG = -g -O0 | ||
30 | -DEBUG = -O2 | ||
31 | -CC = gcc | ||
32 | -INCLUDE = -I/usr/local/include | ||
33 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
34 | +DEBUG ?= -O2 | ||
35 | +CC ?= gcc | ||
36 | +INCLUDE ?= -I../wiringPi | ||
37 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
38 | |||
39 | -LDFLAGS = -L/usr/local/lib | ||
40 | +LDFLAGS ?= -L../wiringPi | ||
41 | LIBS = -lwiringPi -lpthread -lm | ||
42 | |||
43 | # May not need to alter anything below this line | ||
44 | @@ -61,17 +64,16 @@ tags: $(SRC) | ||
45 | .PHONEY: install | ||
46 | install: | ||
47 | @echo "[Install]" | ||
48 | - @cp gpio /usr/local/bin | ||
49 | - @chown root.root /usr/local/bin/gpio | ||
50 | - @chmod 4755 /usr/local/bin/gpio | ||
51 | - @mkdir -p /usr/local/man/man1 | ||
52 | - @cp gpio.1 /usr/local/man/man1 | ||
53 | + @install -d $(DESTDIR)$(PREFIX)/bin | ||
54 | + @install -m 4755 -o root -g root gpio $(DESTDIR)$(PREFIX)/bin | ||
55 | + @install -d $(DESTDIR)$(PREFIX)/share/man/man1 | ||
56 | + @install -m 644 -o root -g root gpio.1 $(DESTDIR)$(PREFIX)/share/man/man1 | ||
57 | |||
58 | .PHONEY: uninstall | ||
59 | uninstall: | ||
60 | @echo "[UnInstall]" | ||
61 | - @rm -f /usr/local/bin/gpio | ||
62 | - @rm -f /usr/local/man/man1/gpio.1 | ||
63 | + @rm -f $(DESTDIR)$(PREFIX)/bin/gpio | ||
64 | + @rm -f $(DESTDIR)$(PREFIX)/share/man/man1/gpio.1 | ||
65 | |||
66 | .PHONEY: depend | ||
67 | depend: | ||
68 | diff --git a/wiringPi/Makefile b/wiringPi/Makefile | ||
69 | index c6a4555..2c7ae82 100644 | ||
70 | --- a/wiringPi/Makefile | ||
71 | +++ b/wiringPi/Makefile | ||
72 | @@ -25,17 +25,20 @@ DYN_VERS_MAJ=1 | ||
73 | DYN_VERS_MIN=0 | ||
74 | |||
75 | VERSION=$(DYN_VERS_MAJ).$(DYN_VERS_MIN) | ||
76 | -DESTDIR=/usr | ||
77 | -PREFIX=/local | ||
78 | +DESTDIR?=/usr | ||
79 | +PREFIX?=/local | ||
80 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
81 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
82 | |||
83 | -STATIC=libwiringPi.a | ||
84 | -DYNAMIC=libwiringPi.so.$(VERSION) | ||
85 | +BASE_NAME=libwiringPi | ||
86 | +STATIC=$(BASE_NAME).a | ||
87 | +DYNAMIC=$(BASE_NAME).so.$(VERSION) | ||
88 | |||
89 | #DEBUG = -g -O0 | ||
90 | -DEBUG = -O2 | ||
91 | -CC = gcc | ||
92 | -INCLUDE = -I. | ||
93 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe -fPIC | ||
94 | +DEBUG ?= -O2 | ||
95 | +CC ?= gcc | ||
96 | +INCLUDE ?= -I. | ||
97 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe -fPIC | ||
98 | |||
99 | LIBS = | ||
100 | |||
101 | @@ -67,19 +70,19 @@ $(STATIC): $(OBJ) | ||
102 | |||
103 | $(DYNAMIC): $(OBJ) | ||
104 | @echo "[Link (Dynamic)]" | ||
105 | - @$(CC) -shared -Wl,-soname,libwiringPi.so.1 -o libwiringPi.so.1.0 -lpthread $(OBJ) | ||
106 | + @$(CC) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ) | ||
107 | |||
108 | i2c: $(OBJ) $(OBJ_I2C) | ||
109 | @echo "[Link (Dynamic + I2C)]" | ||
110 | - @$(CC) -shared -Wl,-soname,libwiringPi.so.1 -o libwiringPi.so.1.0 -lpthread $(OBJ) $(OBJ_I2C) | ||
111 | + @$(CC) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ) $(OBJ_I2C) | ||
112 | |||
113 | .c.o: | ||
114 | @echo [Compile] $< | ||
115 | - @$(CC) -c $(CFLAGS) $< -o $@ | ||
116 | + @$(CC) -c $(CFLAGS) -fPIC $< -o $@ | ||
117 | |||
118 | .PHONEY: clean | ||
119 | clean: | ||
120 | - rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPi.* | ||
121 | + rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak $(BASE_NAME).so* $(BASE_NAME).a | ||
122 | |||
123 | .PHONEY: tags | ||
124 | tags: $(SRC) | ||
125 | @@ -89,45 +92,46 @@ tags: $(SRC) | ||
126 | .PHONEY: install | ||
127 | install: $(DYNAMIC) | ||
128 | @echo "[Install]" | ||
129 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib | ||
130 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/include | ||
131 | - @install -m 0644 wiringPi.h $(DESTDIR)$(PREFIX)/include | ||
132 | - @install -m 0644 wiringSerial.h $(DESTDIR)$(PREFIX)/include | ||
133 | - @install -m 0644 wiringShift.h $(DESTDIR)$(PREFIX)/include | ||
134 | - @install -m 0644 gertboard.h $(DESTDIR)$(PREFIX)/include | ||
135 | - @install -m 0644 piNes.h $(DESTDIR)$(PREFIX)/include | ||
136 | - @install -m 0644 softPwm.h $(DESTDIR)$(PREFIX)/include | ||
137 | - @install -m 0644 softServo.h $(DESTDIR)$(PREFIX)/include | ||
138 | - @install -m 0644 softTone.h $(DESTDIR)$(PREFIX)/include | ||
139 | - @install -m 0644 lcd.h $(DESTDIR)$(PREFIX)/include | ||
140 | - @install -m 0644 wiringPiSPI.h $(DESTDIR)$(PREFIX)/include | ||
141 | - @install -m 0644 wiringPiI2C.h $(DESTDIR)$(PREFIX)/include | ||
142 | - @install -m 0755 libwiringPi.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib | ||
143 | - @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so | ||
144 | - @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so.1 | ||
145 | - @ldconfig | ||
146 | + @install -m 0755 -d $(LIB_DIR) | ||
147 | + @install -m 0755 -d $(INCLUDE_DIR) | ||
148 | + @install -m 0644 wiringPi.h $(INCLUDE_DIR) | ||
149 | + @install -m 0644 wiringSerial.h $(INCLUDE_DIR) | ||
150 | + @install -m 0644 wiringShift.h $(INCLUDE_DIR) | ||
151 | + @install -m 0644 gertboard.h $(INCLUDE_DIR) | ||
152 | + @install -m 0644 piNes.h $(INCLUDE_DIR) | ||
153 | + @install -m 0644 softPwm.h $(INCLUDE_DIR) | ||
154 | + @install -m 0644 softServo.h $(INCLUDE_DIR) | ||
155 | + @install -m 0644 softTone.h $(INCLUDE_DIR) | ||
156 | + @install -m 0644 lcd.h $(INCLUDE_DIR) | ||
157 | + @install -m 0644 wiringPiSPI.h $(INCLUDE_DIR) | ||
158 | + @install -m 0644 wiringPiI2C.h $(INCLUDE_DIR) | ||
159 | + @install -m 0755 $(BASE_NAME).so $(LIB_DIR)/$(DYNAMIC) | ||
160 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so | ||
161 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
162 | |||
163 | .PHONEY: install-static | ||
164 | install-static: $(STATIC) | ||
165 | @echo "[Install Static]" | ||
166 | - @install -m 0755 libwiringPi.a $(DESTDIR)$(PREFIX)/lib | ||
167 | + @install -m 0644 $(STATIC) $(LIB_DIR) | ||
168 | |||
169 | .PHONEY: uninstall | ||
170 | uninstall: | ||
171 | @echo "[UnInstall]" | ||
172 | - @rm -f $(DESTDIR)$(PREFIX)/include/wiringPi.h | ||
173 | - @rm -f $(DESTDIR)$(PREFIX)/include/wiringSerial.h | ||
174 | - @rm -f $(DESTDIR)$(PREFIX)/include/wiringShift.h | ||
175 | - @rm -f $(DESTDIR)$(PREFIX)/include/gertboard.h | ||
176 | - @rm -f $(DESTDIR)$(PREFIX)/include/piNes.h | ||
177 | - @rm -f $(DESTDIR)$(PREFIX)/include/softPwm.h | ||
178 | - @rm -f $(DESTDIR)$(PREFIX)/include/softServo.h | ||
179 | - @rm -f $(DESTDIR)$(PREFIX)/include/softTone.h | ||
180 | - @rm -f $(DESTDIR)$(PREFIX)/include/lcd.h | ||
181 | - @rm -f $(DESTDIR)$(PREFIX)/include/wiringPiSPI.h | ||
182 | - @rm -f $(DESTDIR)$(PREFIX)/include/wiringPiI2C.h | ||
183 | - @rm -f $(DESTDIR)$(PREFIX)/lib/libwiringPi.* | ||
184 | - @ldconfig | ||
185 | + @rm -f $(INCLUDE_DIR)/wiringPi.h | ||
186 | + @rm -f $(INCLUDE_DIR)/wiringSerial.h | ||
187 | + @rm -f $(INCLUDE_DIR)/wiringShift.h | ||
188 | + @rm -f $(INCLUDE_DIR)/gertboard.h | ||
189 | + @rm -f $(INCLUDE_DIR)/piNes.h | ||
190 | + @rm -f $(INCLUDE_DIR)/softPwm.h | ||
191 | + @rm -f $(INCLUDE_DIR)/softServo.h | ||
192 | + @rm -f $(INCLUDE_DIR)/softTone.h | ||
193 | + @rm -f $(INCLUDE_DIR)/lcd.h | ||
194 | + @rm -f $(INCLUDE_DIR)/wiringPiSPI.h | ||
195 | + @rm -f $(INCLUDE_DIR)/wiringPiI2C.h | ||
196 | + @rm -f $(LIB_DIR)/$(STATIC) | ||
197 | + @rm -f $(LIB_DIR)/$(DYNAMIC) | ||
198 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so | ||
199 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
200 | |||
201 | |||
202 | .PHONEY: depend | ||
diff --git a/recipes-devtools/wiringPi/wiringpi_git.bb b/recipes-devtools/wiringPi/wiringpi_git.bb new file mode 100644 index 0000000..b2e3e91 --- /dev/null +++ b/recipes-devtools/wiringPi/wiringpi_git.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | DESCRIPTION = "A library to control Raspberry Pi GPIO channels" | ||
2 | HOMEPAGE = "https://projects.drogon.net/raspberry-pi/wiringpi/" | ||
3 | SECTION = "devel/libs" | ||
4 | LICENSE = "LGPLv3+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02" | ||
6 | |||
7 | SRCREV = "98bcb20d9391ebde24f9eb1244f0d238fb1a1dab" | ||
8 | |||
9 | S = "${WORKDIR}/git" | ||
10 | |||
11 | SRC_URI = "\ | ||
12 | git://git.drogon.net/wiringPi \ | ||
13 | file://Makefiles-install.patch \ | ||
14 | " | ||
15 | |||
16 | COMPATIBLE_MACHINE = "raspberrypi" | ||
17 | |||
18 | CFLAGS_prepend = "-I${S}/wiringPi" | ||
19 | |||
20 | EXTRA_OEMAKE += "'INCLUDE_DIR=${D}${includedir}' 'LIB_DIR=${D}${libdir}'" | ||
21 | EXTRA_OEMAKE += "'DESTDIR=${D}/usr' 'PREFIX=""'" | ||
22 | |||
23 | do_compile() { | ||
24 | oe_runmake -C wiringPi | ||
25 | oe_runmake -C gpio 'LDFLAGS=${LDFLAGS} -L${S}/wiringPi' | ||
26 | } | ||
27 | |||
28 | do_install() { | ||
29 | oe_runmake -C wiringPi install | ||
30 | oe_runmake -C gpio install | ||
31 | } | ||