FS#54996 - [lz4] Static library liblz4.a and lz4frame_static.h missing.

Attached to Project: Arch Linux
Opened by Ido Rosen (idorosen) - Tuesday, 01 August 2017, 04:55 GMT
Last edited by Doug Newgard (Scimmia) - Wednesday, 02 August 2017, 12:28 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
There is no separate lz4-devel package.
This patch needs to go into the lz4 package so that the static library liblz4.a and the associated include file lz4frame_static.h are installed.

Patch is attached and also pasted below:


diff --git a/lz4/trunk/PKGBUILD b/lz4/trunk/PKGBUILD
index 779934b1e4a..456090d303d 100644
--- a/lz4/trunk/PKGBUILD
+++ b/lz4/trunk/PKGBUILD
@@ -12,8 +12,15 @@ license=('GPL2')
makedepends=('git')
checkdepends=('diffutils')
depends=('glibc')
-source=("git+https://github.com/lz4/lz4.git#tag=v$pkgver")
-md5sums=('SKIP')
+source=("git+https://github.com/lz4/lz4.git#tag=v$pkgver"
+ "fix-static.patch")
+md5sums=('SKIP' 'SKIP')
+options=('!staticlibs')
+
+prepare() {
+ cd "${srcdir}/${pkgname}"
+ patch -p1 < "${srcdir}/fix-static.patch"
+}

build() {
# do not use the main makefile, it calls sub make with -e
diff --git a/lz4/trunk/fix-static.patch b/lz4/trunk/fix-static.patch
new file mode 100644
index 00000000000..a79f2dd0daf
--- /dev/null
+++ b/lz4/trunk/fix-static.patch
@@ -0,0 +1,21 @@
+diff --git a/lib/Makefile b/lib/Makefile
+index c6fd7b8..c09fc37 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -42,7 +42,7 @@ LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT))
+ LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT))
+ LIBVER := $(shell echo $(LIBVER_SCRIPT))
+
+-BUILD_STATIC:= yes
++BUILD_STATIC:=yes
+
+ CPPFLAGS+= -DXXH_NAMESPACE=LZ4_
+ CFLAGS ?= -O3
+@@ -157,6 +157,7 @@ endif
+ @$(INSTALL_DATA) lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h
+ @$(INSTALL_DATA) lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h
+ @$(INSTALL_DATA) lz4frame.h $(DESTDIR)$(INCLUDEDIR)/lz4frame.h
++ @$(INSTALL_DATA) lz4frame_static.h $(DESTDIR)$(INCLUDEDIR)/lz4frame_static.h
+ @echo lz4 static and shared libraries installed
+
+ uninstall:
This task depends upon

Closed by  Doug Newgard (Scimmia)
Wednesday, 02 August 2017, 12:28 GMT
Reason for closing:  Not a bug
Comment by Allan McRae (Allan) - Tuesday, 01 August 2017, 05:10 GMT
Arch Linux does not package static libraries unless there is a very good reason.
Comment by Ido Rosen (idorosen) - Tuesday, 01 August 2017, 05:22 GMT
It is the same set of reasons the zlib package comes with its static /usr/lib/libz.a. :-)

lz4 is a compression scheme optimized for throughput and shared linkage defeats the purpose in many applications.
Many applications statically link liblz4.a...

The lz4 binary does not actually depend on liblz4.so (lz4 shared library), which is included in the package. Static linkage is used even for its own binary.
Comment by Bartłomiej Piotrowski (Barthalion) - Tuesday, 01 August 2017, 07:35 GMT
The reason zlib ships its static library is binutils testsuite, nothing else.

Loading...