[v2,3/9] package/libavl: add package
diff mbox series

Message ID 20191009112656.21232-4-heiko.thiery@gmail.com
State Superseded
Headers show
Series
  • Add netopeer2 package (and dependencies)
Related show

Commit Message

Heiko Thiery Oct. 9, 2019, 11:26 a.m. UTC
From: Michael Walle <michael@walle.cc>

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Heiko Thiery <heiko.thiery@kontron.com>
---
 package/Config.in                      |  1 +
 package/libavl/0001-fix-makefile.patch | 49 ++++++++++++++++++++++++++
 package/libavl/Config.in               | 13 +++++++
 package/libavl/libavl.hash             |  5 +++
 package/libavl/libavl.mk               | 43 ++++++++++++++++++++++
 5 files changed, 111 insertions(+)
 create mode 100644 package/libavl/0001-fix-makefile.patch
 create mode 100644 package/libavl/Config.in
 create mode 100644 package/libavl/libavl.hash
 create mode 100644 package/libavl/libavl.mk

Comments

Thomas Petazzoni Oct. 9, 2019, 12:25 p.m. UTC | #1
Hello Heiko,

On Wed,  9 Oct 2019 13:26:50 +0200
heiko.thiery@gmail.com wrote:

> From: Michael Walle <michael@walle.cc>
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> Signed-off-by: Heiko Thiery <heiko.thiery@kontron.com>
> ---
>  package/Config.in                      |  1 +
>  package/libavl/0001-fix-makefile.patch | 49 ++++++++++++++++++++++++++
>  package/libavl/Config.in               | 13 +++++++
>  package/libavl/libavl.hash             |  5 +++
>  package/libavl/libavl.mk               | 43 ++++++++++++++++++++++
>  5 files changed, 111 insertions(+)
>  create mode 100644 package/libavl/0001-fix-makefile.patch
>  create mode 100644 package/libavl/Config.in
>  create mode 100644 package/libavl/libavl.hash
>  create mode 100644 package/libavl/libavl.mk

And entry to the DEVELOPERS file needs to be added.


> diff --git a/package/libavl/0001-fix-makefile.patch b/package/libavl/0001-fix-makefile.patch
> new file mode 100644
> index 0000000000..6cc96e5f74
> --- /dev/null
> +++ b/package/libavl/0001-fix-makefile.patch
> @@ -0,0 +1,49 @@
> +makefile: fix compilation and installation
> +
> +This was originally taken from:
> +https://sources.debian.org/data/main/liba/libavl/0.3.5-4/debian/patches/fix-makefile
> +
> +Unfortunately, the URL does not end in ".patch", therefore we cannot
> +use it in the FOO_PATCH variable directly.
> +
> +Signed-off-by: Michael Walle <michael@walle.cc>

We need your Signed-off-by below this one.

> +
> +--- a/GNUmakefile
> ++++ b/GNUmakefile
> +@@ -6,7 +6,8 @@
> + LDCONFIG ?= /sbin/ldconfig
> + 
> + # Some suggestions: (-mcpu= generates i386 compatible code)
> +-CFLAGS ?= -O2 -fomit-frame-pointer -pipe -mcpu=i686 -w
> ++CFLAGS ?= -O2 -pipe -Wall -Werror
> ++CFLAGS += -fPIC

So this change is not really useful, because you anyway override
CFLAGS. But if that's the patch as it is in Debian, please keep it
as-is.


> diff --git a/package/libavl/libavl.mk b/package/libavl/libavl.mk
> new file mode 100644
> index 0000000000..ad561c43bf
> --- /dev/null
> +++ b/package/libavl/libavl.mk
> @@ -0,0 +1,43 @@
> +################################################################################
> +#
> +# libavl
> +#
> +################################################################################
> +
> +LIBAVL_VERSION = 0.3.5
> +LIBAVL_SITE = http://ftp.debian.org/debian/pool/main/liba/libavl

URLs on ftp.debian.org are unfortunately not stable. We use
snapshot.debian.org instead. Do a "git grep snapshot.debian.org" in
Buildroot to see how other packages fetching from the Debian archive
are doing this.

> +LIBAVL_SOURCE = libavl_$(LIBAVL_VERSION).orig.tar.gz
> +LIBAVL_LICENSE = LGPL-2.0+
> +LIBAVL_LICENSE_FILES = COPYING
> +LIBAVL_INSTALL_STAGING = YES
> +
> +LIBAVL_CFLAGS = -fPIC

Please use:

LIBAVL_CFLAGS = $(TARGET_CFLAGS) -fPIC

> +HOST_LIBAVL_CFLAGS = -fPIC

HOST_LIBAVL_CFLAGS = $(HOST_CFLAGS) -fPIC

> +
> +define LIBAVL_BUILD_CMDS
> +	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
> +		CFLAGS="$(LIBAVL_CFLAGS)"
> +endef
> +
> +define LIBAVL_INSTALL_STAGING_CMDS
> +	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) install \
> +		prefix=/usr DESTDIR=$(STAGING_DIR)
> +endef
> +
> +define LIBAVL_INSTALL_TARGET_CMDS
> +	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) install \
> +		prefix=/usr DESTDIR=$(TARGET_DIR)
> +endef
> +
> +define HOST_LIBAVL_BUILD_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) \
> +		CFLAGS="$(HOST_LIBAVL_CFLAGS)"
> +endef
> +
> +define HOST_LIBAVL_INSTALL_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) install \
> +		prefix=/usr DESTDIR=$(HOST_DIR)

For the host build/installation, semantically speaking, the correct
thing is:

	prefix=$(HOST_DIR)

Indeed, we don't have any "usr" in $(HOST_DIR), and prefix indicates
where the software will be executing from.

Thanks!

Thomas
Michael Walle Oct. 9, 2019, 4:04 p.m. UTC | #2
Hi Thomas,

Actually, I've prepared that package.

Am 2019-10-09 14:25, schrieb Thomas Petazzoni:
> On Wed,  9 Oct 2019 13:26:50 +0200
> heiko.thiery@gmail.com wrote:
> 
>> From: Michael Walle <michael@walle.cc>
>> 
>> Signed-off-by: Michael Walle <michael@walle.cc>
>> Signed-off-by: Heiko Thiery <heiko.thiery@kontron.com>
>> ---
>>  package/Config.in                      |  1 +
>>  package/libavl/0001-fix-makefile.patch | 49 
>> ++++++++++++++++++++++++++
>>  package/libavl/Config.in               | 13 +++++++
>>  package/libavl/libavl.hash             |  5 +++
>>  package/libavl/libavl.mk               | 43 ++++++++++++++++++++++
>>  5 files changed, 111 insertions(+)
>>  create mode 100644 package/libavl/0001-fix-makefile.patch
>>  create mode 100644 package/libavl/Config.in
>>  create mode 100644 package/libavl/libavl.hash
>>  create mode 100644 package/libavl/libavl.mk
> 
> And entry to the DEVELOPERS file needs to be added.

I've added myself.

>> diff --git a/package/libavl/0001-fix-makefile.patch 
>> b/package/libavl/0001-fix-makefile.patch
>> new file mode 100644
>> index 0000000000..6cc96e5f74
>> --- /dev/null
>> +++ b/package/libavl/0001-fix-makefile.patch
>> @@ -0,0 +1,49 @@
>> +makefile: fix compilation and installation
>> +
>> +This was originally taken from:
>> +https://sources.debian.org/data/main/liba/libavl/0.3.5-4/debian/patches/fix-makefile
>> +
>> +Unfortunately, the URL does not end in ".patch", therefore we cannot
>> +use it in the FOO_PATCH variable directly.
>> +
>> +Signed-off-by: Michael Walle <michael@walle.cc>
> 
> We need your Signed-off-by below this one.

So do Heiko still need his s-o-b?

> 
>> +
>> +--- a/GNUmakefile
>> ++++ b/GNUmakefile
>> +@@ -6,7 +6,8 @@
>> + LDCONFIG ?= /sbin/ldconfig
>> +
>> + # Some suggestions: (-mcpu= generates i386 compatible code)
>> +-CFLAGS ?= -O2 -fomit-frame-pointer -pipe -mcpu=i686 -w
>> ++CFLAGS ?= -O2 -pipe -Wall -Werror
>> ++CFLAGS += -fPIC
> 
> So this change is not really useful, because you anyway override
> CFLAGS. But if that's the patch as it is in Debian, please keep it
> as-is.
> 
> 
>> diff --git a/package/libavl/libavl.mk b/package/libavl/libavl.mk
>> new file mode 100644
>> index 0000000000..ad561c43bf
>> --- /dev/null
>> +++ b/package/libavl/libavl.mk
>> @@ -0,0 +1,43 @@
>> +################################################################################
>> +#
>> +# libavl
>> +#
>> +################################################################################
>> +
>> +LIBAVL_VERSION = 0.3.5
>> +LIBAVL_SITE = http://ftp.debian.org/debian/pool/main/liba/libavl
> 
> URLs on ftp.debian.org are unfortunately not stable. We use
> snapshot.debian.org instead. Do a "git grep snapshot.debian.org" in
> Buildroot to see how other packages fetching from the Debian archive
> are doing this.

Ahh I see. Will be fixed in the next version. I'll also use the snapshot 
url in the .hash comment.

>> +LIBAVL_SOURCE = libavl_$(LIBAVL_VERSION).orig.tar.gz
>> +LIBAVL_LICENSE = LGPL-2.0+
>> +LIBAVL_LICENSE_FILES = COPYING
>> +LIBAVL_INSTALL_STAGING = YES
>> +
>> +LIBAVL_CFLAGS = -fPIC
> 
> Please use:
> 
> LIBAVL_CFLAGS = $(TARGET_CFLAGS) -fPIC

will be fixed in the next version.

> 
>> +HOST_LIBAVL_CFLAGS = -fPIC
> 
> HOST_LIBAVL_CFLAGS = $(HOST_CFLAGS) -fPIC

dito

[..snip..]

> For the host build/installation, semantically speaking, the correct
> thing is:
> 
> 	prefix=$(HOST_DIR)
> 
> Indeed, we don't have any "usr" in $(HOST_DIR), and prefix indicates
> where the software will be executing from.

dito

-michael
Thomas Petazzoni Oct. 9, 2019, 7:27 p.m. UTC | #3
On Wed, 09 Oct 2019 18:04:30 +0200
Michael Walle <michael@walle.cc> wrote:

> Actually, I've prepared that package.

OK. Then it should probably be From: you, and have a Signed-off-by: you
as the first line, followed by Heiko's Signed-off-by.

> > We need your Signed-off-by below this one.  
> 
> So do Heiko still need his s-o-b?

If you're the author of the Git commit, that's OK if there's only your
SoB inside the patch.

Thanks!

Thomas
Michael Walle Oct. 10, 2019, 8:20 a.m. UTC | #4
Am 2019-10-09 21:27, schrieb Thomas Petazzoni:
> On Wed, 09 Oct 2019 18:04:30 +0200
> Michael Walle <michael@walle.cc> wrote:
> 
>> Actually, I've prepared that package.
> 
> OK. Then it should probably be From: you, and have a Signed-off-by: you
> as the first line, followed by Heiko's Signed-off-by.

That was already the case, wasn't it? ;)

-michael
Thomas Petazzoni Oct. 10, 2019, 8:25 a.m. UTC | #5
On Thu, 10 Oct 2019 10:20:05 +0200
Michael Walle <michael@walle.cc> wrote:

> > OK. Then it should probably be From: you, and have a Signed-off-by: you
> > as the first line, followed by Heiko's Signed-off-by.  
> 
> That was already the case, wasn't it? ;)

My bad, it was indeed already the case, it was perfectly correct. Sorry
for the noise :-/

Thanks!

Thomas

Patch
diff mbox series

diff --git a/package/Config.in b/package/Config.in
index 47b602c547..e84624ccdf 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1713,6 +1713,7 @@  menu "Other"
 	source "package/lapack/Config.in"
 	source "package/libargtable2/Config.in"
 	source "package/libatomic_ops/Config.in"
+	source "package/libavl/Config.in"
 	source "package/libb64/Config.in"
 	source "package/libbsd/Config.in"
 	source "package/libcap/Config.in"
diff --git a/package/libavl/0001-fix-makefile.patch b/package/libavl/0001-fix-makefile.patch
new file mode 100644
index 0000000000..6cc96e5f74
--- /dev/null
+++ b/package/libavl/0001-fix-makefile.patch
@@ -0,0 +1,49 @@ 
+makefile: fix compilation and installation
+
+This was originally taken from:
+https://sources.debian.org/data/main/liba/libavl/0.3.5-4/debian/patches/fix-makefile
+
+Unfortunately, the URL does not end in ".patch", therefore we cannot
+use it in the FOO_PATCH variable directly.
+
+Signed-off-by: Michael Walle <michael@walle.cc>
+
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -6,7 +6,8 @@
+ LDCONFIG ?= /sbin/ldconfig
+ 
+ # Some suggestions: (-mcpu= generates i386 compatible code)
+-CFLAGS ?= -O2 -fomit-frame-pointer -pipe -mcpu=i686 -w
++CFLAGS ?= -O2 -pipe -Wall -Werror
++CFLAGS += -fPIC
+ #CFLAGS = -O2 -fomit-frame-pointer -pipe -march=i586 -Wall -g
+ #CFLAGS = -O6 -fomit-frame-pointer -pipe -march=i586 -Wall -ansi -pedantic
+ #CFLAGS = -O6 -fomit-frame-pointer -pipe -march=i686 -Wall -ansi -pedantic
+@@ -34,20 +35,21 @@
+ 	$(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
+ 
+ $(LIBRARY): avl.o
+-	$(CC) -nostdlib -shared -Wl,-soname,libavl.so.1 $^ -o $@ -lc
++	$(CC) $(LDFLAGS) -shared -Wl,-soname,libavl.so.1 $^ -o $@ -lc
+ 
+ clean:
+ 	$(RM) *.o $(PROGRAMS) libavl.*
+ 
+ install: all
+ 	$(INSTALL) -d $(DESTDIR)$(libdir)
+-	$(INSTALL) avl.h $(DESTDIR)$(includedir)
+-	$(INSTALL) $(LIBRARIES) $(DESTDIR)$(libdir)
+-	for i in $(LIBRARIES); do\
++	$(INSTALL) -d $(DESTDIR)$(includedir)
++	$(INSTALL) -m 644 avl.h $(DESTDIR)$(includedir)
++	$(INSTALL) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
++	for i in $(LIBRARY); do\
+ 		$(LN) -sf $$i $(DESTDIR)$(libdir)/$${i%.*};\
+ 		$(LN) -sf $${i%.*} $(DESTDIR)$(libdir)/$${i%.*.*};\
+ 	done
+-	-$(LDCONFIG)
++	#-$(LDCONFIG)
+ 
+ .PHONY: clean install all
+ .PRECIOUS: %.h %.c
diff --git a/package/libavl/Config.in b/package/libavl/Config.in
new file mode 100644
index 0000000000..20d3c5ef7d
--- /dev/null
+++ b/package/libavl/Config.in
@@ -0,0 +1,13 @@ 
+config BR2_PACKAGE_LIBAVL
+	bool "libavl"
+	depends on !BR2_STATIC_LIBS
+	help
+	  AVLTree is a small implementation of AVL trees for the C
+	  programming language.
+
+	  https://packages.debian.org/buster/libavl1
+
+	  This is not the GNU AVL library by Ben Pfaff.
+
+comment "libavl needs a toolchain w/ dynamic library"
+	depends on BR2_STATIC_LIBS
diff --git a/package/libavl/libavl.hash b/package/libavl/libavl.hash
new file mode 100644
index 0000000000..5c668603a3
--- /dev/null
+++ b/package/libavl/libavl.hash
@@ -0,0 +1,5 @@ 
+# From http://ftp.debian.org/debian/pool/main/liba/libavl/libavl_0.3.5-4.dsc
+sha256	4497b9e22cdd61ae2fa893b9d5fd6213dc306726d7c4be08c29e173622dca8a0	libavl_0.3.5.orig.tar.gz
+
+# Hash for license files:
+sha256	767a9accfe3b110153b567983b98889469dfaae02899a632aeadbb81ad611293	COPYING
diff --git a/package/libavl/libavl.mk b/package/libavl/libavl.mk
new file mode 100644
index 0000000000..ad561c43bf
--- /dev/null
+++ b/package/libavl/libavl.mk
@@ -0,0 +1,43 @@ 
+################################################################################
+#
+# libavl
+#
+################################################################################
+
+LIBAVL_VERSION = 0.3.5
+LIBAVL_SITE = http://ftp.debian.org/debian/pool/main/liba/libavl
+LIBAVL_SOURCE = libavl_$(LIBAVL_VERSION).orig.tar.gz
+LIBAVL_LICENSE = LGPL-2.0+
+LIBAVL_LICENSE_FILES = COPYING
+LIBAVL_INSTALL_STAGING = YES
+
+LIBAVL_CFLAGS = -fPIC
+HOST_LIBAVL_CFLAGS = -fPIC
+
+define LIBAVL_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
+		CFLAGS="$(LIBAVL_CFLAGS)"
+endef
+
+define LIBAVL_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) install \
+		prefix=/usr DESTDIR=$(STAGING_DIR)
+endef
+
+define LIBAVL_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) install \
+		prefix=/usr DESTDIR=$(TARGET_DIR)
+endef
+
+define HOST_LIBAVL_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) \
+		CFLAGS="$(HOST_LIBAVL_CFLAGS)"
+endef
+
+define HOST_LIBAVL_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) install \
+		prefix=/usr DESTDIR=$(HOST_DIR)
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))