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:=4
  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_MAINTAINER:=Amol Bhave <ambhave@fb.com>
  9. PKG_LICENSE:=GPL-2.0-or-later
  10. PKG_LICENSE_FILES:=COPYING
  11. PKG_BUILD_PARALLEL:=1
  12. HOST_BUILD_PARALLEL:=1
  13. CMAKE_SOURCE_SUBDIR:=build/cmake
  14. CMAKE_INSTALL:=1
  15. include $(INCLUDE_DIR)/package.mk
  16. include $(INCLUDE_DIR)/host-build.mk
  17. include $(INCLUDE_DIR)/cmake.mk
  18. ifeq ($(CONFIG_ZSTD_OPTIMIZE_O3),y)
  19. TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
  20. TARGET_CFLAGS += -O3
  21. TARGET_CXXFLAGS := $(filter-out -O%,$(TARGET_CXXFLAGS))
  22. TARGET_CXXFLAGS += -O3
  23. endif
  24. define Package/zstd/Default
  25. SUBMENU:=Compression
  26. URL:=https://github.com/facebook/zstd
  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. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzstd.so* $(1)/usr/lib/
  59. endef
  60. define Package/zstd/install
  61. $(INSTALL_DIR) $(1)/usr/bin
  62. $(CP) $(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))