nixpkgs/pkgs/tools/text/boxes/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.4 KiB
Nix
Raw Normal View History

2024-04-16 11:48:57 +02:00
{ lib, gccStdenv, fetchFromGitHub, bison, flex, pcre2, libunistring, ncurses }:
2019-11-30 16:06:04 +01:00
2024-04-16 11:48:57 +02:00
gccStdenv.mkDerivation rec {
2019-11-30 16:06:04 +01:00
pname = "boxes";
2024-04-16 11:48:57 +02:00
version = "2.3.0";
2019-11-30 16:06:04 +01:00
src = fetchFromGitHub {
owner = "ascii-boxes";
repo = "boxes";
rev = "v${version}";
2024-04-16 11:48:57 +02:00
hash = "sha256-/gc/5vDflmEwOtQbtLwRcchyr22rLQcWqs5GrwRxY70=";
2019-11-30 16:06:04 +01:00
};
# Building instructions:
# https://boxes.thomasjensen.com/build.html#building-on-linux--unix
nativeBuildInputs = [ bison flex ];
2024-04-16 11:48:57 +02:00
buildInputs = [ pcre2 libunistring ncurses ];
2019-11-30 16:06:04 +01:00
dontConfigure = true;
# Makefile references a system wide config file in '/usr/share'. Instead, we
# move it within the store by default.
preBuild = ''
substituteInPlace Makefile \
2024-04-16 11:48:57 +02:00
--replace-fail "GLOBALCONF = /usr/share/boxes" \
2019-11-30 16:06:04 +01:00
"GLOBALCONF=${placeholder "out"}/share/boxes/boxes-config"
'';
2024-04-16 11:48:57 +02:00
makeFlags = [ "CC=${gccStdenv.cc.targetPrefix}cc" ];
2019-11-30 16:06:04 +01:00
installPhase = ''
2024-04-16 11:48:57 +02:00
install -Dm755 -t $out/bin out/boxes
2019-11-30 16:06:04 +01:00
install -Dm644 -t $out/share/boxes boxes-config
install -Dm644 -t $out/share/man/man1 doc/boxes.1
'';
meta = with lib; {
description = "A command line program which draws, removes, and repairs ASCII art boxes";
mainProgram = "boxes";
homepage = "https://boxes.thomasjensen.com";
2019-11-30 16:06:04 +01:00
license = licenses.gpl2;
maintainers = with maintainers; [ waiting-for-dev ];
platforms = platforms.unix;
};
}