diff --git a/packages/compress/lz4/package.mk b/packages/compress/lz4/package.mk new file mode 100644 index 00000000000..28f399d2fa4 --- /dev/null +++ b/packages/compress/lz4/package.mk @@ -0,0 +1,53 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2015 Stephan Raue (stephan@openelec.tv) +# +# OpenELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# OpenELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC. If not, see . +################################################################################ + +PKG_NAME="lz4" +PKG_VERSION="r131" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="BSD" +PKG_SITE="http://www.lz4.org/" +PKG_URL="https://github.com/Cyan4973/lz4/archive/$PKG_VERSION.tar.gz" +PKG_DEPENDS_HOST="" +PKG_PRIORITY="optional" +PKG_SECTION="compress" +PKG_SHORTDESC="LZ4 compression library" +PKG_LONGDESC="LZ4 is a very fast lossless compression algorithm, providing compression speed at 400 MB/s per core, with near-linear scalability for multi-threaded applications. It also features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems." + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" + +unpack() { + tar xzf sources/$PKG_NAME/$PKG_VERSION.tar.gz -C $BUILD +} + +make_host() { + make all +} + +makeinstall_host() { + mkdir -p $ROOT/$TOOLCHAIN/bin + cp -f programs/lz4 $ROOT/$TOOLCHAIN/bin + cp -f programs/lz4c $ROOT/$TOOLCHAIN/bin + mkdir -p $ROOT/$TOOLCHAIN/include + cp -f lib/lz4.h $ROOT/$TOOLCHAIN/include + cp -f lib/lz4hc.h $ROOT/$TOOLCHAIN/include + cp -f lib/lz4frame.h $ROOT/$TOOLCHAIN/include + mkdir -p $ROOT/$TOOLCHAIN/lib + cp -f lib/liblz4.a $ROOT/$TOOLCHAIN/lib +} diff --git a/packages/sysutils/squashfs/package.mk b/packages/sysutils/squashfs/package.mk index 5c47ba499ae..c7cb79db9f9 100644 --- a/packages/sysutils/squashfs/package.mk +++ b/packages/sysutils/squashfs/package.mk @@ -24,7 +24,7 @@ PKG_LICENSE="GPL" PKG_SITE="http://squashfs.sourceforge.net/" PKG_URL="$SOURCEFORGE_SRC/squashfs/squashfs/${PKG_NAME}${PKG_VERSION}/${PKG_NAME}${PKG_VERSION}.tar.gz" PKG_SOURCE_DIR="${PKG_NAME}${PKG_VERSION}" -PKG_DEPENDS_HOST="ccache:host zlib:host lzo:host xz:host" +PKG_DEPENDS_HOST="ccache:host zlib:host lzo:host xz:host lz4:host" PKG_PRIORITY="optional" PKG_SECTION="sysutils" PKG_SHORTDESC="squashfs-tools: A compressed read-only filesystem for Linux" @@ -35,7 +35,7 @@ PKG_AUTORECONF="no" make_host() { make -C squashfs-tools mksquashfs \ - XZ_SUPPORT=1 LZO_SUPPORT=1 \ + XZ_SUPPORT=1 LZO_SUPPORT=1 LZ4_SUPPORT=1 \ INCLUDEDIR="-I. -I$ROOT/$TOOLCHAIN/include" } diff --git a/projects/Generic/options b/projects/Generic/options index ec09393d4b1..edb22dd37e7 100644 --- a/projects/Generic/options +++ b/projects/Generic/options @@ -56,7 +56,7 @@ # GOLD (Google Linker) support GOLD_SUPPORT="yes" - # SquashFS compression method (gzip / lzo / xz) + # SquashFS compression method (gzip / lzo / xz / lz4) SQUASHFS_COMPRESSION="gzip" diff --git a/projects/Nvidia_Legacy/options b/projects/Nvidia_Legacy/options index 4a987c8902e..a0e5d292d46 100644 --- a/projects/Nvidia_Legacy/options +++ b/projects/Nvidia_Legacy/options @@ -56,7 +56,7 @@ # GOLD (Google Linker) support GOLD_SUPPORT="yes" - # SquashFS compression method (gzip / lzo / xz) + # SquashFS compression method (gzip / lzo / xz / lz4) SQUASHFS_COMPRESSION="gzip" diff --git a/projects/RPi/options b/projects/RPi/options index d96d7e40a28..307c1547bc7 100644 --- a/projects/RPi/options +++ b/projects/RPi/options @@ -78,7 +78,7 @@ # GOLD (Google Linker) support GOLD_SUPPORT="yes" - # SquashFS compression method (gzip / lzo / xz) + # SquashFS compression method (gzip / lzo / xz / lz4) SQUASHFS_COMPRESSION="lzo" diff --git a/projects/RPi2/options b/projects/RPi2/options index 19fb3476538..d9fa11c3bfd 100644 --- a/projects/RPi2/options +++ b/projects/RPi2/options @@ -78,7 +78,7 @@ # GOLD (Google Linker) support GOLD_SUPPORT="yes" - # SquashFS compression method (gzip / lzo / xz) + # SquashFS compression method (gzip / lzo / xz / lz4) SQUASHFS_COMPRESSION="lzo" diff --git a/projects/WeTek_Play/options b/projects/WeTek_Play/options index 26918e9883e..90b8782e4de 100644 --- a/projects/WeTek_Play/options +++ b/projects/WeTek_Play/options @@ -77,7 +77,7 @@ # GOLD (Google Linker) support GOLD_SUPPORT="yes" - # SquashFS compression method (gzip / lzo / xz) + # SquashFS compression method (gzip / lzo / xz / lz4) SQUASHFS_COMPRESSION="lzo" ################################################################################ diff --git a/projects/imx6/options b/projects/imx6/options index 5eba8795659..3f276a52ef7 100644 --- a/projects/imx6/options +++ b/projects/imx6/options @@ -81,7 +81,7 @@ # GOLD (Google Linker) support GOLD_SUPPORT="yes" - # SquashFS compression method (gzip / lzo / xz) + # SquashFS compression method (gzip / lzo / xz / lz4) SQUASHFS_COMPRESSION="gzip" diff --git a/scripts/image b/scripts/image index 50cc9a0fbf5..ef1aebd62ea 100755 --- a/scripts/image +++ b/scripts/image @@ -221,8 +221,12 @@ fi SQUASHFS_COMPRESSION="gzip" fi + if [ "$SQUASHFS_COMPRESSION" = "lz4" ]; then + SQUASHFS_COMPRESSION_LEVEL="-Xhc" + fi + echo "rm -rf $TARGET_IMG/$IMAGE_NAME.system" >> $FAKEROOT_SCRIPT - echo "$ROOT/$TOOLCHAIN/bin/mksquashfs $BUILD/image/system $TARGET_IMG/$IMAGE_NAME.system -noappend -comp $SQUASHFS_COMPRESSION" >> $FAKEROOT_SCRIPT + echo "$ROOT/$TOOLCHAIN/bin/mksquashfs $BUILD/image/system $TARGET_IMG/$IMAGE_NAME.system -noappend -comp $SQUASHFS_COMPRESSION $SQUASHFS_COMPRESSION_LEVEL" >> $FAKEROOT_SCRIPT # run fakeroot $ROOT/$TOOLCHAIN/bin/fakeroot -- $FAKEROOT_SCRIPT