Skip to content

Commit

Permalink
zstd: add zstd package
Browse files Browse the repository at this point in the history
Zstandard, or zstd as short version, is a fast lossless compression
algorithm, targeting real-time compression scenarios at zlib-level and
better compression ratios.

This package includes a C library, and a command line utility producing
and decoding .zst, .gz, .xz and .lz4 files.

Signed-off-by: Amol Bhave <[email protected]>
  • Loading branch information
ammubhave authored and neheb committed Mar 28, 2019
1 parent 4117618 commit be6c72a
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions utils/zstd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=zstd
PKG_VERSION:=1.3.7
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/facebook/zstd/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=5dd1e90eb16c25425880c8a91327f63de22891ffed082fcc17e5ae84fce0d5fb

PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILE:=COPYING

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk

PKG_BUILD_PARALLEL:=1
HOST_BUILD_PARALLEL:=1
CMAKE_SOURCE_SUBDIR:=build/cmake
CMAKE_INSTALL:=1
TARGET_CXXFLAGS+=$(if $(CONFIG_ZSTD_OPTIMIZE_O3), -O3)

define Package/zstd/Default
SUBMENU:=Compression
URL:=https://github.com/facebook/zstd
MAINTAINER:=Amol Bhave <[email protected]>
endef

define Package/zstd/config
config ZSTD_OPTIMIZE_O3
bool "Use all optimizations (-O3)"
default y
help
This enables additional optmizations using the -O3 compilation flag.
endef

define Package/libzstd
$(call Package/zstd/Default)
SECTION:=libs
CATEGORY:=Libraries
TITLE:=zstd library.
endef

define Package/libzstd/description
Zstandard - Fast real-time compression algorithm.
This package provides libzstd library.
endef

define Package/zstd
$(call Package/zstd/Default)
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libzstd
TITLE:=Fast real-time compression algorithm.
endef

define Package/zstd/description
Zstandard - Fast real-time compression algorithm.
This package provides the zstd binaries.
endef

define Package/libzstd/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libzstd.so* $(1)/usr/lib/
endef

define Package/zstd/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{unzstd,zstd,zstdcat,zstdmt} $(1)/usr/bin/
endef

$(eval $(call BuildPackage,libzstd))
$(eval $(call BuildPackage,zstd))
$(eval $(call HostBuild))

0 comments on commit be6c72a

Please sign in to comment.