summaryrefslogtreecommitdiff
path: root/app-arch/lz4
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-arch/lz4
reinit the tree, so we can have metadata
Diffstat (limited to 'app-arch/lz4')
-rw-r--r--app-arch/lz4/Manifest18
-rw-r--r--app-arch/lz4/files/lz4-0_p106-cflags.patch22
-rw-r--r--app-arch/lz4/files/lz4-0_p106-install-to-bindir.patch51
-rw-r--r--app-arch/lz4/files/lz4-0_p131-static-libs.patch49
-rw-r--r--app-arch/lz4/lz4-0_p106-r1.ebuild61
-rw-r--r--app-arch/lz4/lz4-0_p120.ebuild48
-rw-r--r--app-arch/lz4/lz4-0_p131-r1.ebuild64
-rw-r--r--app-arch/lz4/lz4-0_p131.ebuild57
-rw-r--r--app-arch/lz4/lz4-1.7.5-r1.ebuild38
-rw-r--r--app-arch/lz4/lz4-1.8.0.ebuild37
-rw-r--r--app-arch/lz4/lz4-9999.ebuild33
-rw-r--r--app-arch/lz4/metadata.xml18
12 files changed, 496 insertions, 0 deletions
diff --git a/app-arch/lz4/Manifest b/app-arch/lz4/Manifest
new file mode 100644
index 000000000000..3a346984a6d3
--- /dev/null
+++ b/app-arch/lz4/Manifest
@@ -0,0 +1,18 @@
+AUX lz4-0_p106-cflags.patch 630 SHA256 fa5a2e429ff7bfc5ff3fd02e5e8078d44f7c704c402d259546c00ad497d445c4 SHA512 0c7cc51229fe20ee0c5e5cb3d933f924750fe3aaa0e97ac78f1f74e4810bf4d9d431990cf12992f25f29dfaffb9dc66b42f3ab6d49147ff881a5cbe49990a89d WHIRLPOOL 754ab3e1cc255ff5226771edc9e9fd977644cf887c49048f4ac1df4e07a347a9dd707aecf952c6223f9b23944b5051fb0032a0605e00964d3ab6af91cc7d93a9
+AUX lz4-0_p106-install-to-bindir.patch 2141 SHA256 3799ef8a56f5cbeecd5f6ceb8716454990087965136322ccd99c6911e60dc924 SHA512 853be770173b46188c4f293f13c263053fd3837c23e959b2d19e36c5d3c8c04798b619224fe02b20f414494baf4db4235b7c223ce665b9b90f14a655c8303f8c WHIRLPOOL 6aac55ec15e8b82a16b06faa50bcb362ace5100bab3788d81ed3618f6efae787664855db14bd0f5393624647d13df40214f873ee7da24d505f9aa4fb371bcdf5
+AUX lz4-0_p131-static-libs.patch 1515 SHA256 62b9f3fb9aa0b22d7aac8ce6fb7aa9acdb83c5eb8dbfce719fdd43e0ca939e3d SHA512 caa55637529c3b723d95965eb1c3ece4551abac6bbaa16cd8c6eae05a41e8be2cde9d67c2099d47a4d62f4e9edeeaf87e532e11fce94bfea953132b5bd7a4732 WHIRLPOOL bc5e7da4bb35c482ea62abfa77a65826427e835509741880ba7f28d005dda3c8c9ae51bed1fbbf4fd9f9b405580c1ba55fdde7b60195e0173f7dd28ae7612c47
+DIST lz4-0_p106.tar.xz 129352 SHA256 a9a09c4ebb962995d10e7e4f7d9224aaa93f308899de18a414948a58e87b6f22 SHA512 8b2bafbf78be7c42831e264d7acdca12712c88369cecdb3aa4621c84bb6b450c372f5153f7c3939a5f70d5810c62b98993697397319d286a1bb51b1e4a6ecde6 WHIRLPOOL fc5bb47b73606b125d8e155365d1fe101083e68e684ffd6014440e0f1416f1f6ecc64b797083e6939bd3e8cd42018e46a1864ae4542160c96933a47df9421a42
+DIST lz4-1.7.5.tar.gz 208019 SHA256 0190cacd63022ccb86f44fa5041dc6c3804407ad61550ca21c382827319e7e7e SHA512 b4e5b17fe06805e676608e636a45f0b480b79a02c6b7ffce84dc4d607861cb2652b2852493ab9d9249e7caeae6f00b6834801fdc39f58d901cbc1c7347915295 WHIRLPOOL 961c56f36a78a4703403a95b54efed8fe859b7ae6327a1318112e322052655aa379e37c34a1d9e8f11397e4f3e14b5f1dfe60083e253dbf20fbbbbb753c28c1b
+DIST lz4-1.8.0.tar.gz 222840 SHA256 2ca482ea7a9bb103603108b5a7510b7592b90158c151ff50a28f1ca8389fccf6 SHA512 aea46d4a900a3ede7dd7b498ee938ecd98397d3277c5b3a85b4236a44777cba85cd68a2f32c993b872afda96c5dafe0cb3dd391101fe8181e17c9f48884c1535 WHIRLPOOL bb32fe1dde5466e4dc9a9144dba305c6bf57dc0b824063e14f87ed900e87c214598dc18562e4555cdca75d7cca705413c7458b1d0bf449cc3752fbfa1fdea009
+DIST lz4-r120.tar.gz 161950 SHA256 fa02b1bcc26529c27cff0883d830914bdd1ba41a87035313e1050302f17e4b07 SHA512 8b27c57737ba4c2c8e4f00f7ce13f6edc91f74885bad66dd521dfe85d427e0fd78a300896d599bb8642a34fba78446daf207d1b2fd8e91543d4c093e53694e86 WHIRLPOOL 6a0cd7f8caf9799130b13b3f282197b5ef20fb987f0f5f6911f71a0f5d5d37c542976be5f13bdd2e21a8edd0a6cc8408fcc0f69f6354a0fbc7df75b22fb9de91
+DIST lz4-r131.tar.gz 133784 SHA256 9d4d00614d6b9dec3114b33d1224b6262b99ace24434c53487a0c8fd0b18cfed SHA512 60bd95d529691ffee2c43f0d8a62484c3cff74c0154094f073192606806ac8182dced61e0534ffa7e0ccf5f18e9a8cfd2738883a83814c0711a6d7f1d1b252e5 WHIRLPOOL d605dbada1d4eb84eb6f3f45417eaa35433b1e3e875af560bb5fa06f0465f1652fab74c094d0d743e0034abc0067c83114827e21baea69d5c3d6d95062d0f660
+EBUILD lz4-0_p106-r1.ebuild 1271 SHA256 fb2df96be7f4bc701a992c1e71cb271799756c19c6cc12331f8fdd3cabf9d168 SHA512 7bfd1129e14b73a28c8970c3ec93a9fa81725e89ceb6fd65f31e0a6885acb260d76fc8185a1e44d66861d83335eaa3ba8dbbb52e0a3668b9114b72e5f9ff597b WHIRLPOOL bc7e50c59580324d6cecebb33c12f3e011769d8d88a20d4cf6c773a5c7f8c803f34149cf5906c44ca9ca345697dcbbd518f75e73cef2e9650e9923633791972d
+EBUILD lz4-0_p120.ebuild 1179 SHA256 b3a755032e9d4c497a5b3af7236c73c80b223552e7504336d400f3366a56d40a SHA512 fc9390f7feea6763cb8f75713154b01f3e2b97acf0d0964d3c38644ee38d97bd46a474780254fb44315c0561f2191cfa2bb86387e9e2704afc989480726888db WHIRLPOOL 325aa596fb1d061177e5019f54e4a4ada87730f3f0af1f0e65bb8584785af74b1ede06ad8d00ed8ac3aad8437027ef94331db525da4eac76ef25a4114d1fc16d
+EBUILD lz4-0_p131-r1.ebuild 1665 SHA256 72f6cc147039298a6fbef3b2351a04b69471ae2b47f63e508902a6d6fe935f32 SHA512 f146c7c9202873973b676e197141618439a4b20253715284a0a2cbf0ee3193e65cc80157a5da152277b21fb188e89be1704dbf176e2035d0c39e7c2814bd6d73 WHIRLPOOL 5723ba7250d6407008098cbd857c617ec3e14b2373bfc731572f40d97c7c1469eb6146c35b226c3173bf83b7022b7ae5af16ae58cfbe0f347596059670fc853a
+EBUILD lz4-0_p131.ebuild 1521 SHA256 dc330af4207f4d6c93b58c6a57a502667a465b9d82191d2c29cf029afe9e0bc3 SHA512 466cf8f24471af82f9789dc02ff9b93d69a450f7ec768e3d5c4f2a374ae36a46209d39859701cbd7856b7600dc1d33fbf993d1651cc56338601390f72f78e61c WHIRLPOOL 4d82d332b6e195ab0fc4b7a1a87266c001f009dec587602641254d209cbcf4549d282bfc49c0df4c9f88e98d217d2706a9c61a6032dbaa82de71c639afa7b187
+EBUILD lz4-1.7.5-r1.ebuild 1033 SHA256 1bd93283b697ea419de4f157f0c40e3e1da5b9643f3c19d176b47213c087ebc0 SHA512 763b64264b063b7066052ead680c262ce1019ddd41dd627dc76d38eb72b2ba9e1da23df7356188901fc92984822563179df9e06df975976c988e7bfd86c7b9ee WHIRLPOOL c90044e2f9456ce98f0e14c266c81eea3e7ccc9896a7e16fcc7a66d165b6b7ef5fb79844c660c55038b9a3aa26f161ca7dfd5e03c7130a74e9b2e74ced05cd22
+EBUILD lz4-1.8.0.ebuild 1056 SHA256 7dd33e195ac05e42424a1e785b3b8c0477ecddc80ae86529cebb630e5755cf84 SHA512 86c066c80879f0eb335aafa5c5c86d081bb96e3c68f07d644ad2ee124fb82c978dcd01a73f6232ca453a929f58235ec92e1b4a2b56680aab6d34699011f32736 WHIRLPOOL b009a5f58cc723fa2a0380ccdd032eb392d155de9820695d2aeac7c4b38889b5ac6bdabd8b814de5e64bda5035c3b49141d37f152378899bbc29a916313e6e1d
+EBUILD lz4-9999.ebuild 824 SHA256 89a4e69f60bfb8e54a6c14544213f4a950429ede79b57f8cfad79c35c43661af SHA512 f28250733aa50bab0d908f5288d69d3d78af865433864716474d6d8fc639a44de61fb25dff06614bee003b9fee1d1a71528f9b96d2347c3562a5eb5736a340a9 WHIRLPOOL 2d4a59de834095e6a1161de610ed80a81d5c7ef2160fdee1d9010e75d7f019cd5e7c8b8ae6e194d4196bb5c061e09c9f3c98f257d32fe3b57249c72cba291493
+MISC ChangeLog 5889 SHA256 45088ed2b789596971f0e6e989edeeac080288a41fda7e5b83c9c257b00fc1e3 SHA512 3319133a34670593097d5436bf7a9cf72b55cfa2e3356d87e9482b065e42a444b9a506aa94d9055acabdb6c9a6dc366b110b95586c39bc3087a7453737d5643b WHIRLPOOL 5cc271fe5333d27db38ae24175bdf7b34f4c0cf02b269568921f2201b78c1952d0742e4be68a374087f5a77b0afd888bbfa76570f50a1af7fab7803827d6f941
+MISC ChangeLog-2015 5612 SHA256 c14d88245bbed1a6330d366fd32c7036be040dc2f5dda355d76657f034343453 SHA512 c5e96dc8ddf42733be0273c2f48dc2c58a994fbb467752b396118f6cfa32c9528e377b0e731dea340a2adec33b1b1835bce9c0f5e0b201f9a7880227eb29a4a6 WHIRLPOOL d66ff4e7b636b62d7bcfe2ee8a22412b2bbe6f2c1c757c5b73b9253391cdd29e6e0b09bb3b64f99cf88c2d3cff77400f779fd373a2b3ffae49aefd3325c870cc
+MISC metadata.xml 516 SHA256 f55e831a8af90be1cb9e4c0e1fa634f287fa9ca0439d4a2886db5949e9836137 SHA512 b559b65a4eebe71824ad3cd46c1ef3aabcc1c43f4312cb2e1072f0e7ab4396890696ef7450d7a41a2e03498db9da9e6823f9d8de4d413a0244607b85192efaa8 WHIRLPOOL 24b90d31f4728b01fb8899362ed7719a48f6f0921062d1d6c3f7a221e55c8cd9ef7c4c33ada9643246c30f29a161d01b057e70dc93a735de5623b147cf1e7f14
diff --git a/app-arch/lz4/files/lz4-0_p106-cflags.patch b/app-arch/lz4/files/lz4-0_p106-cflags.patch
new file mode 100644
index 000000000000..6fc0fbb47dd8
--- /dev/null
+++ b/app-arch/lz4/files/lz4-0_p106-cflags.patch
@@ -0,0 +1,22 @@
+--- a/cmake/pack/CMakeLists.txt
++++ b/cmake/pack/CMakeLists.txt
+@@ -36,7 +36,7 @@
+ ADD_DEFINITIONS("-Wundef")
+ ADD_DEFINITIONS("-Wcast-align")
+ ADD_DEFINITIONS("-Wno-implicit-function-declaration")
+-ADD_DEFINITIONS("-O3 -march=native -std=c99")
++ADD_DEFINITIONS("-std=c99")
+ INCLUDE_DIRECTORIES (${SRC_DIR})
+
+
+--- a/cmake/CMakeLists.txt
++++ b/cmake/CMakeLists.txt
+@@ -99,7 +99,7 @@
+ ADD_DEFINITIONS("-Wundef")
+ ADD_DEFINITIONS("-Wcast-align")
+ ADD_DEFINITIONS("-Wno-implicit-function-declaration")
+-ADD_DEFINITIONS("-Os -march=native -std=c99")
++ADD_DEFINITIONS("-std=c99")
+ INCLUDE_DIRECTORIES (${SRC_DIR})
+
+
diff --git a/app-arch/lz4/files/lz4-0_p106-install-to-bindir.patch b/app-arch/lz4/files/lz4-0_p106-install-to-bindir.patch
new file mode 100644
index 000000000000..521b1bfc58d2
--- /dev/null
+++ b/app-arch/lz4/files/lz4-0_p106-install-to-bindir.patch
@@ -0,0 +1,51 @@
+diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
+index 496c076..ce3fab1 100644
+--- a/cmake/CMakeLists.txt
++++ b/cmake/CMakeLists.txt
+@@ -41,11 +41,11 @@ endif()
+ if (CMAKE_SYSTEM_PROCESSOR STREQUAL "64bit")
+ message(STATUS "Build 64bit executable binary")
+ add_executable(lz4c64 ${LZ4_SRCS})
+- install(TARGETS lz4c64 RUNTIME DESTINATION "./")
++ install(TARGETS lz4c64 RUNTIME DESTINATION "bin/")
+ if(NOT BUILD_SHARED_LIBS)
+ message(STATUS "Build 32bit executable binary")
+ add_executable(lz4c32 ${LZ4_SRCS})
+- install(TARGETS lz4c32 RUNTIME DESTINATION "./")
++ install(TARGETS lz4c32 RUNTIME DESTINATION "bin/")
+
+ SET_TARGET_PROPERTIES(lz4c32 PROPERTIES
+ COMPILE_FLAGS PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
+@@ -53,7 +53,7 @@ if (CMAKE_SYSTEM_PROCESSOR STREQUAL "64bit")
+ else()
+ message(STATUS "Build 32bit executable binary")
+ add_executable(lz4c32 ${LZ4_SRCS})
+- install(TARGETS lz4c32 RUNTIME DESTINATION "./")
++ install(TARGETS lz4c32 RUNTIME DESTINATION "bin/")
+ endif()
+
+ if(BUILD_SHARED_LIBS)
+diff --git a/cmake/pack/CMakeLists.txt b/cmake/pack/CMakeLists.txt
+index a9b0557..e85416e 100644
+--- a/cmake/pack/CMakeLists.txt
++++ b/cmake/pack/CMakeLists.txt
+@@ -48,16 +48,16 @@ set(FUZZER_SRCS ${SRC_DIR}lz4.c ${SRC_DIR}lz4hc.c ${SRC_DIR}lz4.h ${SRC_DIR}fuzz
+ # EXECUTABLES FOR 32 Bit and 64 versions
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "64bit")
+ add_executable(lz4c32 ${LZ4_SRCS})
+- install(TARGETS lz4c32 RUNTIME DESTINATION "./")
++ install(TARGETS lz4c32 RUNTIME DESTINATION "bin/")
+ SET_TARGET_PROPERTIES(lz4c32 PROPERTIES
+ COMPILE_FLAGS PROPERTIES COMPILE_FLAGS "-m32 -Os" LINK_FLAGS "-m32")
+ endif()
+
+ add_executable(lz4c ${LZ4_SRCS})
+-install(TARGETS lz4c RUNTIME DESTINATION "./")
++install(TARGETS lz4c RUNTIME DESTINATION "bin/")
+
+ add_executable(fuzzer ${FUZZER_SRCS})
+-install(TARGETS fuzzer RUNTIME DESTINATION "./")
++install(TARGETS fuzzer RUNTIME DESTINATION "bin/")
+
+ #target_link_libraries(lz4 ${LZ4_SRCS_LIB})
+ ####################### CPACK PACKAGING ###################
diff --git a/app-arch/lz4/files/lz4-0_p131-static-libs.patch b/app-arch/lz4/files/lz4-0_p131-static-libs.patch
new file mode 100644
index 000000000000..f8c5c2de1e83
--- /dev/null
+++ b/app-arch/lz4/files/lz4-0_p131-static-libs.patch
@@ -0,0 +1,49 @@
+fix from upstream
+
+From 43b631223b2d0425a0970876974074934f89c450 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 22 Sep 2016 23:59:02 -0400
+Subject: [PATCH] add a flag to disable static libs
+
+---
+ lib/Makefile | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index b5352a0cb372..27b35c41b693 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -40,6 +40,8 @@
+ LIBVER_PATCH=`sed -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h`
+ LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH)
+
++BUILD_STATIC:= yes
++
+ DESTDIR?=
+ PREFIX ?= /usr/local
+ CFLAGS ?= -O3
+@@ -71,9 +72,11 @@
+ all: liblz4
+
+ liblz4: lz4.c lz4hc.c lz4frame.c xxhash.c
++ifeq ($(BUILD_STATIC),yes)
+ @echo compiling static library
+ @$(CC) $(CPPFLAGS) $(CFLAGS) -c $^
+ @$(AR) rcs liblz4.a lz4.o lz4hc.o lz4frame.o xxhash.o
++endif
+ @echo compiling dynamic library $(LIBVER)
+ @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER)
+ @echo creating versioned links
+@@ -104,7 +107,9 @@
+ @cp -a liblz4.$(SHARED_EXT_MAJOR) $(DESTDIR)$(LIBDIR)
+ @cp -a liblz4.$(SHARED_EXT) $(DESTDIR)$(LIBDIR)
+ @cp -a liblz4.pc $(DESTDIR)$(LIBDIR)/pkgconfig/
++ifeq ($(BUILD_STATIC),yes)
+ @install -m 644 liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a
++endif
+ @install -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h
+ @install -m 644 lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h
+ @install -m 644 lz4frame.h $(DESTDIR)$(INCLUDEDIR)/lz4frame.h
+--
+2.9.0
+
diff --git a/app-arch/lz4/lz4-0_p106-r1.ebuild b/app-arch/lz4/lz4-0_p106-r1.ebuild
new file mode 100644
index 000000000000..af0720e31f37
--- /dev/null
+++ b/app-arch/lz4/lz4-0_p106-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-utils multilib
+
+CMAKE_USE_DIR="${S}/cmake"
+
+if [ ${PV} == "9999" ] ; then
+ inherit subversion
+ ESVN_REPO_URI="https://lz4.googlecode.com/svn/trunk/"
+ ESVN_PROJECT="lz4-read-only"
+else
+ SRC_URI="https://dev.gentoo.org/~ryao/dist/${P}.tar.xz"
+ KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Extremely Fast Compression algorithm"
+HOMEPAGE="https://github.com/Cyan4973/lz4"
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ if [ ${PV} == "9999" ]
+ then
+ subversion_src_prepare
+ else
+ epatch "${FILESDIR}/${P}-install-to-bindir.patch"
+ epatch "${FILESDIR}/${P}-cflags.patch"
+ fi
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(-DBUILD_SHARED_LIBS=ON)
+ cmake-utils_src_configure
+}
+
+src_install() {
+ dodir /usr
+ dodir "/usr/$(get_libdir)"
+ ln -s "$(get_libdir)" "${ED}usr/lib" || \
+ die "Cannot create temporary symlink from usr/lib to usr/$(get_libdir)"
+
+ cmake-utils_src_install
+
+ rm "${ED}usr/lib"
+
+ if [ -f "${ED}usr/bin/lz4c64" ]
+ then
+ dosym lz4c64 /usr/bin/lz4c
+ else
+ dosym lz4c32 /usr/bin/lz4c
+ fi
+}
diff --git a/app-arch/lz4/lz4-0_p120.ebuild b/app-arch/lz4/lz4-0_p120.ebuild
new file mode 100644
index 000000000000..85a4e4542a82
--- /dev/null
+++ b/app-arch/lz4/lz4-0_p120.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib multilib-minimal toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/Cyan4973/lz4.git"
+ EGIT_BRANCH=dev
+else
+ MY_PV="r${PV##0_p}"
+ MY_P="${PN}-${MY_PV}"
+ SRC_URI="https://github.com/Cyan4973/lz4/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+ KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~x86-linux"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DESCRIPTION="Extremely Fast Compression algorithm"
+HOMEPAGE="https://github.com/Cyan4973/lz4"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+IUSE="test valgrind"
+
+DEPEND="test? ( valgrind? ( dev-util/valgrind ) )"
+
+src_prepare() {
+ if ! use valgrind; then
+ sed -i -e '/^test:/s|test-mem||g' programs/Makefile || die
+ fi
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ tc-export CC AR
+ # we must not use the 'all' target since it builds test programs
+ # & extra -m32 executables
+ emake
+ emake -C programs
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}" \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR="${EPREFIX}"/usr/$(get_libdir)
+}
diff --git a/app-arch/lz4/lz4-0_p131-r1.ebuild b/app-arch/lz4/lz4-0_p131-r1.ebuild
new file mode 100644
index 000000000000..47e496da8698
--- /dev/null
+++ b/app-arch/lz4/lz4-0_p131-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib multilib-minimal toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/Cyan4973/lz4.git"
+ EGIT_BRANCH=dev
+else
+ MY_PV="r${PV##0_p}"
+ MY_P="${PN}-${MY_PV}"
+ SRC_URI="https://github.com/Cyan4973/lz4/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DESCRIPTION="Extremely Fast Compression algorithm"
+HOMEPAGE="https://github.com/Cyan4973/lz4"
+
+LICENSE="BSD-2 GPL-2"
+# Upstream has trouble keeping ABI stable, so please test new versions
+# with abi-compliance-checker and update the subslot every time ABI
+# changes. This is the least we can do to keep things sane.
+SLOT="0/r131"
+IUSE="static-libs test valgrind"
+
+DEPEND="test? ( valgrind? ( dev-util/valgrind ) )"
+
+src_prepare() {
+ if ! use valgrind; then
+ sed -i -e '/^test:/s|test-mem||g' programs/Makefile || die
+ fi
+ epatch "${FILESDIR}"/${PN}-0_p131-static-libs.patch
+ multilib_copy_sources
+}
+
+lmake() {
+ emake \
+ BUILD_STATIC=$(usex static-libs) \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR="${EPREFIX}"/usr/$(get_libdir) \
+ "$@"
+}
+
+multilib_src_compile() {
+ tc-export CC AR
+ # we must not use the 'all' target since it builds test programs
+ # & extra -m32 executables
+ lmake -C lib liblz4 liblz4.pc
+ lmake -C programs lz4 lz4c
+ # work around lack of proper target dependencies
+ touch lib/liblz4
+}
+
+multilib_src_test() {
+ lmake -j1 test
+}
+
+multilib_src_install() {
+ lmake install DESTDIR="${D}"
+}
diff --git a/app-arch/lz4/lz4-0_p131.ebuild b/app-arch/lz4/lz4-0_p131.ebuild
new file mode 100644
index 000000000000..dff53bc2e12d
--- /dev/null
+++ b/app-arch/lz4/lz4-0_p131.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib multilib-minimal toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/Cyan4973/lz4.git"
+ EGIT_BRANCH=dev
+else
+ MY_PV="r${PV##0_p}"
+ MY_P="${PN}-${MY_PV}"
+ SRC_URI="https://github.com/Cyan4973/lz4/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DESCRIPTION="Extremely Fast Compression algorithm"
+HOMEPAGE="https://github.com/Cyan4973/lz4"
+
+LICENSE="BSD-2 GPL-2"
+# Upstream has trouble keeping ABI stable, so please test new versions
+# with abi-compliance-checker and update the subslot every time ABI
+# changes. This is the least we can do to keep things sane.
+SLOT="0/r131"
+IUSE="test valgrind"
+
+DEPEND="test? ( valgrind? ( dev-util/valgrind ) )"
+
+src_prepare() {
+ if ! use valgrind; then
+ sed -i -e '/^test:/s|test-mem||g' programs/Makefile || die
+ fi
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ tc-export CC AR
+ # we must not use the 'all' target since it builds test programs
+ # & extra -m32 executables
+ emake -C lib liblz4 liblz4.pc
+ emake -C programs lz4 lz4c
+ # work around lack of proper target dependencies
+ touch lib/liblz4
+}
+
+multilib_src_test() {
+ emake -j1 test
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}" \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR="${EPREFIX}"/usr/$(get_libdir)
+}
diff --git a/app-arch/lz4/lz4-1.7.5-r1.ebuild b/app-arch/lz4/lz4-1.7.5-r1.ebuild
new file mode 100644
index 000000000000..90bd29e89780
--- /dev/null
+++ b/app-arch/lz4/lz4-1.7.5-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/lz4/lz4.git"
+ EGIT_BRANCH=dev
+else
+ SRC_URI="https://github.com/Cyan4973/lz4/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Extremely Fast Compression algorithm"
+HOMEPAGE="https://github.com/lz4/lz4"
+
+LICENSE="BSD-2 GPL-2"
+# https://abi-laboratory.pro/tracker/timeline/lz4/
+# note: abi-tracker is most likely wrong about 1.7.3 changing ABI,
+# the maintainer is looking into fixing that
+SLOT="0/r131"
+IUSE="static-libs"
+
+CMAKE_USE_DIR=${S}/contrib/cmake_unofficial
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DBUILD_STATIC_LIBS=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+
+ # fix missing version in .pc, #608144
+ sed -i -e "/Version/s:$:${PV}:" "${BUILD_DIR}"/liblz4.pc || die
+}
diff --git a/app-arch/lz4/lz4-1.8.0.ebuild b/app-arch/lz4/lz4-1.8.0.ebuild
new file mode 100644
index 000000000000..17840895424d
--- /dev/null
+++ b/app-arch/lz4/lz4-1.8.0.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/lz4/lz4.git"
+ EGIT_BRANCH=dev
+else
+ SRC_URI="https://github.com/Cyan4973/lz4/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Extremely Fast Compression algorithm"
+HOMEPAGE="https://github.com/lz4/lz4"
+
+LICENSE="BSD-2 GPL-2"
+# https://abi-laboratory.pro/tracker/timeline/lz4/
+# 1.7.5->1.8.0 has some minor changes; the only really incompatible
+# would be removing 'const' from LZ4F_freeDecompressionContext() arg
+# however, it is extremely unlikely that this 'const' would actually
+# be relied on
+SLOT="0/r131"
+IUSE="static-libs"
+
+CMAKE_USE_DIR=${S}/contrib/cmake_unofficial
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DBUILD_STATIC_LIBS=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
diff --git a/app-arch/lz4/lz4-9999.ebuild b/app-arch/lz4/lz4-9999.ebuild
new file mode 100644
index 000000000000..267436933dac
--- /dev/null
+++ b/app-arch/lz4/lz4-9999.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/lz4/lz4.git"
+ EGIT_BRANCH=dev
+else
+ SRC_URI="https://github.com/Cyan4973/lz4/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Extremely Fast Compression algorithm"
+HOMEPAGE="https://github.com/lz4/lz4"
+
+LICENSE="BSD-2 GPL-2"
+# https://abi-laboratory.pro/tracker/timeline/lz4/
+SLOT="0/r131"
+IUSE="static-libs"
+
+CMAKE_USE_DIR=${S}/contrib/cmake_unofficial
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DBUILD_STATIC_LIBS=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
diff --git a/app-arch/lz4/metadata.xml b/app-arch/lz4/metadata.xml
new file mode 100644
index 000000000000..58af32e0d07c
--- /dev/null
+++ b/app-arch/lz4/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ryao@gentoo.org</email>
+ <name>Richard Yao</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="valgrind">Enable usage of dev-util/valgrind in tests</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">Cyan4973/lz4</remote-id>
+ </upstream>
+</pkgmetadata>