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.

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