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.

90 lines
2.2 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:=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:=658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/lz4-$(PKG_VERSION)
  15. PKG_MAINTAINER:=Darik Horn <dajhorn@vanadac.com>
  16. PKG_BUILD_PARALLEL:=1
  17. CMAKE_INSTALL:=1
  18. CMAKE_SOURCE_SUBDIR:=contrib/cmake_unofficial
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  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. CMAKE_OPTIONS += \
  56. -DCMAKE_INSTALL_MANDIR=/dev/null \
  57. -DLZ4_BUILD_LEGACY_LZ4C=OFF
  58. ifeq ($(CONFIG_LZ4_OPTIMIZE_SPEED),y)
  59. TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3
  60. endif
  61. TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto
  62. TARGET_LDFLAGS += -Wl,--gc-sections
  63. define Package/liblz4/install
  64. $(INSTALL_DIR) $(1)/usr/lib
  65. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblz4.so.$(ABI_VERSION)* $(1)/usr/lib/
  66. endef
  67. define Package/lz4/install
  68. $(INSTALL_DIR) $(1)/usr/bin
  69. $(CP) $(PKG_INSTALL_DIR)/usr/bin/{lz4,lz4cat,unlz4} $(1)/usr/bin/
  70. endef
  71. $(eval $(call BuildPackage,liblz4))
  72. $(eval $(call BuildPackage,lz4))