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.

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