diff --git a/.gitignore b/.gitignore index 83995e7..e434e9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .stack-work -/dist \ No newline at end of file +/dist +/bin +/node diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 86e1cf6..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "node"] - path = node - url = https://github.com/nodejs/node.git diff --git a/Setup.hs b/Setup.hs index 8b58f2b..b3d6b8b 100644 --- a/Setup.hs +++ b/Setup.hs @@ -10,7 +10,7 @@ import System.Directory import System.FilePath (()) nodeRelPath :: FilePath -nodeRelPath = "node/node" +nodeRelPath = "bin/node" buildNode :: Verbosity -> IO () buildNode verbosity = diff --git a/build_node.sh b/build_node.sh index 94e9b65..9753a84 100644 --- a/build_node.sh +++ b/build_node.sh @@ -1,5 +1,7 @@ #!/bin/bash +mkdir -p bin + # adapted from https://apple.stackexchange.com/a/123408/11374 function version { echo "${@//v}" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } @@ -7,12 +9,14 @@ NODE_VERSION=`node --version` if [ $(version "$NODE_VERSION") -ge $(version "v6.2.1") ]; then echo "Using existing system node $NODE_VERSION" - cp `which node` node/node + cp `which node` bin/node else echo "Building nodejs from source" # node not available or too old. Build from source. - git submodule update --init --recursive + git clone --depth 1 -b v6.11.3 https://github.com/nodejs/node.git cd node ./configure --prefix=/tmp make -j4 + cd .. + cp node/node bin/node fi diff --git a/node b/node deleted file mode 160000 index dbce2ec..0000000 --- a/node +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dbce2ecab3614e128fe028751470f49a60f2e860 diff --git a/nodejs-exec.cabal b/nodejs-exec.cabal index f01ffd3..f1f4915 100644 --- a/nodejs-exec.cabal +++ b/nodejs-exec.cabal @@ -12,7 +12,7 @@ copyright: 2016 Yair category: Foreign build-type: Custom cabal-version: >=1.8 -data-files: node/node +data-files: bin/node library hs-source-dirs: src