2019-10-01 21:22:48 +01:00
|
|
|
{ stdenv, fetchFromGitHub, pkgconfig }:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libco-canonical";
|
2019-11-09 03:43:03 +00:00
|
|
|
version = "20";
|
2019-10-01 21:22:48 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "canonical";
|
|
|
|
repo = "libco";
|
|
|
|
rev = "v${version}";
|
2019-11-09 03:43:03 +00:00
|
|
|
sha256 = "0r5b1r0sxngx349s5a3zkkvfw5by9y492kr34b25gjspzvjchlxq";
|
2019-10-01 21:22:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
|
|
|
|
|
|
|
outputs = [ "dev" "out" ];
|
|
|
|
|
2019-11-08 06:04:51 +00:00
|
|
|
patchPhase = ''
|
|
|
|
# upstream project assumes all build products will go into single directory
|
|
|
|
# `$prefix` but we need `includedir` to point to "dev", not "out"
|
|
|
|
#
|
|
|
|
# pkgs/build-support/setup-hooks/multiple-outputs.sh would normally patch
|
|
|
|
# this automatically, but it fails here due to use of absolute paths
|
|
|
|
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "@includedir@|\$(PREFIX)" "@includedir@|${placeholder "dev"}"
|
|
|
|
'';
|
|
|
|
|
2019-10-01 21:22:48 +01:00
|
|
|
meta = {
|
|
|
|
description = "A cooperative multithreading library written in C89";
|
|
|
|
homepage = "https://github.com/canonical/libco";
|
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = with maintainers; [ wucke13 ];
|
|
|
|
};
|
|
|
|
}
|