Skip to contentSkip to conversation

package/p7zip: add 7za support

PATCH Applied Fabrice Fontaine 3 participants 3 messages Oct 25, 2021 – Dec 5, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/p7zip: add 7za support

Add 7za stand-alone executable as 7zr is a "light-version" of 7za that only handles 7z archives and cannot handle encrypted archives.

Fixes:
- https://bugs.buildroot.org/show_bug.cgi?id=14266

---
Changes v1 -> v2 (after review of Arnout Vandecappelle):
- Add a dedicated option

 package/p7zip/Config.in | 22 ++++++++++++++++++++++
 package/p7zip/p7zip.mk  | 11 +++++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)
package/p7zip/Config.in +22 -0
index badfb9b9e8..3b30fd71cc 100644
@@ -12,6 +12,28 @@ config BR2_PACKAGE_P7ZIP
 
 	  http://sourceforge.net/projects/p7zip
 
+if BR2_PACKAGE_P7ZIP
+
+choice
+	prompt "p7zip binary"
+	default BR2_PACKAGE_P7ZIP_7ZR
+
+config BR2_PACKAGE_P7ZIP_7ZA
+	bool "7za"
+	help
+	  Stand-alone executable that handles fewer archive formats
+	  than 7z
+
+config BR2_PACKAGE_P7ZIP_7ZR
+	bool "7zr"
+	help
+	  Stand-alone executable which is a "light-version" of 7za that
+	  only handles 7z archives and cannot handle encrypted archives
+
+endchoice
+
+endif
+
 comment "p7zip needs a toolchain w/ threads, wchar, C++"
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || !BR2_INSTALL_LIBSTDCPP
package/p7zip/p7zip.mk +9 -2
index f94b55ecd2..b6c5adae26 100644
@@ -10,6 +10,12 @@ P7ZIP_LICENSE = LGPL-2.1+ with unRAR restriction
 P7ZIP_LICENSE_FILES = DOC/License.txt
 P7ZIP_CPE_ID_VENDOR = 7-zip
 
+ifeq ($(BR2_PACKAGE_P7ZIP_7ZA),y)
+P7ZIP_TARGET = 7za
+else
+P7ZIP_TARGET = 7zr
+endif
+
 # p7zip buildsystem is a mess: it plays dirty tricks with CFLAGS and
 # CXXFLAGS, so we can't pass them. Instead, it accepts ALLFLAGS_C
 # and ALLFLAGS_CPP as variables to pass the CFLAGS and CXXFLAGS.
@@ -17,11 +23,12 @@ define P7ZIP_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" ALLFLAGS_C="$(TARGET_CFLAGS)" \
 		CXX="$(TARGET_CXX)" ALLFLAGS_CPP="$(TARGET_CXXFLAGS)" \
 		LDFLAGS="$(TARGET_LDFLAGS)" \
-		-C $(@D) 7zr
+		-C $(@D) $(P7ZIP_TARGET)
 endef
 
 define P7ZIP_INSTALL_TARGET_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/bin/7zr $(TARGET_DIR)/usr/bin/7zr
+	$(INSTALL) -D -m 0755 $(@D)/bin/$(P7ZIP_TARGET) \
+		$(TARGET_DIR)/usr/bin/$(P7ZIP_TARGET)
 endef
 
 $(eval $(generic-package))
Signature · 6 lines
2.33.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 20 lines · Fabrice Fontaine

Add 7za stand-alone executable as 7zr is a "light-version" of 7za that only handles 7z archives and cannot handle encrypted archives.

Fixes:
- https://bugs.buildroot.org/show_bug.cgi?id=14266

---
Changes v1 -> v2 (after review of Arnout Vandecappelle):
- Add a dedicated option

  package/p7zip/Config.in | 22 ++++++++++++++++++++++
  package/p7zip/p7zip.mk  | 11 +++++++++--
  2 files changed, 31 insertions(+), 2 deletions(-)
package/p7zip/Config.in +0 -0
index badfb9b9e8..3b30fd71cc 100644

package/p7zip/Config.in config BR2_PACKAGE_P7ZIP · line 19

Quoted 8 lines
package/p7zip/Config.in +5 -0
@@ -12,6 +12,28 @@ config BR2_PACKAGE_P7ZIP
 
  	  http://sourceforge.net/projects/p7zip
 
+if BR2_PACKAGE_P7ZIP
+
+choice
+	prompt "p7zip binary"
+	default BR2_PACKAGE_P7ZIP_7ZR

Unfortunately, this means 7za will never be built in the autobuilders, because
they don't randomize choices. Oh well, tough luck.

Applied to master, thanks.

Regards,
Arnout

Quoted 43 lines
package/p7zip/Config.in +17 -0
+
+config BR2_PACKAGE_P7ZIP_7ZA
+	bool "7za"
+	help
+	  Stand-alone executable that handles fewer archive formats
+	  than 7z
+
+config BR2_PACKAGE_P7ZIP_7ZR
+	bool "7zr"
+	help
+	  Stand-alone executable which is a "light-version" of 7za that
+	  only handles 7z archives and cannot handle encrypted archives
+
+endchoice
+
+endif
+
  comment "p7zip needs a toolchain w/ threads, wchar, C++"
  	depends on BR2_TOOLCHAIN_HAS_SYNC_4
  	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || !BR2_INSTALL_LIBSTDCPP
package/p7zip/p7zip.mk +6 -1
index f94b55ecd2..b6c5adae26 100644
@@ -10,6 +10,12 @@ P7ZIP_LICENSE = LGPL-2.1+ with unRAR restriction
  P7ZIP_LICENSE_FILES = DOC/License.txt
  P7ZIP_CPE_ID_VENDOR = 7-zip
 
+ifeq ($(BR2_PACKAGE_P7ZIP_7ZA),y)
+P7ZIP_TARGET = 7za
+else
+P7ZIP_TARGET = 7zr
+endif
+
  # p7zip buildsystem is a mess: it plays dirty tricks with CFLAGS and
  # CXXFLAGS, so we can't pass them. Instead, it accepts ALLFLAGS_C
  # and ALLFLAGS_CPP as variables to pass the CFLAGS and CXXFLAGS.
@@ -17,11 +23,12 @@ define P7ZIP_BUILD_CMDS
  	$(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" ALLFLAGS_C="$(TARGET_CFLAGS)" \
  		CXX="$(TARGET_CXX)" ALLFLAGS_CPP="$(TARGET_CXXFLAGS)" \
  		LDFLAGS="$(TARGET_LDFLAGS)" \
-		-C $(@D) 7zr

package/p7zip/p7zip.mk define P7ZIP_BUILD_CMDS · line 34

Quoted 10 lines
package/p7zip/p7zip.mk +3 -1
+		-C $(@D) $(P7ZIP_TARGET)
  endef
 
  define P7ZIP_INSTALL_TARGET_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/bin/7zr $(TARGET_DIR)/usr/bin/7zr
+	$(INSTALL) -D -m 0755 $(@D)/bin/$(P7ZIP_TARGET) \
+		$(TARGET_DIR)/usr/bin/$(P7ZIP_TARGET)
  endef
 
  $(eval $(generic-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
Quoted 34 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Quoted 21 lines · Fabrice Fontaine

Add 7za stand-alone executable as 7zr is a "light-version" of 7za that only handles 7z archives and cannot handle encrypted archives.

Fixes:
- https://bugs.buildroot.org/show_bug.cgi?id=14266

---
Changes v1 -> v2 (after review of Arnout Vandecappelle):
- Add a dedicated option

package/p7zip/Config.in | 22 ++++++++++++++++++++++ package/p7zip/p7zip.mk | 11 +++++++++--

2 files changed, 31 insertions(+), 2 deletions(-)
package/p7zip/Config.in +0 -0
index badfb9b9e8..3b30fd71cc 100644
@@ -12,6 +12,28 @@ config BR2_PACKAGE_P7ZIP

http://sourceforge.net/projects/p7zip

package/p7zip/Config.in config BR2_PACKAGE_P7ZIP · line 19

Quoted 5 lines
package/p7zip/Config.in +5 -0
+if BR2_PACKAGE_P7ZIP
+
+choice
+	prompt "p7zip binary"
+	default BR2_PACKAGE_P7ZIP_7ZR

Unfortunately, this means 7za will never be built in the
autobuilders, because they don't randomize choices. Oh well, tough luck.

Quoted 1 line

Applied to master, thanks.

Next, not master.

Quoted 6 lines

package/p7zip/Config.in config BR2_PACKAGE_P7ZIP · line 25

Quoted 6 lines
package/p7zip/Config.in +6 -0
+
+config BR2_PACKAGE_P7ZIP_7ZA
+	bool "7za"
+	help
+	  Stand-alone executable that handles fewer archive formats
+	  than 7z

I guess this text is taken from the man page:

https://linux.die.net/man/1/7za

But it doesn't really make much sense if we don't provide the full 7z. As a user it isn't really clear if I want "..that handles fewer archive formats" or "a light-version of 7za".

Perhaps the z7a help text should be something like:

Full 7za archiver. The program supports 7z, ZIP, CAB, ARJ, GZIP, BZIP2, TAR, CPIO, RPM and DEB formats

(also from the man page).

And for 7zr:

Lightweight 7zr archiver. The program only handles 7z archives and cannot handle encrypted archives

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot