Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] package/libdivsufsort: new package
@ 2024-10-04 21:54 Dario Binacchi
  2024-10-04 21:54 ` [Buildroot] [PATCH 2/3] package/bsdiff: switch upstream Dario Binacchi
  2024-10-04 21:54 ` [Buildroot] [PATCH 3/3] DEVELOPERS: add Dario Binacchi for bsdiff Dario Binacchi
  0 siblings, 2 replies; 6+ messages in thread
From: Dario Binacchi @ 2024-10-04 21:54 UTC (permalink / raw)
  To: buildroot; +Cc: Dario Binacchi, linux-amarula, Colin Percival

The commit adds the libdivsufsort library. This library implements a
lightweight suffix array construction algorithm.

I set the package version to the most recent commit because the latest
released version (i. e. 2.0.1) had license and compilation issues, which
were fixed in subsequent commits.

Cc: Colin Percival <cperciva@freebsd.org>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 DEVELOPERS                               |  1 +
 package/Config.in                        |  1 +
 package/libdivsufsort/Config.in          |  7 +++++++
 package/libdivsufsort/libdivsufsort.hash |  3 +++
 package/libdivsufsort/libdivsufsort.mk   | 23 +++++++++++++++++++++++
 5 files changed, 35 insertions(+)
 create mode 100644 package/libdivsufsort/Config.in
 create mode 100644 package/libdivsufsort/libdivsufsort.hash
 create mode 100644 package/libdivsufsort/libdivsufsort.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 44b19474876b..458da4e4e051 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -798,6 +798,7 @@ F:	configs/stm32f769_disco_sd_defconfig
 F:	package/armadillo/
 F:	package/babeld/
 F:	package/iana-assignments/
+F:	package/libdivsufsort/
 F:	package/sscep/
 F:	package/tinyinit/
 F:	package/uuu/
diff --git a/package/Config.in b/package/Config.in
index e1ceb81dc0a2..40caa6fb3461 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2209,6 +2209,7 @@ menu "Other"
 	source "package/libdaemon/Config.in"
 	source "package/libdex/Config.in"
 	source "package/libdill/Config.in"
+	source "package/libdivsufsort/Config.in"
 	source "package/libeastl/Config.in"
 	source "package/libee/Config.in"
 	source "package/libev/Config.in"
diff --git a/package/libdivsufsort/Config.in b/package/libdivsufsort/Config.in
new file mode 100644
index 000000000000..b00e9c77e5fe
--- /dev/null
+++ b/package/libdivsufsort/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_LIBDIVSUFSORT
+	bool "libdivsufsort"
+	help
+	  libdivsufsort is a software library that implements a
+	  lightweight suffix array construction algorithm.
+
+	  https://github.com/y-256/libdivsufsort
diff --git a/package/libdivsufsort/libdivsufsort.hash b/package/libdivsufsort/libdivsufsort.hash
new file mode 100644
index 000000000000..ed99c2272dd8
--- /dev/null
+++ b/package/libdivsufsort/libdivsufsort.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  705a122a142eda16f05996e56b45247319d140928eec32bd9db6753da13f5b5b  libdivsufsort-5f60d6f026c30fb4ac296f696b3c8b0eb71bd428.tar.gz
+sha256  29f948fde0da0929ee6ed6bf82a96114b992d54a5d906c77a42473df520da764  LICENSE
diff --git a/package/libdivsufsort/libdivsufsort.mk b/package/libdivsufsort/libdivsufsort.mk
new file mode 100644
index 000000000000..1ae2ee487e25
--- /dev/null
+++ b/package/libdivsufsort/libdivsufsort.mk
@@ -0,0 +1,23 @@
+################################################################################
+#
+# libdivsufsort
+#
+################################################################################
+
+LIBDIVSUFSORT_VERSION = 5f60d6f026c30fb4ac296f696b3c8b0eb71bd428
+LIBDIVSUFSORT_SITE = $(call github,y-256,libdivsufsort,$(LIBDIVSUFSORT_VERSION))
+LIBDIVSUFSORT_LICENSE = MIT
+LIBDIVSUFSORT_LICENSE_FILES = LICENSE
+LIBDIVSUFSORT_INSTALL_STAGING = YES
+
+LIBDIVSUFSORT_CONF_OPTS = \
+	-DBUILD_EXAMPLES=OFF \
+	-DBUILD_DIVSUFSORT64=ON
+
+ifeq ($(BR2_STATIC_LIBS),y)
+LIBDIVSUFSORT_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF
+else
+LIBDIVSUFSORT_CONF_OPTS += -DBUILD_SHARED_LIBS=ON
+endif
+
+$(eval $(cmake-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 2/3] package/bsdiff: switch upstream
  2024-10-04 21:54 [Buildroot] [PATCH 1/3] package/libdivsufsort: new package Dario Binacchi
@ 2024-10-04 21:54 ` Dario Binacchi
  2024-10-24 20:31   ` Thomas Petazzoni via buildroot
  2024-10-04 21:54 ` [Buildroot] [PATCH 3/3] DEVELOPERS: add Dario Binacchi for bsdiff Dario Binacchi
  1 sibling, 1 reply; 6+ messages in thread
From: Dario Binacchi @ 2024-10-04 21:54 UTC (permalink / raw)
  To: buildroot; +Cc: Dario Binacchi, linux-amarula, Colin Percival

I asked Colin Percival, the creator of bsdiff, about the failure to
download bsdiff-4.3.tar.gz from  https://www.daemonology.net/bsdiff,
and he kindly replied that he intentionally disabled the package
download because "that code has some security bugs and I didn't have
time to roll a new tarball with them fixed. Grab the bsdiff code from
FreeBSD or Chromium, I'm pretty sure they have all the fixes."

I chose the Chromium version because the FreeBSD one was less suitable
for integration into Buildroot, given that there is no git repository
for the project itself, but rather for all FreeBSD sources (4.7 GB).

C++11 is now mandatory.

Fixes:
- http://autobuild.buildroot.org/results/21bb827d3dbf553c79f49d7c184099c75df3d45d

Cc: Colin Percival <cperciva@freebsd.org>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 .checkpackageignore                            |  1 -
 .../0001-Add-missing-header-for-u_char.patch   | 17 -----------------
 package/bsdiff/Config.in                       |  4 +++-
 package/bsdiff/bsdiff.hash                     |  7 +++----
 package/bsdiff/bsdiff.mk                       | 18 ++++++++----------
 5 files changed, 14 insertions(+), 33 deletions(-)
 delete mode 100644 package/bsdiff/0001-Add-missing-header-for-u_char.patch

diff --git a/.checkpackageignore b/.checkpackageignore
index 0cc742bf0960..98b38a386f01 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -343,7 +343,6 @@ package/brickd/S70brickd Shellcheck lib_sysv.Indent lib_sysv.Variables
 package/bridge-utils/0001-fix-build-on-musl.patch lib_patch.Upstream
 package/brltty/0001-Fix-linking-error-on-mips64el.patch lib_patch.Upstream
 package/brltty/S10brltty Shellcheck lib_sysv.Indent lib_sysv.Variables
-package/bsdiff/0001-Add-missing-header-for-u_char.patch lib_patch.Upstream
 package/bustle/0001-Makefile-fix-pcap-config-call.patch lib_patch.Upstream
 package/busybox/0001-networking-libiproute-use-linux-if_packet.h-instead-.patch lib_patch.Upstream
 package/busybox/0002-Makefile.flags-strip-non-l-arguments-returned-by-pkg.patch lib_patch.Upstream
diff --git a/package/bsdiff/0001-Add-missing-header-for-u_char.patch b/package/bsdiff/0001-Add-missing-header-for-u_char.patch
deleted file mode 100644
index 56affb4102ce..000000000000
--- a/package/bsdiff/0001-Add-missing-header-for-u_char.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-bspatch: Fix missing header <sys/types.h> for u_char
-
-Fixes http://autobuild.buildroot.net/results/31a/31a837cf6e34b02dce498f2b12e40d6d16a5a8e6/
-
-Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
-
-diff -purN bsdiff-4.3.orig/bspatch.c bsdiff-4.3/bspatch.c
---- bsdiff-4.3.orig/bspatch.c	2015-04-30 13:47:26.485903359 +0200
-+++ bsdiff-4.3/bspatch.c	2015-04-30 13:48:14.808908672 +0200
-@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD: src/usr.bin/bsdiff/b
- #include <err.h>
- #include <unistd.h>
- #include <fcntl.h>
-+#include <sys/types.h>
-
- static off_t offtin(u_char *buf)
- {
diff --git a/package/bsdiff/Config.in b/package/bsdiff/Config.in
index 11fd8b9d3523..25295f06e70d 100644
--- a/package/bsdiff/Config.in
+++ b/package/bsdiff/Config.in
@@ -1,8 +1,10 @@
 config BR2_PACKAGE_BSDIFF
 	bool "bsdiff"
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++11
 	select BR2_PACKAGE_BZIP2
+	select BR2_PACKAGE_LIBDIVSUFSORT
 	help
 	  Binary patch/diff like xdelta but creates smaller diffs.
 	  Needs bzip2 support.
 
-	  http://www.daemonology.net/bsdiff/
+	  https://android.googlesource.com/platform/external/bsdiff/
diff --git a/package/bsdiff/bsdiff.hash b/package/bsdiff/bsdiff.hash
index 102086b9fc04..e16d32023e1c 100644
--- a/package/bsdiff/bsdiff.hash
+++ b/package/bsdiff/bsdiff.hash
@@ -1,4 +1,3 @@
-# From http://www.daemonology.net/bsdiff/:
-md5  e6d812394f0e0ecc8d5df255aa1db22a  bsdiff-4.3.tar.gz
-# locally computed
-sha256  fc0a6e634ef77dcf14bf36c7b6d1e57ba1ac5c4809073dfaacb3b5f7ab277eb7  bsdiff.c
+# Locally calculated
+sha256  6f84d3b2f0b758a97e79f6294ed84da4cd5c1a2ab0f7cb3d5ed80fc234e09c32  bsdiff-8c17bdc0d759c8e6da90c5f72b052ba2605a0a3a-git4.tar.gz
+sha256  82d5f69a01bd5b3962ddf42f9346aee41ab80bf4cb67ed8a1ede966e8b080c54  README.chromium
diff --git a/package/bsdiff/bsdiff.mk b/package/bsdiff/bsdiff.mk
index 97a1b3921df4..e9ee9fa1b9f2 100644
--- a/package/bsdiff/bsdiff.mk
+++ b/package/bsdiff/bsdiff.mk
@@ -4,23 +4,21 @@
 #
 ################################################################################
 
-BSDIFF_VERSION = 4.3
-BSDIFF_SITE = http://www.daemonology.net/bsdiff
-BSDIFF_DEPENDENCIES = bzip2
+BSDIFF_VERSION = 8c17bdc0d759c8e6da90c5f72b052ba2605a0a3a
+BSDIFF_SITE = https://chromium.googlesource.com/chromiumos/third_party/bsdiff
+BSDIFF_SITE_METHOD = git
+BSDIFF_DEPENDENCIES = bzip2 libdivsufsort
 BSDIFF_LICENSE = BSD-2-Clause
-BSDIFF_LICENSE_FILES = bsdiff.c
+BSDIFF_LICENSE_FILES = README.chromium
 BSDIFF_CPE_ID_VENDOR = daemonology
 
 define BSDIFF_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
-		$(@D)/bsdiff.c -lbz2 -o $(@D)/bsdiff
-	$(TARGET_MAKE_ENV) $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
-		$(@D)/bspatch.c -lbz2 -o $(@D)/bspatch
+	$(TARGET_MAKE_ENV)  $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
 endef
 
 define BSDIFF_INSTALL_TARGET_CMDS
-	$(INSTALL) -D -m 755 $(@D)/bsdiff $(TARGET_DIR)/usr/bin/bsdiff
-	$(INSTALL) -D -m 755 $(@D)/bspatch $(TARGET_DIR)/usr/bin/bspatch
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
+		DESTDIR=$(TARGET_DIR) install
 endef
 
 $(eval $(generic-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 3/3] DEVELOPERS: add Dario Binacchi for bsdiff
  2024-10-04 21:54 [Buildroot] [PATCH 1/3] package/libdivsufsort: new package Dario Binacchi
  2024-10-04 21:54 ` [Buildroot] [PATCH 2/3] package/bsdiff: switch upstream Dario Binacchi
@ 2024-10-04 21:54 ` Dario Binacchi
  1 sibling, 0 replies; 6+ messages in thread
From: Dario Binacchi @ 2024-10-04 21:54 UTC (permalink / raw)
  To: buildroot; +Cc: Dario Binacchi, linux-amarula

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 DEVELOPERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 458da4e4e051..fea34b53d696 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -797,6 +797,7 @@ F:	configs/stm32f746_disco_sd_defconfig
 F:	configs/stm32f769_disco_sd_defconfig
 F:	package/armadillo/
 F:	package/babeld/
+F:	package/bsdiff/
 F:	package/iana-assignments/
 F:	package/libdivsufsort/
 F:	package/sscep/
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 2/3] package/bsdiff: switch upstream
  2024-10-04 21:54 ` [Buildroot] [PATCH 2/3] package/bsdiff: switch upstream Dario Binacchi
@ 2024-10-24 20:31   ` Thomas Petazzoni via buildroot
  2024-10-30  9:06     ` Dario Binacchi
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-10-24 20:31 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: buildroot, linux-amarula, Colin Percival

Hello Dario,

On Fri,  4 Oct 2024 23:54:45 +0200
Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:

> I asked Colin Percival, the creator of bsdiff, about the failure to

We try to avoid first person singular sentences in commit logs. Either
we use "we", or we turn the sentences around.

> download bsdiff-4.3.tar.gz from  https://www.daemonology.net/bsdiff,
> and he kindly replied that he intentionally disabled the package
> download because "that code has some security bugs and I didn't have
> time to roll a new tarball with them fixed. Grab the bsdiff code from
> FreeBSD or Chromium, I'm pretty sure they have all the fixes."
> 
> I chose the Chromium version because the FreeBSD one was less suitable
> for integration into Buildroot, given that there is no git repository
> for the project itself, but rather for all FreeBSD sources (4.7 GB).

https://chromium.googlesource.com/chromiumos/third_party/bsdiff shows:

  (MOVED) https://android.googlesource.com/platform/external/bsdiff/ fork of bsdiff; http://www.daemonology.net/bsdiff/

Does that mean we should use
https://android.googlesource.com/platform/external/bsdiff/ instead?

That being said, even the repo at
https://chromium.googlesource.com/chromiumos/third_party/bsdiff had its
last commit 10 years ago, so this really looks like unmaintained
software.

Shouldn't we instead just remove it from Buildroot?

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 2/3] package/bsdiff: switch upstream
  2024-10-24 20:31   ` Thomas Petazzoni via buildroot
@ 2024-10-30  9:06     ` Dario Binacchi
  2024-10-30  9:14       ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 6+ messages in thread
From: Dario Binacchi @ 2024-10-30  9:06 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot, linux-amarula, Colin Percival

Hello Thomas,

On Thu, Oct 24, 2024 at 10:31 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Dario,
>
> On Fri,  4 Oct 2024 23:54:45 +0200
> Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:
>
> > I asked Colin Percival, the creator of bsdiff, about the failure to
>
> We try to avoid first person singular sentences in commit logs. Either
> we use "we", or we turn the sentences around.
>
> > download bsdiff-4.3.tar.gz from  https://www.daemonology.net/bsdiff,
> > and he kindly replied that he intentionally disabled the package
> > download because "that code has some security bugs and I didn't have
> > time to roll a new tarball with them fixed. Grab the bsdiff code from
> > FreeBSD or Chromium, I'm pretty sure they have all the fixes."
> >
> > I chose the Chromium version because the FreeBSD one was less suitable
> > for integration into Buildroot, given that there is no git repository
> > for the project itself, but rather for all FreeBSD sources (4.7 GB).
>
> https://chromium.googlesource.com/chromiumos/third_party/bsdiff shows:
>
>   (MOVED) https://android.googlesource.com/platform/external/bsdiff/ fork of bsdiff; http://www.daemonology.net/bsdiff/
>
> Does that mean we should use
> https://android.googlesource.com/platform/external/bsdiff/ instead?
>
> That being said, even the repo at
> https://chromium.googlesource.com/chromiumos/third_party/bsdiff had its
> last commit 10 years ago, so this really looks like unmaintained
> software.

The FreeBSD version (i.e., https://github.com/freebsd/freebsd-src.git)
has more recent
commits for bsdiff and bspatch, but it’s a container repository for
many other projects (4.7GB)
and not specific to bsdiff. I do not know if it’s possible to extract
just that project. Any ideas?
Otherwise, would it be better to remove the package from buildroot?

Thanks and regards,
Dario

>
> Shouldn't we instead just remove it from Buildroot?


>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com



--

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 2/3] package/bsdiff: switch upstream
  2024-10-30  9:06     ` Dario Binacchi
@ 2024-10-30  9:14       ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-10-30  9:14 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: buildroot, linux-amarula, Colin Percival

On Wed, 30 Oct 2024 10:06:42 +0100
Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:

> Otherwise, would it be better to remove the package from buildroot?

Yes, that was the feedback also from Arnout yesterday: let's remove
bsdiff entirely. It has no upstream, it's no longer maintained, so
let's drop it.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-10-30  9:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 21:54 [Buildroot] [PATCH 1/3] package/libdivsufsort: new package Dario Binacchi
2024-10-04 21:54 ` [Buildroot] [PATCH 2/3] package/bsdiff: switch upstream Dario Binacchi
2024-10-24 20:31   ` Thomas Petazzoni via buildroot
2024-10-30  9:06     ` Dario Binacchi
2024-10-30  9:14       ` Thomas Petazzoni via buildroot
2024-10-04 21:54 ` [Buildroot] [PATCH 3/3] DEVELOPERS: add Dario Binacchi for bsdiff Dario Binacchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox