2024-04-21 15:54:59 +00:00
|
|
|
{ lib, gccStdenv, fetchFromGitHub, bison, flex, pcre2, libunistring, ncurses }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
gccStdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "boxes";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ascii-boxes";
|
|
|
|
repo = "boxes";
|
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-/gc/5vDflmEwOtQbtLwRcchyr22rLQcWqs5GrwRxY70=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Building instructions:
|
|
|
|
# https://boxes.thomasjensen.com/build.html#building-on-linux--unix
|
|
|
|
nativeBuildInputs = [ bison flex ];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
buildInputs = [ pcre2 libunistring ncurses ];
|
|
|
|
|
2020-04-24 23:36:52 +00: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-21 15:54:59 +00:00
|
|
|
--replace-fail "GLOBALCONF = /usr/share/boxes" \
|
2020-04-24 23:36:52 +00:00
|
|
|
"GLOBALCONF=${placeholder "out"}/share/boxes/boxes-config"
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
makeFlags = [ "CC=${gccStdenv.cc.targetPrefix}cc" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
install -Dm755 -t $out/bin out/boxes
|
2020-04-24 23:36:52 +00:00
|
|
|
install -Dm644 -t $out/share/boxes boxes-config
|
|
|
|
install -Dm644 -t $out/share/man/man1 doc/boxes.1
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-01-13 08:15:51 +00:00
|
|
|
description = "A command line program which draws, removes, and repairs ASCII art boxes";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "boxes";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://boxes.thomasjensen.com";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ waiting-for-dev ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|