Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH V2] package/lzma-alone: new package
@ 2022-03-08 18:35 Rafał Miłecki
  2022-03-09 22:08 ` Yann E. MORIN
  0 siblings, 1 reply; 4+ messages in thread
From: Rafał Miłecki @ 2022-03-08 18:35 UTC (permalink / raw)
  To: buildroot; +Cc: Rafał Miłecki, Thomas Petazzoni

From: Rafał Miłecki <rafal@milecki.pl>

This new package provides "lzma_alone" host binary based on the original
LZMA SDK. It provides few extra options when compared to the LZMA Utils
/ XZ Utils project "lzma" binary (already packaged as the "lzma").

This packaging schema (LZMA SDK with lzma -> lzma_alone rename) follows
Debian's solution. Please note that Debian also uses LZMA SDK for the
base "lzma" tool which may be considered for Buildroot too - as an
independent change. Similar packaging is also used by Ubuntu & Arch.

lzma_alone is a requirement for preparing firmware images for some
Broadcom based home routers with a picky CFE bootloader. It has limited
LZMA support and building compatible images requires specifying
dictionary size and lc/lp/pb LZMA values manually.

Version 9.22 is used as it's the last release using .tar.bz2 format. The
same version is used by Debian.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
Hi, this is V2 of my following old attempt:

[PATCH] package/lzma-alone: new package
https://patchwork.ozlabs.org/project/buildroot/patch/20201026213433.4309-1-zajec5@gmail.com/

It doesn't seem like I'm going to get V1 properly reviewed / commented
so let me try with V2 with changes I think were expected.
---
 package/Config.in.host             |  1 +
 package/lzma-alone/Config.in.host  | 18 ++++++++++++++++++
 package/lzma-alone/lzma-alone.hash |  1 +
 package/lzma-alone/lzma-alone.mk   | 22 ++++++++++++++++++++++
 4 files changed, 42 insertions(+)
 create mode 100644 package/lzma-alone/Config.in.host
 create mode 100644 package/lzma-alone/lzma-alone.hash
 create mode 100644 package/lzma-alone/lzma-alone.mk

diff --git a/package/Config.in.host b/package/Config.in.host
index e5fbb07fc2..cd1c34b5a3 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -50,6 +50,7 @@ menu "Host utilities"
 	source "package/lld/Config.in.host"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/lttng-babeltrace/Config.in.host"
+	source "package/lzma-alone/Config.in.host"
 	source "package/mender-artifact/Config.in.host"
 	source "package/meson-tools/Config.in.host"
 	source "package/mfgtools/Config.in.host"
diff --git a/package/lzma-alone/Config.in.host b/package/lzma-alone/Config.in.host
new file mode 100644
index 0000000000..053b869635
--- /dev/null
+++ b/package/lzma-alone/Config.in.host
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_HOST_LZMA_ALONE
+	bool "host lzma-alone"
+	help
+	  LZMA has two well-known command-line tools:
+	  1. lzma from LZMA SDK
+	  2. lzma from XZ Utils (previously LZMA Utils)
+
+	  This package provides the former one which:
+	  1. Gives more control over compression parameters
+	  2. Gets named lzma_alone to allow coexistence
+
+	  This tool may be used to prepare firmwares for bootloaders
+	  with limited LZMA support.
+	  E.g. Broadcom's CFE bootloader for MIPS BCM47xx devices is
+	  known to fail to boot images using LZMA compression with
+	  dictionary.
+
+	  https://www.7-zip.org/sdk.html
diff --git a/package/lzma-alone/lzma-alone.hash b/package/lzma-alone/lzma-alone.hash
new file mode 100644
index 0000000000..39759c4e3b
--- /dev/null
+++ b/package/lzma-alone/lzma-alone.hash
@@ -0,0 +1 @@
+sha256	9aade84f229fb25f7aef39d8866b375fe6d35a9e18098d7cd86a99e294902944	lzma922.tar.bz2
diff --git a/package/lzma-alone/lzma-alone.mk b/package/lzma-alone/lzma-alone.mk
new file mode 100644
index 0000000000..6258bb4a95
--- /dev/null
+++ b/package/lzma-alone/lzma-alone.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# lzma-alone
+#
+################################################################################
+
+LZMA_ALONE_VERSION = 9.22
+LZMA_ALONE_SITE = https://sourceforge.net/projects/sevenzip/files/LZMA%20SDK
+LZMA_ALONE_SOURCE = lzma922.tar.bz2
+LZMA_ALONE_STRIP_COMPONENTS = 0
+LZMA_ALONE_LICENSE = LGPL-2.1-or-later, BSD-3-Clause
+
+define HOST_LZMA_ALONE_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)/C/Util/Lzma -f makefile.gcc
+	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)/CPP/7zip/Bundles/LzmaCon -f makefile.gcc
+endef
+
+define HOST_LZMA_ALONE_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/CPP/7zip/Bundles/LzmaCon/lzma $(HOST_DIR)/bin/lzma_alone
+endef
+
+$(eval $(host-generic-package))
-- 
2.34.1

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

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

end of thread, other threads:[~2022-03-10 20:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-08 18:35 [Buildroot] [PATCH V2] package/lzma-alone: new package Rafał Miłecki
2022-03-09 22:08 ` Yann E. MORIN
2022-03-10 14:12   ` Rafał Miłecki
2022-03-10 20:29     ` Arnout Vandecappelle

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