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.

83 lines
1.9 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=zstd
  3. PKG_VERSION:=1.4.2
  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:=7a6e1dad34054b35e2e847eb3289be8820a5d378228802239852f913c6dcf6a7
  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. define Package/zstd/Default
  19. SUBMENU:=Compression
  20. URL:=https://github.com/facebook/zstd
  21. endef
  22. define Package/libzstd
  23. $(call Package/zstd/Default)
  24. SECTION:=libs
  25. CATEGORY:=Libraries
  26. TITLE:=zstd library.
  27. MENU:=1
  28. endef
  29. define Package/libzstd/description
  30. Zstandard - Fast real-time compression algorithm.
  31. This package provides libzstd library.
  32. endef
  33. define Package/libzstd/config
  34. config ZSTD_OPTIMIZE_O3
  35. bool "Use all optimizations (-O3)"
  36. depends on PACKAGE_libzstd
  37. default y
  38. help
  39. This enables additional optmizations using the -O3 compilation flag.
  40. endef
  41. define Package/zstd
  42. $(call Package/zstd/Default)
  43. SECTION:=utils
  44. CATEGORY:=Utilities
  45. DEPENDS:=+libzstd
  46. TITLE:=Fast real-time compression algorithm.
  47. endef
  48. define Package/zstd/description
  49. Zstandard - Fast real-time compression algorithm.
  50. This package provides the zstd binaries.
  51. endef
  52. ifeq ($(CONFIG_ZSTD_OPTIMIZE_O3),y)
  53. TARGET_CFLAGS:= $(filter-out -O%,$(TARGET_CFLAGS)) -O3
  54. endif
  55. TARGET_CFLAGS += -flto
  56. TARGET_LDFLAGS += -Wl,--as-needed
  57. define Package/libzstd/install
  58. $(INSTALL_DIR) $(1)/usr/lib
  59. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzstd.so* $(1)/usr/lib/
  60. endef
  61. define Package/zstd/install
  62. $(INSTALL_DIR) $(1)/usr/bin
  63. $(CP) $(PKG_INSTALL_DIR)/usr/bin/{unzstd,zstd,zstdcat,zstdmt} $(1)/usr/bin/
  64. endef
  65. $(eval $(call BuildPackage,libzstd))
  66. $(eval $(call BuildPackage,zstd))
  67. $(eval $(call HostBuild))