2018-09-26 09:34:24 +00:00
|
|
|
{ stdenv, lib, makeWrapper, git, nodejs, openssl, pcre, readline, sqlite }:
|
2018-06-24 14:34:32 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
# This derivation may be a bit confusing at first, because it builds the Status'
|
|
|
|
# Nimbus branch of Nim using the standard Nim compiler provided by Nix.
|
|
|
|
#
|
|
|
|
# It's mostly a copy of the original Nim recipe, but uses git to obtain the
|
|
|
|
# sources and have a simplified `buildPhase`.
|
|
|
|
#
|
|
|
|
# For maintainance, you only need to bump the obtained git revision from time
|
|
|
|
# to time.
|
|
|
|
|
|
|
|
name = "status-nim";
|
|
|
|
version = "0.18.1";
|
|
|
|
|
|
|
|
src = fetchGit {
|
|
|
|
url = "git://github.com/status-im/Nim";
|
|
|
|
ref = "nimbus";
|
|
|
|
|
|
|
|
# Set this to the hash of the head commit in the nimbus branch:
|
2018-09-26 09:34:24 +00:00
|
|
|
rev = "c240806756579c3375b1a79e1e65c40087a52ac5";
|
2018-06-24 14:34:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
NIX_LDFLAGS = [
|
|
|
|
"-lcrypto"
|
|
|
|
"-lpcre"
|
|
|
|
"-lreadline"
|
|
|
|
"-lsqlite3"
|
|
|
|
];
|
|
|
|
|
|
|
|
# 1. nodejs is only needed for tests
|
|
|
|
# 2. we could create a separate derivation for the "written in c" version of nim
|
|
|
|
# used for bootstrapping, but koch insists on moving the nim compiler around
|
|
|
|
# as part of building it, so it cannot be read-only
|
|
|
|
|
|
|
|
buildInputs = [
|
2018-09-26 09:34:24 +00:00
|
|
|
makeWrapper nodejs
|
|
|
|
openssl pcre readline sqlite git
|
2018-06-24 14:34:32 +00:00
|
|
|
];
|
|
|
|
|
2019-02-06 20:02:02 +00:00
|
|
|
buildPhase =
|
|
|
|
let caBundle = ./ca-bundle.pem;
|
|
|
|
in ''
|
|
|
|
export HOME=$TMP
|
|
|
|
export GIT_SSL_CAINFO=${caBundle}
|
|
|
|
sh build_all.sh
|
|
|
|
'';
|
2018-06-24 14:34:32 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dt $out/bin bin/* koch
|
|
|
|
./koch install $out
|
|
|
|
mv $out/nim/bin/* $out/bin/ && rmdir $out/nim/bin
|
|
|
|
mv $out/nim/* $out/ && rmdir $out/nim
|
|
|
|
wrapProgram $out/bin/nim \
|
|
|
|
--suffix PATH : ${lib.makeBinPath [ stdenv.cc ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Status's build of Nim";
|
|
|
|
homepage = https://nim-lang.org/;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ehmry peterhoeg ];
|
|
|
|
platforms = with platforms; linux ++ darwin; # arbitrary
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|