diff --git a/pkgs/development/tools/wabt/default.nix b/pkgs/development/tools/wabt/default.nix index 4c7df9b12d8b..b3be6c4552dd 100644 --- a/pkgs/development/tools/wabt/default.nix +++ b/pkgs/development/tools/wabt/default.nix @@ -1,16 +1,24 @@ -{ stdenv, fetchFromGitHub, cmake, python3 }: +{ stdenv, fetchFromGitHub, cmake, python3, substituteAll }: stdenv.mkDerivation rec { pname = "wabt"; - version = "1.0.12"; + version = "1.0.13"; src = fetchFromGitHub { - owner = "WebAssembly"; - repo = "wabt"; - rev = version; - sha256 = "1zlv3740wkqj4mn6sr84h0x6wk2lcp4pwwmqsh5yyqp1j1glbsa0"; + owner = "WebAssembly"; + repo = "wabt"; + rev = version; + sha256 = "07x8m5sf4c7zjq1flypycw1d15ylqdp38l81vn961ds089ngvpgg"; + fetchSubmodules = true; }; + patches = [ + (substituteAll { + src = ./version.patch; + inherit version; + }) + ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = [ "-DBUILD_TESTS=OFF" ]; buildInputs = [ python3 ]; diff --git a/pkgs/development/tools/wabt/version.patch b/pkgs/development/tools/wabt/version.patch new file mode 100644 index 000000000000..a49cd0bc1552 --- /dev/null +++ b/pkgs/development/tools/wabt/version.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 363a5660..ad3300ed 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -68,22 +68,7 @@ endif () + include(CheckTypeSize) + check_type_size(ssize_t SSIZE_T) + check_type_size(size_t SIZEOF_SIZE_T) +- +-FIND_PACKAGE(Git QUIET REQUIRED) +-EXECUTE_PROCESS(COMMAND +- "${GIT_EXECUTABLE}" --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git describe --tags +- RESULT_VARIABLE +- GIT_HASH_RESULT +- OUTPUT_VARIABLE +- GIT_HASH +- OUTPUT_STRIP_TRAILING_WHITESPACE) +- +-IF(${GIT_HASH_RESULT} EQUAL 0) +- SET(WABT_VERSION_INFO "${GIT_HASH}") +-ELSE() +- MESSAGE(WARNING "Error running git describe to determine version") +- SET(WABT_VERSION_INFO "(unable to determine version)") +-ENDIF() ++SET(WABT_VERSION_INFO "@version@") + + configure_file( + ${WABT_SOURCE_DIR}/src/config.h.in