Makefile 2.4 KB

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