binaryen: simplify build
This commit is contained in:
parent
2d39da2084
commit
7c6ef8b5cd
|
@ -1,38 +0,0 @@
|
||||||
From 1c6af6c68ba3f49ae9e942844c739e934339d3b9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Maximilian Bosch <maximilian@mbosch.me>
|
|
||||||
Date: Sat, 14 Mar 2020 00:37:31 +0100
|
|
||||||
Subject: [PATCH] Get rid of git dependency
|
|
||||||
|
|
||||||
---
|
|
||||||
CMakeLists.txt | 15 +--------------
|
|
||||||
1 file changed, 1 insertion(+), 14 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
||||||
index 4acf703e1..4e9bd60b5 100644
|
|
||||||
--- a/CMakeLists.txt
|
|
||||||
+++ b/CMakeLists.txt
|
|
||||||
@@ -7,20 +7,7 @@ IF(NOT CMAKE_BUILD_TYPE)
|
|
||||||
SET(CMAKE_BUILD_TYPE "Release")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
-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})
|
|
||||||
- MESSAGE(WARNING "Error running git describe to determine version")
|
|
||||||
- SET(BINARYEN_VERSION_INFO "(unable to determine version)")
|
|
||||||
-ELSE()
|
|
||||||
- SET(BINARYEN_VERSION_INFO "${GIT_HASH}")
|
|
||||||
-ENDIF()
|
|
||||||
+SET(BINARYEN_VERSION_INFO "@emscriptenv@")
|
|
||||||
CONFIGURE_FILE(config.h.in config.h)
|
|
||||||
|
|
||||||
OPTION(BUILD_STATIC_LIB "Build as a static library" OFF)
|
|
||||||
--
|
|
||||||
2.25.0
|
|
||||||
|
|
|
@ -1,39 +1,16 @@
|
||||||
{ stdenv, cmake, python3, fetchFromGitHub, emscriptenRev ? null, substituteAll }:
|
{ stdenv, cmake, python3, fetchFromGitHub }:
|
||||||
|
|
||||||
let
|
|
||||||
defaultVersion = "95";
|
|
||||||
|
|
||||||
# Map from git revs to SHA256 hashes
|
|
||||||
sha256s = {
|
|
||||||
version_95 = "1w4js9bm5qv5aws8bzz4f0n3ni2l7h4fidkq9v5bldf0zxncy8m3";
|
|
||||||
"1.39.1" = "0ygm9m5322h4vfpf3j63q32qxk2l26yk62hh7dkb49j51zwl1y3y";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = if emscriptenRev == null
|
|
||||||
then defaultVersion
|
|
||||||
else "emscripten-${emscriptenRev}";
|
|
||||||
rev = if emscriptenRev == null
|
|
||||||
then "version_${version}"
|
|
||||||
else emscriptenRev;
|
|
||||||
pname = "binaryen";
|
pname = "binaryen";
|
||||||
|
version = "95";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "WebAssembly";
|
owner = "WebAssembly";
|
||||||
repo = "binaryen";
|
repo = "binaryen";
|
||||||
sha256 =
|
rev = "version_${version}";
|
||||||
if builtins.hasAttr rev sha256s
|
sha256 = "1w4js9bm5qv5aws8bzz4f0n3ni2l7h4fidkq9v5bldf0zxncy8m3";
|
||||||
then builtins.getAttr rev sha256s
|
|
||||||
else null;
|
|
||||||
inherit rev;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = stdenv.lib.optional (emscriptenRev != null) (substituteAll {
|
|
||||||
src = ./0001-Get-rid-of-git-dependency.patch;
|
|
||||||
emscriptenv = "1.39.1";
|
|
||||||
});
|
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake python3 ];
|
nativeBuildInputs = [ cmake python3 ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
|
Loading…
Reference in New Issue