You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.5 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=lz4
  9. PKG_VERSION:=1.9.3
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/lz4/lz4/tar.gz/v$(PKG_VERSION)?
  13. PKG_HASH:=030644df4611007ff7dc962d981f390361e6c97a34e5cbc393ddfbe019ffe2c1
  14. PKG_MAINTAINER:=Darik Horn <dajhorn@vanadac.com>
  15. PKG_INSTALL:=1
  16. PKG_BUILD_PARALLEL:=1
  17. PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_lz4
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/meson.mk
  20. MESON_BUILD_DIR:=$(PKG_BUILD_DIR)/contrib/meson/openwrt-build
  21. define Package/lz4/Default
  22. SUBMENU:=Compression
  23. URL:=https://www.lz4.org/
  24. endef
  25. define Package/liblz4
  26. $(call Package/lz4/Default)
  27. SECTION:=libs
  28. CATEGORY:=Libraries
  29. TITLE:=Extremely fast compression
  30. LICENSE:=BSD-2-Clause
  31. LICENSE_FILES:=LICENSE lib/LICENSE
  32. ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
  33. MENU:=1
  34. endef
  35. define Package/liblz4/description
  36. LZ4 is a compression codec that features a very fast encoder and an
  37. even faster decoder. This package provides the liblz4 shared library.
  38. endef
  39. define Package/liblz4/config
  40. source "$(SOURCE)/Config.in"
  41. endef
  42. define Package/lz4
  43. $(call Package/lz4/Default)
  44. SECTION:=utils
  45. CATEGORY:=Utilities
  46. TITLE:=Extremely fast compression
  47. LICENSE:=GPL-2.0-or-later
  48. LICENSE_FILES:=LICENSE programs/COPYING
  49. DEPENDS:=+liblz4
  50. endef
  51. define Package/lz4/description
  52. LZ4 - Fast real-time compression algorithm.
  53. This package provides the lz4 binaries.
  54. endef
  55. MESON_ARGS += \
  56. -Ddebug_level=0 \
  57. -Dbacktrace=false \
  58. -Dbin_programs=$(if $(CONFIG_PACKAGE_lz4),true,false) \
  59. -Dbin_tests=false \
  60. -Dbin_contrib=false \
  61. -Dbin_examples=false \
  62. -Db_lto=false
  63. ifeq ($(CONFIG_LZ4_OPTIMIZE_SPEED),y)
  64. TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3
  65. endif
  66. define Build/InstallDev
  67. $(INSTALL_DIR) $(1)/usr/include
  68. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
  69. $(INSTALL_DIR) $(1)/usr/lib
  70. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblz4.so* $(1)/usr/lib
  71. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  72. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblz4.pc $(1)/usr/lib/pkgconfig
  73. endef
  74. define Package/liblz4/install
  75. $(INSTALL_DIR) $(1)/usr/lib
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblz4.so.$(ABI_VERSION)* $(1)/usr/lib/
  77. endef
  78. define Package/lz4/install
  79. $(INSTALL_DIR) $(1)/usr/bin
  80. $(CP) $(PKG_INSTALL_DIR)/usr/bin/{lz4,lz4c,lz4cat,unlz4} $(1)/usr/bin/
  81. endef
  82. $(eval $(call BuildPackage,liblz4))
  83. $(eval $(call BuildPackage,lz4))