Skip to content

Commit

Permalink
add lz4
Browse files Browse the repository at this point in the history
  • Loading branch information
ahgamut committed Dec 8, 2023
1 parent 1b27c08 commit 325438d
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ compress/pigz-2.8.built.$(ARCH): compress/zlib-1.3.built.$(ARCH)
compress/gzip-1.13.built.$(ARCH): compress/zlib-1.3.built.$(ARCH)

compress: cosmo-repo-thirdparty.built.$(ARCH)\
compress/lz4-1.9.4.built.$(ARCH)\
compress/pigz-2.8.built.$(ARCH)\
compress/xz-5.4.3.built.$(ARCH)\
compress/brotli-1.1.0.built.$(ARCH)\
Expand Down
58 changes: 58 additions & 0 deletions compress/lz4-1.9.4/minimal.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
--- lz4-1.9.4/programs/Makefile 2022-08-15 22:45:31.000000000 +0000
+++ - 2023-12-08 02:23:23.638015809 +0000
@@ -157,7 +157,7 @@
# directory variables : GNU conventions prefer lowercase
# see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
# support both lower and uppercase (BSD), use lowercase in script
-PREFIX ?= /usr/local
+PREFIX ?= ${COSMOS}
prefix ?= $(PREFIX)
EXEC_PREFIX ?= $(prefix)
exec_prefix ?= $(EXEC_PREFIX)
--- lz4-1.9.4/lib/Makefile 2022-08-15 22:45:31.000000000 +0000
+++ - 2023-12-08 02:24:29.553313505 +0000
@@ -43,7 +43,7 @@
LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT))
LIBVER := $(shell echo $(LIBVER_SCRIPT))

-BUILD_SHARED:=yes
+BUILD_SHARED:=no
BUILD_STATIC:=yes

CPPFLAGS+= -DXXH_NAMESPACE=LZ4_
@@ -83,7 +83,7 @@
lib-release: lib

.PHONY: lib
-lib: liblz4.a liblz4
+lib: liblz4.a

.PHONY: all
all: lib
@@ -151,7 +151,7 @@
# directory variables : GNU conventions prefer lowercase
# see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
# support both lower and uppercase (BSD), use lower in script
-PREFIX ?= /usr/local
+PREFIX ?= ${COSMOS}
prefix ?= $(PREFIX)
EXEC_PREFIX ?= $(prefix)
exec_prefix ?= $(EXEC_PREFIX)
--- lz4-1.9.4/Makefile 2022-08-15 22:45:31.000000000 +0000
+++ - 2023-12-08 02:27:13.319106238 +0000
@@ -54,13 +54,13 @@
.PHONY: lib lib-release liblz4.a
lib: liblz4.a
lib lib-release liblz4.a:
- $(MAKE) -C $(LZ4DIR) $@
+ $(MAKE) -j$(MAXPROC) -C $(LZ4DIR) $@

.PHONY: lz4 lz4-release
lz4 : liblz4.a
lz4-release : lib-release
lz4 lz4-release :
- $(MAKE) -C $(PRGDIR) $@
+ $(MAKE) -j$(MAXPROC) -C $(PRGDIR) $@
cp $(PRGDIR)/lz4$(EXT) .

.PHONY: examples
36 changes: 36 additions & 0 deletions compress/lz4-1.9.4/superconfigure
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e

# check for cosmo dirs
if [ -z ${COSMO+x} ]; then
echo "could not find COSMO source directory!";
exit 1
fi

if [ -z ${COSMOS+x} ]; then
echo "could not find COSMOS install directory!";
exit 1
fi

if [[ -f sources.tar.gz ]]; then
# we already downloaded it
cd lz4*
make V=0 -s -i clean
cd ..
else
# download the source code
wget -q https://github.com/lz4/lz4/archive/refs/tags/v1.9.4.tar.gz -O sources.tar.gz
tar -xf sources.tar.gz

# apply patches if any
patch -p0 -i minimal.diff
fi

# go into the source folder, configure
cd lz4*

# run make and/or make install
make V=0 -s -j$MAXPROC
make install V=0 -s -j$MAXPROC

echo "DONE."

0 comments on commit 325438d

Please sign in to comment.