changeset 5840:52dc0306768d

Add build-zstd target * src/build-zstd.mk: new file * dist-files.mk, index.html: add ref to zstd
author John Donoghue <john.donoghue@ieee.org>
date Thu, 12 Aug 2021 14:44:22 -0400
parents f0fc792daaa6
children a3c143ede8af
files dist-files.mk index.html src/build-zstd.mk
diffstat 3 files changed, 36 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dist-files.mk	Thu Aug 12 14:02:05 2021 +0200
+++ b/dist-files.mk	Thu Aug 12 14:44:22 2021 -0400
@@ -49,6 +49,7 @@
   build-scons.mk \
   build-sed.mk \
   build-setuptools.mk \
+  build-zstd.mk \
   build-texinfo.mk \
   build-xz.mk \
   build-yasm.mk \
--- a/index.html	Thu Aug 12 14:02:05 2021 +0200
+++ b/index.html	Thu Aug 12 14:44:22 2021 -0400
@@ -1098,6 +1098,10 @@
         <td class="website"><a href="http://yasm.tortall.net/">Yasm</a></td>
     </tr>
     <tr>
+        <td class="package">build-zstd</td>
+        <td class="website"><a href="https://github.com/facebook/zstd">Yasm</a></td>
+    </tr>
+    <tr>
         <td class="package">bzip2</td>
         <td class="website"><a href="http://www.bzip.org/">bzip2</a></td>
     </tr>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/build-zstd.mk	Thu Aug 12 14:44:22 2021 -0400
@@ -0,0 +1,31 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := build-zstd
+$(PKG)_IGNORE   := 
+$(PKG)_VERSION  := 1.5.0
+$(PKG)_CHECKSUM := c53019729e3a595f0104facab6533d78296a2945
+$(PKG)_SUBDIR   := zstd-$($(PKG)_VERSION)
+$(PKG)_FILE     := zstd-$($(PKG)_VERSION).tar.lz
+$(PKG)_URL      := https://github.com/facebook/zstd/releases/download/v$($(PKG)_VERSION)/zstd-$($(PKG)_VERSION).tar.gz
+$(PKG)_DEPS     := build-cmake
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- 'https://github.com/facebook/zstd/tags' | \
+    $(SED) -n 's|.*releases/tag/v\([^"]*\).*|\1|p' | $(SORT) -V | \
+    tail -1
+endef
+
+$(PKG)_CMAKE_FLAGS := -DZSTD_BUILD_TESTS=ON -DZSTD_BUILD_SHARED=OFF \
+	-DZSTD_BUILD_STATIC=ON -DZSTD_PROGRAMS_LINK_SHARED=OFF -DZSTD_MULTITHREAD_SUPPORT=OFF
+
+define $(PKG)_BUILD
+  mkdir '$(1)/.build' && cd '$(1)/.build' && cmake $(1)/build/cmake/ \
+    $($(PKG)_CMAKE_FLAGS) \
+    $(CMAKE_CCACHE_FLAGS) \
+    -DCMAKE_INSTALL_PREFIX='$(3)$(BUILD_TOOLS_PREFIX)' \
+    -DBUILD_TESTING=Off
+
+  cmake --build '$(1)/.build' -j '$(JOBS)'
+  cmake --install '$(1)/.build'
+endef