2015-09-28 17:16:05 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, pkgconfig
|
2015-06-21 08:56:48 +01:00
|
|
|
|
|
|
|
, ApplicationServices, CoreServices }:
|
2014-07-09 01:08:45 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
stable = "stable";
|
|
|
|
unstable = "unstable";
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A multi-platform support library with a focus on asynchronous I/O";
|
2015-01-08 04:56:06 +00:00
|
|
|
homepage = https://github.com/libuv/libuv;
|
2014-07-09 01:08:45 +01:00
|
|
|
maintainers = with maintainers; [ cstrahan ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
};
|
|
|
|
|
|
|
|
mkName = stability: version:
|
|
|
|
if stability == stable
|
|
|
|
then "libuv-${version}"
|
|
|
|
else "libuv-${stability}-${version}";
|
|
|
|
|
|
|
|
mkSrc = version: sha256: fetchFromGitHub {
|
2015-01-08 04:56:06 +00:00
|
|
|
owner = "libuv";
|
2014-07-09 01:08:45 +01:00
|
|
|
repo = "libuv";
|
|
|
|
rev = "v${version}";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
# for versions < 0.11.6
|
|
|
|
mkWithoutAutotools = stability: version: sha256: stdenv.mkDerivation {
|
|
|
|
name = mkName stability version;
|
|
|
|
src = mkSrc version sha256;
|
|
|
|
buildPhase = lib.optionalString stdenv.isDarwin ''
|
|
|
|
mkdir extrapath
|
|
|
|
ln -s /usr/sbin/dtrace extrapath/dtrace
|
|
|
|
export PATH=$PATH:`pwd`/extrapath
|
|
|
|
'' + ''
|
|
|
|
mkdir build
|
|
|
|
make builddir_name=build
|
|
|
|
|
|
|
|
rm -r build/src
|
|
|
|
rm build/libuv.a
|
|
|
|
cp -r include build
|
|
|
|
|
|
|
|
mkdir build/lib
|
|
|
|
mv build/libuv.* build/lib
|
|
|
|
|
|
|
|
pushd build/lib
|
|
|
|
lib=$(basename libuv.*)
|
|
|
|
ext="''${lib##*.}"
|
|
|
|
mv $lib libuv.10.$ext
|
|
|
|
ln -s libuv.10.$ext libuv.$ext
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
cp -r build $out
|
|
|
|
'';
|
|
|
|
inherit meta;
|
|
|
|
};
|
|
|
|
|
|
|
|
# for versions > 0.11.6
|
|
|
|
mkWithAutotools = stability: version: sha256: stdenv.mkDerivation {
|
|
|
|
name = mkName stability version;
|
|
|
|
src = mkSrc version sha256;
|
2015-09-28 17:16:05 +01:00
|
|
|
buildInputs = [ automake autoconf libtool pkgconfig ]
|
2015-06-21 08:56:48 +01:00
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
|
2014-07-09 01:08:45 +01:00
|
|
|
preConfigure = ''
|
|
|
|
LIBTOOLIZE=libtoolize ./autogen.sh
|
|
|
|
'';
|
|
|
|
inherit meta;
|
|
|
|
};
|
|
|
|
|
|
|
|
toVersion = with lib; name:
|
|
|
|
replaceChars ["_"] ["."] (removePrefix "v" name);
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
mapAttrs (v: h: mkWithAutotools unstable (toVersion v) h) {
|
2014-08-20 21:02:39 +01:00
|
|
|
v0_11_29 = "1z07phfwryfy2155p3lxcm2a33h20sfl96lds5dghn157x6csz7m";
|
2014-07-09 01:08:45 +01:00
|
|
|
}
|
2015-01-08 04:56:31 +00:00
|
|
|
//
|
|
|
|
mapAttrs (v: h: mkWithAutotools stable (toVersion v) h) {
|
2015-09-12 07:25:49 +01:00
|
|
|
v1_7_5 = "18x6cy2xn31am97vn6jli7kmb2fbp4c8kmv7jm97vggh0x55flsc";
|
2015-01-08 04:56:31 +00:00
|
|
|
}
|