qbee-agent: new package qbee-agent 2024.23
[feed/packages.git] / libs / liblz4 / Makefile
1 #
2 # Copyright (C) 2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=lz4
11 PKG_VERSION:=1.9.4
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://codeload.github.com/lz4/lz4/tar.gz/v$(PKG_VERSION)?
16 PKG_HASH:=0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b
17
18 PKG_MAINTAINER:=Darik Horn <dajhorn@vanadac.com>
19 PKG_CPE_ID:=cpe:/a:lz4_project:lz4
20
21 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_lz4
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/meson.mk
25
26 MESON_BUILD_DIR:=$(PKG_BUILD_DIR)/contrib/meson/openwrt-build
27
28 define Package/lz4/Default
29 SUBMENU:=Compression
30 URL:=https://www.lz4.org/
31 endef
32
33 define Package/liblz4
34 $(call Package/lz4/Default)
35 SECTION:=libs
36 CATEGORY:=Libraries
37 TITLE:=Extremely fast compression
38 LICENSE:=BSD-2-Clause
39 LICENSE_FILES:=LICENSE lib/LICENSE
40 ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
41 MENU:=1
42 endef
43
44 define Package/liblz4/description
45 LZ4 is a compression codec that features a very fast encoder and an
46 even faster decoder. This package provides the liblz4 shared library.
47 endef
48
49 define Package/liblz4/config
50 source "$(SOURCE)/Config.in"
51 endef
52
53 define Package/lz4
54 $(call Package/lz4/Default)
55 SECTION:=utils
56 CATEGORY:=Utilities
57 TITLE:=Extremely fast compression
58 LICENSE:=GPL-2.0-or-later
59 LICENSE_FILES:=LICENSE programs/COPYING
60 DEPENDS:=+liblz4
61 endef
62
63 define Package/lz4/description
64 LZ4 - Fast real-time compression algorithm.
65 This package provides the lz4 binaries.
66 endef
67
68 MESON_ARGS += \
69 -Ddebug-level=0 \
70 -Dunstable=false \
71 -Dprograms=$(if $(CONFIG_PACKAGE_lz4),true,false) \
72 -Dtests=false \
73 -Dcontrib=false \
74 -Dexamples=false \
75 -Db_lto=false
76
77 ifeq ($(CONFIG_LZ4_OPTIMIZE_SPEED),y)
78 TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3
79 endif
80
81 define Build/InstallDev
82 $(INSTALL_DIR) $(1)/usr/include
83 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
84 $(INSTALL_DIR) $(1)/usr/lib
85 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblz4.so* $(1)/usr/lib
86 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
87 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblz4.pc $(1)/usr/lib/pkgconfig
88 endef
89
90 define Package/liblz4/install
91 $(INSTALL_DIR) $(1)/usr/lib
92 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblz4.so.$(ABI_VERSION)* $(1)/usr/lib/
93 endef
94
95 define Package/lz4/install
96 $(INSTALL_DIR) $(1)/usr/bin
97 $(CP) $(PKG_INSTALL_DIR)/usr/bin/{lz4,lz4c,lz4cat,unlz4} $(1)/usr/bin/
98 endef
99
100 $(eval $(call BuildPackage,liblz4))
101 $(eval $(call BuildPackage,lz4))