depot/third_party/nixpkgs/pkgs/development/libraries/linenoise/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

49 lines
1.1 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, validatePkgConfig
}:
stdenv.mkDerivation {
pname = "linenoise";
version = "1.0-34-g93b2db9";
src = fetchFromGitHub {
owner = "antirez";
repo = "linenoise";
rev = "1.0-34-g93b2db9";
hash = "sha256-GsrYg16gpjHkkmpCU3yGzqNS/buZl+JoWALLvwzmT4A=";
};
nativeBuildInputs = [ validatePkgConfig ];
buildPhase = ''
runHook preBuild
$CC -c -o linenoise.o linenoise.c
$CC -shared -o liblinenoise.so linenoise.o
$AR rcs liblinenoise.a linenoise.o
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -d $out/lib/pkgconfig $out/include
install -m644 linenoise.h $out/include/
install -m644 liblinenoise.a $out/lib/
install -m644 liblinenoise.so $out/lib/
substituteAll ${./linenoise.pc.in} $out/lib/pkgconfig/linenoise.pc
runHook postInstall
'';
meta = {
homepage = "https://github.com/antirez/linenoise";
description = "Minimal, zero-config, BSD licensed, readline replacement";
maintainers = with lib.maintainers; [ fstamour remexre ];
platforms = lib.platforms.unix;
license = lib.licenses.bsd2;
};
}