From patchwork Tue Jul 4 19:01:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 784231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x2Cz34FwTz9s72 for ; Wed, 5 Jul 2017 05:01:35 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dwiZpnbk"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 270EB80CDF; Tue, 4 Jul 2017 19:01:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OkPF9rWeeoAs; Tue, 4 Jul 2017 19:01:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 54BCB80CE5; Tue, 4 Jul 2017 19:01:33 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 410171C14F8 for ; Tue, 4 Jul 2017 19:01:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3357F304CA for ; Tue, 4 Jul 2017 19:01:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EUzraRbPcs1E for ; Tue, 4 Jul 2017 19:01:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by silver.osuosl.org (Postfix) with ESMTPS id 8FF93304AB for ; Tue, 4 Jul 2017 19:01:31 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id j186so28370267pge.1 for ; Tue, 04 Jul 2017 12:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=NU5MW69qp6Z97XzB1FDxOkuUFgm9OtG3kIGPOKzKddA=; b=dwiZpnbkN4TEzoAyeCW/TN+DQgYCw0MaoSVWJCgH5XfLhssQ7cz1U4YPIfCIAQwcOT GvQLaiE5G0FT5RiQu+kyp1JfyUP5nNeRijscthhc+OMQ993593QdF1dKP4nH9UhaXP1R DXXRUHTZLc5ewlLa8KqrmXGPs/F1o4rQRNJUixaK+BO028Q7/iR7wtn6VJ+LDjjTfMVm 4oB1MW60+4Hkll/8QWdai0vPLou/qC0JvbAkqajZZoyCwDbM2x7X4l6cz+RsO+UqsoYK fK4rtbxSaycyfxVH6cXB6Auzwe6qN+tGQOHok7PEE2YQ2/d4fUnfKlmDmLdwcikWOLt2 X0Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NU5MW69qp6Z97XzB1FDxOkuUFgm9OtG3kIGPOKzKddA=; b=rFaAx7hMzJVevhbQwN+7rHQbvyxcPhdDtIlBjqk5wTep8w+55DNKaCYLf2RfCEVEHP Fvx6barpa+dAVcMDvmYh6S45xjKMTvHEUCxNLTK3AnHbGp2H/8+b6WCz2Yc9tLdrPs7D 231j4YbZ3n/VvD3SSMOPC+kFuW4XxmwrjJ8n71y2FpDAR8UCQR7CiCMErW3CPtKeZjTD LpN7LPCjq/WBTG3GIfzHO0EILQoxNNvDlTg7BR7cmozYWCCtZBTWWtg3ymZAdp6tDLFR PzUdvqudFYc4k/qXmIHS2uzTei0W3z0dMHk4zBLRHrhQuLdQHJgBvS0fGmneInRpBgdP MhpQ== X-Gm-Message-State: AIVw110HbTYoXFUkj1oS4VyTu73pTLo1qsH4c3wr3fWJKAt3eAwX6wIN ApFJcZIn4hcBd/Zqhf8= X-Received: by 10.99.121.77 with SMTP id u74mr16896798pgc.107.1499194891031; Tue, 04 Jul 2017 12:01:31 -0700 (PDT) Received: from squirtle.lan (c-73-19-0-61.hsd1.wa.comcast.net. [73.19.0.61]) by smtp.gmail.com with ESMTPSA id b8sm45848151pfd.65.2017.07.04.12.01.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 12:01:30 -0700 (PDT) From: Andrey Smirnov To: buildroot@buildroot.org Date: Tue, 4 Jul 2017 12:01:23 -0700 Message-Id: <20170704190123.13231-1-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.9.4 Cc: Andrey Smirnov Subject: [Buildroot] [PATCH] zstd: add new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add package to provide Zstandard compression tools (see https://facebook.github.io/zstd) Minimal config snippet for utils/test-pkg is as follows: BR2_PACKAGE_ZSTD=y Signed-off-by: Andrey Smirnov --- DEVELOPERS | 1 + package/Config.in | 1 + package/zstd/Config.in | 25 ++++++++++++++++++++ package/zstd/zstd.mk | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 package/zstd/Config.in create mode 100644 package/zstd/zstd.mk diff --git a/DEVELOPERS b/DEVELOPERS index 08a138a..d907e2d 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -96,6 +96,7 @@ F: package/python-scandir/ F: package/python-simplegeneric/ F: package/python-systemd/ F: package/python-traitlets/ +F: package/zstd/ N: Andrey Yurovsky F: package/rauc/ diff --git a/package/Config.in b/package/Config.in index af1aa0c..1efdf26 100644 --- a/package/Config.in +++ b/package/Config.in @@ -68,6 +68,7 @@ menu "Compressors and decompressors" source "package/unzip/Config.in" source "package/xz/Config.in" source "package/zip/Config.in" + source "package/zstd/Config.in" endmenu menu "Debugging, profiling and benchmark" diff --git a/package/zstd/Config.in b/package/zstd/Config.in new file mode 100644 index 0000000..20738b9 --- /dev/null +++ b/package/zstd/Config.in @@ -0,0 +1,25 @@ +menuconfig BR2_PACKAGE_ZSTD + bool "zstd" + help + Zstandard, or zstd as short version, is a fast lossless + compression algorithm, targeting real-time compression + scenarios at zlib-level and better compression ratios + + For more info see https://facebook.github.io/zstd + + The selection of other packages will enable some features: + + - xz and/or zlib will enable support for support of + corresponding compression formats + +if BR2_PACKAGE_ZSTD + +config BR2_PACKAGE_ZSTD_ZSTDLESS_ZSTDGREP + bool "enable zstdless, zstdgrep tools" + default n + +config BR2_PACKAGE_ZSTD_ZSTDCAT_UNZSTD_ZSTDMT + bool "enable zstdcat, unzstd and zstdmt tools" + default n + +endif diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk new file mode 100644 index 0000000..6edb3f7 --- /dev/null +++ b/package/zstd/zstd.mk @@ -0,0 +1,63 @@ +################################################################################ +# +# zstd +# +################################################################################ + +ZSTD_VERSION = v1.2.0 +ZSTD_SITE = $(call github,facebook,zstd,$(ZSTD_VERSION)) +ZSTD_LICENSE = BSD-3-Clause +ZSTD_LICENSE_FILES = LICENSE PATENTS + +ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) +ZSTD_OPTS += HAVE_THREAD=1 +else +ZSTD_OPTS += HAVE_THREAD=0 +endif + +ifeq ($(BR2_PACKAGE_ZLIB),y) +ZSTD_DEPENDENCIES += zlib +ZSTD_OPTS += HAVE_ZLIB=1 +else +ZSTD_OPTS += HAVE_ZLIB=0 +endif + +ifeq ($(BR2_PACKAGE_XZ),y) +ZSTD_DEPENDENCIES += xz +ZSTD_OPTS += HAVE_LZMA=1 +else +ZSTD_OPTS += HAVE_LZMA=0 +endif + +define ZSTD_BUILD_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) -C $(@D) zstd +endef + +ifeq ($(BR2_PACKAGE_ZSTD_ZSTDLESS_ZSTDGREP),y) +define ZSTD_INSTALL_TARGET_ZSTDLESS_ZSTDGREP + $(INSTALL) -D -m 0755 $(@D)/programs/zstdless $(TARGET_DIR)/usr/bin/zstdless + $(INSTALL) -D -m 0755 $(@D)/programs/zstdgrep $(TARGET_DIR)/usr/bin/zstdgrep +endef +endif + +ifeq ($(BR2_PACKAGE_ZSTD_ZSTDCAT_UNZSTD_ZSTDMT),y) +define ZSTD_INSTALL_TARGET_ZSTDCAT_UNZSTD_ZSTDMT + for tool in zstdcat unzstd zstdmt; do \ + ln -sf zstd $(TARGET_DIR)/usr/bin/$${tool}; \ + done +endef +endif + +# +# 'install' target provided with the package will unconditionally +# install man pages and all of the tools. To avoid that we install all +# of the binaries explicitly +# +define ZSTD_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 0755 $(@D)/zstd $(TARGET_DIR)/usr/bin/zstd + + $(ZSTD_INSTALL_TARGET_ZSTDLESS_ZSTDGREP) + $(ZSTD_INSTALL_TARGET_ZSTDCAT_UNZSTD_ZSTDMT) +endef + +$(eval $(generic-package))