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.3.8
  4. PKG_RELEASE:=1
  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:=90d902a1282cc4e197a8023b6d6e8d331c1fd1dfe60f7f8e4ee9da40da886dc3
  8. PKG_LICENSE:=GPL-2.0-or-later
  9. PKG_LICENSE_FILE:=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))