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.

81 lines
1.9 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=zstd
  3. PKG_VERSION:=1.4.0
  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:=63be339137d2b683c6d19a9e34f4fb684790e864fee13c7dd40e197a64c705c1
  8. PKG_LICENSE:=GPL-2.0-or-later
  9. PKG_LICENSE_FILES:=COPYING
  10. include $(INCLUDE_DIR)/package.mk
  11. include $(INCLUDE_DIR)/host-build.mk
  12. include $(INCLUDE_DIR)/cmake.mk
  13. PKG_BUILD_PARALLEL:=1
  14. HOST_BUILD_PARALLEL:=1
  15. CMAKE_SOURCE_SUBDIR:=build/cmake
  16. CMAKE_INSTALL:=1
  17. ifeq ($(CONFIG_ZSTD_OPTIMIZE_O3),y)
  18. TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
  19. TARGET_CFLAGS += -O3
  20. TARGET_CXXFLAGS := $(filter-out -O%,$(TARGET_CXXFLAGS))
  21. TARGET_CXXFLAGS += -O3
  22. endif
  23. define Package/zstd/Default
  24. SUBMENU:=Compression
  25. URL:=https://github.com/facebook/zstd
  26. MAINTAINER:=Amol Bhave <ambhave@fb.com>
  27. endef
  28. define Package/libzstd
  29. $(call Package/zstd/Default)
  30. SECTION:=libs
  31. CATEGORY:=Libraries
  32. TITLE:=zstd library.
  33. endef
  34. define Package/libzstd/description
  35. Zstandard - Fast real-time compression algorithm.
  36. This package provides libzstd library.
  37. endef
  38. define Package/libzstd/config
  39. config ZSTD_OPTIMIZE_O3
  40. bool "Use all optimizations (-O3)"
  41. default y
  42. help
  43. This enables additional optmizations using the -O3 compilation flag.
  44. endef
  45. define Package/zstd
  46. $(call Package/zstd/Default)
  47. SECTION:=utils
  48. CATEGORY:=Utilities
  49. DEPENDS:=+libzstd
  50. TITLE:=Fast real-time compression algorithm.
  51. endef
  52. define Package/zstd/description
  53. Zstandard - Fast real-time compression algorithm.
  54. This package provides the zstd binaries.
  55. endef
  56. define Package/libzstd/install
  57. $(INSTALL_DIR) $(1)/usr/lib
  58. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libzstd.so* $(1)/usr/lib/
  59. endef
  60. define Package/zstd/install
  61. $(INSTALL_DIR) $(1)/usr/bin
  62. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{unzstd,zstd,zstdcat,zstdmt} $(1)/usr/bin/
  63. endef
  64. $(eval $(call BuildPackage,libzstd))
  65. $(eval $(call BuildPackage,zstd))
  66. $(eval $(call HostBuild))