All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1 1/1] package/libtalloc: update to add libtalloc
@ 2020-01-29 15:08 jared.bents at rockwellcollins.com
  2020-02-01 22:35 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: jared.bents at rockwellcollins.com @ 2020-01-29 15:08 UTC (permalink / raw)
  To: buildroot

From: Jared Bents <jared.bents@rockwellcollins.com>

update to add libtalloc as a package

Signed-off-by: Jared Bents <jared.bents@rockwellcollins.com>
---
 package/Config.in                |  1 +
 package/libtalloc/Config.in      |  8 ++++
 package/libtalloc/libtalloc.hash |  2 +
 package/libtalloc/libtalloc.mk   | 74 ++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+)
 create mode 100644 package/libtalloc/Config.in
 create mode 100644 package/libtalloc/libtalloc.hash
 create mode 100644 package/libtalloc/libtalloc.mk

diff --git a/package/Config.in b/package/Config.in
index 091f5d39f7..37c2c3df12 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1769,6 +1769,7 @@ menu "Other"
 	source "package/libsigc/Config.in"
 	source "package/libsigsegv/Config.in"
 	source "package/libspatialindex/Config.in"
+	source "package/libtalloc/Config.in"
 	source "package/libtasn1/Config.in"
 	source "package/libtommath/Config.in"
 	source "package/libtpl/Config.in"
diff --git a/package/libtalloc/Config.in b/package/libtalloc/Config.in
new file mode 100644
index 0000000000..168d367793
--- /dev/null
+++ b/package/libtalloc/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_LIBTALLOC
+	bool "libtalloc"
+	help
+	  talloc is a hierarchical, reference counted memory pool
+	  system with destructors. It is the core memory allocator
+	  used in Samba.
+
+	  https://talloc.samba.org/talloc/doc/html/index.html
diff --git a/package/libtalloc/libtalloc.hash b/package/libtalloc/libtalloc.hash
new file mode 100644
index 0000000000..ff1df0f8a9
--- /dev/null
+++ b/package/libtalloc/libtalloc.hash
@@ -0,0 +1,2 @@
+# Locally calculated after checking pgp signature
+sha256 ef4822d2fdafd2be8e0cabc3ec3c806ae29b8268e932c5e9a4cd5585f37f9f77  talloc-2.3.1.tar.gz
diff --git a/package/libtalloc/libtalloc.mk b/package/libtalloc/libtalloc.mk
new file mode 100644
index 0000000000..82a5bcb45e
--- /dev/null
+++ b/package/libtalloc/libtalloc.mk
@@ -0,0 +1,74 @@
+################################################################################
+#
+# libtalloc
+#
+################################################################################
+
+LIBTALLOC_VERSION = 2.3.1
+LIBTALLOC_SITE = https://www.samba.org/ftp/talloc
+LIBTALLOC_SOURCE = talloc-$(LIBTALLOC_VERSION).tar.gz
+LIBTALLOC_LICENSE = LGPL-3.0+
+# no license file but available in source at man/talloc.3.xml
+LIBTALLOC_INSTALL_STAGING = YES
+LIBTALLOC_CFLAGS = $(TARGET_CFLAGS)
+LIBTALLOC_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
+LIBTALLOC_CONF_ENV = \
+	CFLAGS="$(LIBTALLOC_CFLAGS)" \
+	LDFLAGS="$(LIBTALLOC_LDFLAGS)" \
+	XSLTPROC=false \
+	WAF_NO_PREFORK=1
+
+ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
+LIBTALLOC_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`
+LIBTALLOC_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`
+LIBTALLOC_DEPENDENCIES += libtirpc host-pkgconf
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+LIBTALLOC_PYTHON = \
+	PYTHON="$(HOST_DIR)/bin/python3" \
+	PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python3-config"
+LIBTALLOC_DEPENDENCIES += host-python3 python3
+LIBTALLOC_CONF_ENV += \
+	$(LIBTALLOC_PYTHON) \
+	python_LDFLAGS="" \
+	python_LIBDIR=""
+# There is not a --enable-python configuration option
+else
+LIBTALLOC_CONF_OPTS += --disable-python
+endif
+
+define LIBTALLOC_CONFIGURE_CMDS
+	$(INSTALL) -m 0644 package/samba4/samba4-cache.txt $(@D)/cache.txt;
+	echo 'Checking uname machine type: $(BR2_ARCH)' >>$(@D)/cache.txt;
+	(cd $(@D); \
+		$(TARGET_CONFIGURE_OPTS) \
+		$(LIBTALLOC_CONF_ENV) \
+		./buildtools/bin/waf configure \
+			--prefix=/usr \
+			--sysconfdir=/etc \
+			--localstatedir=/var \
+			--with-libiconv=$(STAGING_DIR)/usr \
+			--cross-compile \
+			--cross-answers=$(@D)/cache.txt \
+			--hostcc=gcc \
+			--disable-rpath \
+			--disable-rpath-install \
+			--bundled-libraries='!asn1_compile,!compile_et' \
+			$(LIBTALLOC_CONF_OPTS) \
+	)
+endef
+
+define LIBTALLOC_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(LIBTALLOC_PYTHON) $(MAKE) -C $(@D)
+endef
+
+define LIBTALLOC_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(LIBTALLOC_PYTHON) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
+endef
+
+define LIBTALLOC_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(LIBTALLOC_PYTHON) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+endef
+
+$(eval $(generic-package))
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH v1 1/1] package/libtalloc: update to add libtalloc
  2020-01-29 15:08 [Buildroot] [PATCH v1 1/1] package/libtalloc: update to add libtalloc jared.bents at rockwellcollins.com
@ 2020-02-01 22:35 ` Thomas Petazzoni
  2020-02-07 21:19   ` Jared Bents
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2020-02-01 22:35 UTC (permalink / raw)
  To: buildroot

Hello Jared,

Thanks for your contribution. A number of comments/questions below.

On Wed, 29 Jan 2020 09:08:41 -0600
jared.bents at rockwellcollins.com wrote:

>  package/Config.in                |  1 +
>  package/libtalloc/Config.in      |  8 ++++
>  package/libtalloc/libtalloc.hash |  2 +
>  package/libtalloc/libtalloc.mk   | 74 ++++++++++++++++++++++++++++++++
>  4 files changed, 85 insertions(+)

Entry missing in the DEVELOPERS file.

> diff --git a/package/libtalloc/Config.in b/package/libtalloc/Config.in
> new file mode 100644
> index 0000000000..168d367793
> --- /dev/null
> +++ b/package/libtalloc/Config.in
> @@ -0,0 +1,8 @@
> +config BR2_PACKAGE_LIBTALLOC
> +	bool "libtalloc"

Really no toolchain dependencies at all? Did you test this package with
test-pkg ?

> diff --git a/package/libtalloc/libtalloc.hash b/package/libtalloc/libtalloc.hash
> new file mode 100644
> index 0000000000..ff1df0f8a9
> --- /dev/null
> +++ b/package/libtalloc/libtalloc.hash
> @@ -0,0 +1,2 @@
> +# Locally calculated after checking pgp signature
> +sha256 ef4822d2fdafd2be8e0cabc3ec3c806ae29b8268e932c5e9a4cd5585f37f9f77  talloc-2.3.1.tar.gz

We will need a license file hash. See below.

> diff --git a/package/libtalloc/libtalloc.mk b/package/libtalloc/libtalloc.mk
> new file mode 100644
> index 0000000000..82a5bcb45e
> --- /dev/null
> +++ b/package/libtalloc/libtalloc.mk
> @@ -0,0 +1,74 @@
> +################################################################################
> +#
> +# libtalloc
> +#
> +################################################################################
> +
> +LIBTALLOC_VERSION = 2.3.1
> +LIBTALLOC_SITE = https://www.samba.org/ftp/talloc
> +LIBTALLOC_SOURCE = talloc-$(LIBTALLOC_VERSION).tar.gz
> +LIBTALLOC_LICENSE = LGPL-3.0+

The python bindings are under GPL-3.0+

> +# no license file but available in source at man/talloc.3.xml

I suggest using talloc.h as the license file for LGPL-3.0+ and
pytalloc.h as the license file for GPL-3.0+.

> +LIBTALLOC_INSTALL_STAGING = YES
> +LIBTALLOC_CFLAGS = $(TARGET_CFLAGS)
> +LIBTALLOC_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)

If you use TARGET_NLS_LIBS here, then you need
$(TARGET_NLS_DEPENDENCIES) in the <pkg>_DEPENDENCIES variable. Make
sure it is really needed though.

> +LIBTALLOC_CONF_ENV = \
> +	CFLAGS="$(LIBTALLOC_CFLAGS)" \
> +	LDFLAGS="$(LIBTALLOC_LDFLAGS)" \
> +	XSLTPROC=false \
> +	WAF_NO_PREFORK=1
> +
> +ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
> +LIBTALLOC_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`
> +LIBTALLOC_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`
> +LIBTALLOC_DEPENDENCIES += libtirpc host-pkgconf
> +endif

Are you sure libtirpc is really used by libtalloc ? I know it is
checked in lib/replace/wscript, but I don't see where it gets used, and
I don't see why a memory allocator library would care about RPC
support. Could you comment on this ?

> +
> +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> +LIBTALLOC_PYTHON = \
> +	PYTHON="$(HOST_DIR)/bin/python3" \
> +	PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python3-config"

I'm not sure we need this LIBTALLOC_PYTHON variable, just put these
variables in LIBTALLOC_MAKE_ENV, which itself is initially set to
TARGET_MAKE_ENV, and then used in the commands.

> +LIBTALLOC_DEPENDENCIES += host-python3 python3
> +LIBTALLOC_CONF_ENV += \
> +	$(LIBTALLOC_PYTHON) \
> +	python_LDFLAGS="" \
> +	python_LIBDIR=""

Setting these python_LDFLAGS and python_LIBDIR to empty values looks
weird. Why do you need that? Aren't they empty by default anyway?

> +define LIBTALLOC_CONFIGURE_CMDS
> +	$(INSTALL) -m 0644 package/samba4/samba4-cache.txt $(@D)/cache.txt;
> +	echo 'Checking uname machine type: $(BR2_ARCH)' >>$(@D)/cache.txt;
> +	(cd $(@D); \
> +		$(TARGET_CONFIGURE_OPTS) \
> +		$(LIBTALLOC_CONF_ENV) \
> +		./buildtools/bin/waf configure \
> +			--prefix=/usr \
> +			--sysconfdir=/etc \
> +			--localstatedir=/var \
> +			--with-libiconv=$(STAGING_DIR)/usr \
> +			--cross-compile \
> +			--cross-answers=$(@D)/cache.txt \
> +			--hostcc=gcc \
> +			--disable-rpath \
> +			--disable-rpath-install \
> +			--bundled-libraries='!asn1_compile,!compile_et' \
> +			$(LIBTALLOC_CONF_OPTS) \

Why don't you use the waf-package infrastructure if this is a waf
package ? Hm, I see samba4 is also not using the waf package
infrastructure for some reason.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH v1 1/1] package/libtalloc: update to add libtalloc
  2020-02-01 22:35 ` Thomas Petazzoni
@ 2020-02-07 21:19   ` Jared Bents
  0 siblings, 0 replies; 3+ messages in thread
From: Jared Bents @ 2020-02-07 21:19 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sat, Feb 1, 2020 at 4:36 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Jared,
>
> Thanks for your contribution. A number of comments/questions below.
>
> On Wed, 29 Jan 2020 09:08:41 -0600
> jared.bents at rockwellcollins.com wrote:
>
> >  package/Config.in                |  1 +
> >  package/libtalloc/Config.in      |  8 ++++
> >  package/libtalloc/libtalloc.hash |  2 +
> >  package/libtalloc/libtalloc.mk   | 74 ++++++++++++++++++++++++++++++++
> >  4 files changed, 85 insertions(+)
>
> Entry missing in the DEVELOPERS file.

Will include in v2

>
> > diff --git a/package/libtalloc/Config.in b/package/libtalloc/Config.in
> > new file mode 100644
> > index 0000000000..168d367793
> > --- /dev/null
> > +++ b/package/libtalloc/Config.in
> > @@ -0,0 +1,8 @@
> > +config BR2_PACKAGE_LIBTALLOC
> > +     bool "libtalloc"
>
> Really no toolchain dependencies at all? Did you test this package with
> test-pkg ?

I missed the toolchain dependencies. Will add those in v2

>
> > diff --git a/package/libtalloc/libtalloc.hash b/package/libtalloc/libtalloc.hash
> > new file mode 100644
> > index 0000000000..ff1df0f8a9
> > --- /dev/null
> > +++ b/package/libtalloc/libtalloc.hash
> > @@ -0,0 +1,2 @@
> > +# Locally calculated after checking pgp signature
> > +sha256 ef4822d2fdafd2be8e0cabc3ec3c806ae29b8268e932c5e9a4cd5585f37f9f77  talloc-2.3.1.tar.gz
>
> We will need a license file hash. See below.

I'll add both files as license files and get them included in the .hash

>
> > diff --git a/package/libtalloc/libtalloc.mk b/package/libtalloc/libtalloc.mk
> > new file mode 100644
> > index 0000000000..82a5bcb45e
> > --- /dev/null
> > +++ b/package/libtalloc/libtalloc.mk
> > @@ -0,0 +1,74 @@
> > +################################################################################
> > +#
> > +# libtalloc
> > +#
> > +################################################################################
> > +
> > +LIBTALLOC_VERSION = 2.3.1
> > +LIBTALLOC_SITE = https://www.samba.org/ftp/talloc
> > +LIBTALLOC_SOURCE = talloc-$(LIBTALLOC_VERSION).tar.gz
> > +LIBTALLOC_LICENSE = LGPL-3.0+
>
> The python bindings are under GPL-3.0+
>
> > +# no license file but available in source at man/talloc.3.xml
>
> I suggest using talloc.h as the license file for LGPL-3.0+ and
> pytalloc.h as the license file for GPL-3.0+.
>
> > +LIBTALLOC_INSTALL_STAGING = YES
> > +LIBTALLOC_CFLAGS = $(TARGET_CFLAGS)
> > +LIBTALLOC_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
>
> If you use TARGET_NLS_LIBS here, then you need
> $(TARGET_NLS_DEPENDENCIES) in the <pkg>_DEPENDENCIES variable. Make
> sure it is really needed though.

It appears it is not needed, will remove

>
> > +LIBTALLOC_CONF_ENV = \
> > +     CFLAGS="$(LIBTALLOC_CFLAGS)" \
> > +     LDFLAGS="$(LIBTALLOC_LDFLAGS)" \
> > +     XSLTPROC=false \
> > +     WAF_NO_PREFORK=1
> > +
> > +ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
> > +LIBTALLOC_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`
> > +LIBTALLOC_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`
> > +LIBTALLOC_DEPENDENCIES += libtirpc host-pkgconf
> > +endif
>
> Are you sure libtirpc is really used by libtalloc ? I know it is
> checked in lib/replace/wscript, but I don't see where it gets used, and
> I don't see why a memory allocator library would care about RPC
> support. Could you comment on this ?

I see an undef happening related to RPC in lib/replace/system/nis.h.
It is refering to a conflict for AUTH_ERROR with rpc/rpc.h. However,
that is the only reference I am seeing as nettype.h is not used
anywhere.

>
> > +
> > +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> > +LIBTALLOC_PYTHON = \
> > +     PYTHON="$(HOST_DIR)/bin/python3" \
> > +     PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python3-config"
>
> I'm not sure we need this LIBTALLOC_PYTHON variable, just put these
> variables in LIBTALLOC_MAKE_ENV, which itself is initially set to
> TARGET_MAKE_ENV, and then used in the commands.
>

I can't seem to get the build to work by switching to using
LIBTALLOC_MAKE_ENV but if I can get it working, I'll include in v2

> > +LIBTALLOC_DEPENDENCIES += host-python3 python3
> > +LIBTALLOC_CONF_ENV += \
> > +     $(LIBTALLOC_PYTHON) \
> > +     python_LDFLAGS="" \
> > +     python_LIBDIR=""
>
> Setting these python_LDFLAGS and python_LIBDIR to empty values looks
> weird. Why do you need that? Aren't they empty by default anyway?

Yeah they appear to not be needed. I had incorrectly assumed they were
needed while basing off of samba4 since libtalloc is included in
samba4

>
> > +define LIBTALLOC_CONFIGURE_CMDS
> > +     $(INSTALL) -m 0644 package/samba4/samba4-cache.txt $(@D)/cache.txt;
> > +     echo 'Checking uname machine type: $(BR2_ARCH)' >>$(@D)/cache.txt;
> > +     (cd $(@D); \
> > +             $(TARGET_CONFIGURE_OPTS) \
> > +             $(LIBTALLOC_CONF_ENV) \
> > +             ./buildtools/bin/waf configure \
> > +                     --prefix=/usr \
> > +                     --sysconfdir=/etc \
> > +                     --localstatedir=/var \
> > +                     --with-libiconv=$(STAGING_DIR)/usr \
> > +                     --cross-compile \
> > +                     --cross-answers=$(@D)/cache.txt \
> > +                     --hostcc=gcc \
> > +                     --disable-rpath \
> > +                     --disable-rpath-install \
> > +                     --bundled-libraries='!asn1_compile,!compile_et' \
> > +                     $(LIBTALLOC_CONF_OPTS) \
>
> Why don't you use the waf-package infrastructure if this is a waf
> package ? Hm, I see samba4 is also not using the waf package
> infrastructure for some reason.

I'll investigate using the waf-package infrastructure for v2

>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Thank you for the review,
Jared

-- 
Jared M. Bents | Sr. Software Engineer | Commercial Avionics
COLLINS AEROSPACE
400 Collins Road NE, Cedar Rapids, Iowa 52498 USA
jared.bents at collins.com | collinsaerospace.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-07 21:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-29 15:08 [Buildroot] [PATCH v1 1/1] package/libtalloc: update to add libtalloc jared.bents at rockwellcollins.com
2020-02-01 22:35 ` Thomas Petazzoni
2020-02-07 21:19   ` Jared Bents

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.