From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] wiringpi: new package
Date: Mon, 30 Nov 2015 22:10:30 +0100 [thread overview]
Message-ID: <20151130221030.3f74feb7@free-electrons.com> (raw)
In-Reply-To: <1448400991-5011-1-git-send-email-ps.report@gmx.net>
Dear Peter Seiderer,
On Tue, 24 Nov 2015 22:36:31 +0100, Peter Seiderer wrote:
> diff --git a/package/Config.in b/package/Config.in
> index bdc3063..9d273e7 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -438,6 +438,7 @@ endif
> source "package/w_scan/Config.in"
> source "package/wf111/Config.in"
> source "package/wipe/Config.in"
> + source "package/wiringpi/Config.in"
Isn't wiringpi mainly a library ? Maybe it should go under Libraries ->
Hardware handling.
> +diff --git a/devLib/Makefile b/devLib/Makefile
> +index 0fb0033..f956abe 100644
> +--- a/devLib/Makefile
> ++++ b/devLib/Makefile
> +@@ -37,7 +37,7 @@ DYNAMIC=libwiringPiDev.so.$(VERSION)
> + #DEBUG = -g -O0
> + DEBUG = -O2
> + CC = gcc
> +-INCLUDE = -I.
> ++INCLUDE = -I$(DESTDIR)$(PREFIX)/wiringPi -I$(DESTDIR)$(PREFIX)/devLib
> + DEFS = -D_GNU_SOURCE
> + CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
> +
> +diff --git a/gpio/Makefile b/gpio/Makefile
> +index 7dcd090..f5b588a 100644
> +--- a/gpio/Makefile
> ++++ b/gpio/Makefile
> +@@ -33,7 +33,7 @@ endif
> + #DEBUG = -g -O0
> + DEBUG = -O2
> + CC = gcc
> +-INCLUDE = -I$(DESTDIR)$(PREFIX)/include
> ++INCLUDE = -I$(DESTDIR)$(PREFIX)/wiringPi -I$(DESTDIR)$(PREFIX)/devLib
This patch is not correct I believe. It makes the assumption that
wiringPi is already installed in $(DESTDIR)$(PREFIX), which it is not
when you are building it.
> diff --git a/package/wiringpi/wiringpi.mk b/package/wiringpi/wiringpi.mk
> new file mode 100644
> index 0000000..258bb25
> --- /dev/null
> +++ b/package/wiringpi/wiringpi.mk
> @@ -0,0 +1,29 @@
Missing comment header.
> +WIRINGPI_VERSION = 2.29
> +WIRINGPI_SITE = git://git.drogon.net/wiringPi
> +WIRINGPI_INSTALL_STAGING = YES
Missing license + license file information.
> +
> +define WIRINGPI_BUILD_CMDS
> + $(MAKE) -C $(@D)/wiringPi CC=$(TARGET_CC)
It would be a lot better to use $(TARGET_CONFIGURE_OPTS), and
$(TARGET_MAKE_ENV), i.e:
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/wiringPi
the CC=$(TARGET_CC) is already part of TARGET_CONFIGURE_OPTS. Also you
will probably have to adjust the Makefile to turn CFLAGS = into CFLAGS
+=.
> + $(INSTALL) -D -m 0755 $(@D)/wiringPi/libwiringPi.so.2.29 $(STAGING_DIR)/usr/lib/libwiringPi.so.2.29
> + ln -sf $(STAGING_DIR)/usr/lib/libwiringPi.so.2.29 $(STAGING_DIR)/usr/lib/libwiringPi.so
Why are you doing installation within the <pkg>_BUILDS_CMDS ? This is not good ?
> + $(MAKE) -C $(@D)/devLib CC=$(TARGET_CC) PREFIX=$(@D) DESTDIR=
Why is DESTDIR= needed here ?
> + $(INSTALL) -D -m 0755 $(@D)/devLib/libwiringPiDev.so.2.29 $(STAGING_DIR)/usr/lib/libwiringPiDev.so.2.29
> + ln -sf $(STAGING_DIR)/usr/lib/libwiringPiDev.so.2.29 $(STAGING_DIR)/usr/lib/libwiringPiDev.so
Ditto installation.
> + $(MAKE) -C $(@D)/gpio CC=$(TARGET_CC) PREFIX=$(@D) DESTDIR=
> +endef
> +
> +define WIRINGPI_INSTALL_STAGING_CMDS
> + $(INSTALL) -D -m 0644 $(@D)/wiringPi/*.h $(STAGING_DIR)/usr/include
> + $(INSTALL) -D -m 0644 $(@D)/devLib/*.h $(STAGING_DIR)/usr/include
This is not good because $(INSTALL) -D expect a full destination path.
I guess the easiest is just:
cp -dpfr $(@D)/wiringPi/*.h $(STAGING_DIR)/usr/include
> +define WIRINGPI_INSTALL_TARGET_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/wiringPi/libwiringPi.so* $(TARGET_DIR)/usr/lib
> + ln -sf libwiringPi.so.2.29 $(TARGET_DIR)/usr/lib/libwiringPi.so
> + $(INSTALL) -D -m 0755 $(@D)/devLib/libwiringPiDev.so* $(TARGET_DIR)/usr/lib
> + ln -sf libwiringPiDev.so.2.29 $(TARGET_DIR)/usr/lib/libwiringPiDev.so
> + $(INSTALL) -D -m 0755 $(@D)/gpio/gpio $(TARGET_DIR)/usr/bin
> + $(INSTALL) -D -m 0755 $(@D)/gpio/pintest $(TARGET_DIR)/usr/bin
Same comments here: $(INSTALL) -D requires a full destination path.
Otherwise, if $(TARGET_DIR)/usr/bin doesn't exist as a directory, you
will have you "pintest" program installed as "bin" in $(TARGET_DIR)/usr.
Moreover, the upstream project has some "install" and "install-static"
targets. You should use them instead of doing manual installation.
Finally, if you're installing unconditionally shared libraries, then it
means that they are always being built. So your package should depend
on !BR2_STATIC_LIBS.
Can you fix those comments and send an updated version ?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2015-11-30 21:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 21:36 [Buildroot] [PATCH v2] wiringpi: new package Peter Seiderer
2015-11-30 21:10 ` Thomas Petazzoni [this message]
2015-12-03 21:06 ` Peter Seiderer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151130221030.3f74feb7@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox