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.

100 lines
2.4 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=zstd
  3. PKG_VERSION:=1.4.4
  4. PKG_RELEASE:=3
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=https://codeload.github.com/facebook/zstd/tar.gz/v$(PKG_VERSION)?
  7. PKG_HASH:=a364f5162c7d1a455cc915e8e3cf5f4bd8b75d09bc0f53965b0c9ca1383c52c8
  8. PKG_MAINTAINER:=
  9. PKG_LICENSE:=GPL-2.0-or-later
  10. PKG_LICENSE_FILES:=COPYING
  11. PKG_BUILD_DEPENDS:=meson/host
  12. PKG_INSTALL:=1
  13. include $(INCLUDE_DIR)/package.mk
  14. include ../../devel/meson/meson.mk
  15. MESON_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/build/meson/openwrt-build
  16. define Package/zstd/Default
  17. SUBMENU:=Compression
  18. URL:=https://github.com/facebook/zstd
  19. endef
  20. define Package/libzstd
  21. $(call Package/zstd/Default)
  22. SECTION:=libs
  23. CATEGORY:=Libraries
  24. TITLE:=zstd library.
  25. MENU:=1
  26. endef
  27. define Package/libzstd/description
  28. Zstandard - Fast real-time compression algorithm.
  29. This package provides libzstd library.
  30. endef
  31. define Package/libzstd/config
  32. config ZSTD_OPTIMIZE_O3
  33. bool "Use all optimizations (-O3)"
  34. depends on PACKAGE_libzstd
  35. default y
  36. help
  37. This enables additional optmizations using the -O3 compilation flag.
  38. endef
  39. define Package/zstd
  40. $(call Package/zstd/Default)
  41. SECTION:=utils
  42. CATEGORY:=Utilities
  43. DEPENDS:=+libzstd
  44. TITLE:=Fast real-time compression algorithm.
  45. endef
  46. define Package/zstd/description
  47. Zstandard - Fast real-time compression algorithm.
  48. This package provides the zstd binaries.
  49. endef
  50. ifeq ($(CONFIG_ZSTD_OPTIMIZE_O3),y)
  51. TARGET_CFLAGS:= $(filter-out -O%,$(TARGET_CFLAGS)) -O3
  52. endif
  53. MESON_ARGS += \
  54. -Dlegacy_level=1 \
  55. -Ddebug_level=0 \
  56. -Dbacktrace=false \
  57. -Dstatic_runtime=false \
  58. -Dbin_programs=true \
  59. -Dbin_tests=false \
  60. -Dbin_control=false \
  61. -Dzlib=disabled \
  62. -Dlzma=disabled \
  63. -Dlz4=disabled \
  64. -Db_lto=true
  65. define Build/InstallDev
  66. $(INSTALL_DIR) $(1)/usr/include
  67. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
  68. $(INSTALL_DIR) $(1)/usr/lib
  69. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzstd.so* $(1)/usr/lib
  70. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  71. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libzstd.pc $(1)/usr/lib/pkgconfig
  72. endef
  73. define Package/libzstd/install
  74. $(INSTALL_DIR) $(1)/usr/lib
  75. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzstd.so* $(1)/usr/lib
  76. endef
  77. define Package/zstd/install
  78. $(INSTALL_DIR) $(1)/usr/bin
  79. $(CP) $(PKG_INSTALL_DIR)/usr/bin/{unzstd,zstd,zstdcat,zstdgrep,zstdless,zstdmt} $(1)/usr/bin
  80. endef
  81. $(eval $(call BuildPackage,libzstd))
  82. $(eval $(call BuildPackage,zstd))