2016-06-09 21:40:49 +01:00
|
|
|
{ stdenv, fetchFromGitHub, nim, openssl }:
|
|
|
|
|
2016-01-21 08:51:21 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "nimble-${version}";
|
|
|
|
|
2016-06-09 21:40:49 +01:00
|
|
|
version = "0.7.4";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nim-lang";
|
|
|
|
repo = "nimble";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1l477f1zlqpc738jg47pz599cwjasgy9jqdsplj3ywd12xfqpc96";
|
|
|
|
};
|
2016-01-21 08:51:21 +00:00
|
|
|
|
|
|
|
buildInputs = [ nim ];
|
|
|
|
|
2016-06-09 21:40:49 +01:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace src/nimble.nim.cfg --replace "./vendor/nim" "${nim}/share"
|
2016-01-21 08:51:21 +00:00
|
|
|
'';
|
2016-06-09 21:40:49 +01:00
|
|
|
|
|
|
|
buildPhase = ''
|
2016-01-21 08:51:21 +00:00
|
|
|
nim c src/nimble
|
|
|
|
'';
|
2016-06-09 21:40:49 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp src/nimble $out/bin
|
|
|
|
patchelf --set-rpath "${stdenv.lib.makeLibraryPath [stdenv.cc.libc openssl]}" \
|
|
|
|
--add-needed libcrypto.so \
|
|
|
|
"$out/bin/nimble"
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
2016-01-21 08:51:21 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Package manager for the Nim programming language";
|
|
|
|
homepage = https://github.com/nim-lang/nimble;
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ kamilchm ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|