treewide: remove AUTORELEASE
[feed/packages.git] / utils / zstd / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=zstd
4 PKG_VERSION:=1.5.2
5 PKG_RELEASE:=2
6
7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
8 PKG_SOURCE_URL:=https://github.com/facebook/zstd/releases/download/v$(PKG_VERSION)
9 PKG_HASH:=7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0
10
11 PKG_MAINTAINER:=
12 PKG_LICENSE:=GPL-2.0-or-later
13 PKG_LICENSE_FILES:=COPYING
14
15 include $(INCLUDE_DIR)/package.mk
16 include $(INCLUDE_DIR)/meson.mk
17
18 MESON_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/build/meson/openwrt-build
19
20 define Package/zstd/Default
21 SUBMENU:=Compression
22 URL:=https://github.com/facebook/zstd
23 endef
24
25 define Package/libzstd
26 $(call Package/zstd/Default)
27 SECTION:=libs
28 CATEGORY:=Libraries
29 TITLE:=zstd library.
30 MENU:=1
31 endef
32
33 define Package/libzstd/description
34 Zstandard - Fast real-time compression algorithm.
35 This package provides libzstd library.
36 endef
37
38 define Package/libzstd/config
39 config ZSTD_OPTIMIZE_O3
40 bool "Use all optimizations (-O3)"
41 depends on PACKAGE_libzstd
42 default y
43 help
44 This enables additional optmizations using the -O3 compilation flag.
45 endef
46
47 define Package/zstd
48 $(call Package/zstd/Default)
49 SECTION:=utils
50 CATEGORY:=Utilities
51 DEPENDS:=+libzstd
52 TITLE:=Fast real-time compression algorithm.
53 endef
54
55 define Package/zstd/description
56 Zstandard - Fast real-time compression algorithm.
57 This package provides the zstd binaries.
58 endef
59
60 ifeq ($(CONFIG_ZSTD_OPTIMIZE_O3),y)
61 TARGET_CFLAGS:= $(filter-out -O%,$(TARGET_CFLAGS)) -O3
62 endif
63
64 MESON_ARGS += \
65 -Dlegacy_level=7 \
66 -Ddebug_level=0 \
67 -Dbacktrace=false \
68 -Dstatic_runtime=false \
69 -Dbin_programs=true \
70 -Dbin_tests=false \
71 -Dbin_contrib=false \
72 -Dmulti_thread=enabled \
73 -Dzlib=disabled \
74 -Dlzma=disabled \
75 -Dlz4=disabled \
76 -Db_lto=true
77
78 define Build/InstallDev
79 $(INSTALL_DIR) $(1)/usr/include
80 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzstd.so* $(1)/usr/lib
83 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
84 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libzstd.pc $(1)/usr/lib/pkgconfig
85 endef
86
87 define Package/libzstd/install
88 $(INSTALL_DIR) $(1)/usr/lib
89 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzstd.so* $(1)/usr/lib
90 endef
91
92 define Package/zstd/install
93 $(INSTALL_DIR) $(1)/usr/bin
94 $(CP) $(PKG_INSTALL_DIR)/usr/bin/{unzstd,zstd,zstdcat,zstdgrep,zstdless,zstdmt} $(1)/usr/bin
95 endef
96
97 $(eval $(call BuildPackage,libzstd))
98 $(eval $(call BuildPackage,zstd))