2017-04-20 23:55:47 +01:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook }:
|
2012-02-05 00:51:35 +00:00
|
|
|
|
2017-03-01 01:35:26 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "libbsd-${version}";
|
|
|
|
version = "0.8.3";
|
2012-02-05 00:51:35 +00:00
|
|
|
|
2017-04-20 23:55:47 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
|
|
|
preAutoreconf = "mkdir m4";
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace configure.ac \
|
|
|
|
--replace "m4_esyscmd([./get-version])" "${version}"
|
|
|
|
sed -i '38i#undef strlcpy' include/bsd/string.h
|
|
|
|
sed -i '38i#undef strlcat' include/bsd/string.h
|
|
|
|
substituteInPlace src/setproctitle.c \
|
|
|
|
--replace 'extern typeof(setproctitle_impl) setproctitle_stub __attribute__((weak, alias("setproctitle_impl")));' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "JackieXie168";
|
|
|
|
repo = "libbsd";
|
|
|
|
rev = "macosx-${version}";
|
|
|
|
sha256 = "1g5h6d7i297m0hs2l0dxvsx6p0z96959pzgp75drbb7mkrf32p2z";
|
2012-02-05 00:51:35 +00:00
|
|
|
};
|
|
|
|
|
2017-03-01 01:35:26 +00:00
|
|
|
meta = with stdenv.lib; {
|
2012-02-05 00:51:35 +00:00
|
|
|
description = "Common functions found on BSD systems";
|
|
|
|
homepage = http://libbsd.freedesktop.org/;
|
2017-03-01 01:35:26 +00:00
|
|
|
license = licenses.bsd3;
|
2017-04-20 23:55:47 +01:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2012-02-05 00:51:35 +00:00
|
|
|
};
|
|
|
|
}
|