Files
nixpkgs/pkgs/by-name/li/linenoise/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

58 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
validatePkgConfig,
fixDarwinDylibNames,
}:
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
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ];
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;
};
}