diff --git a/pkgs/by-name/yo/yodl/package.nix b/pkgs/by-name/yo/yodl/package.nix index cf967a7893b2..00c10f8f0ba0 100644 --- a/pkgs/by-name/yo/yodl/package.nix +++ b/pkgs/by-name/yo/yodl/package.nix @@ -5,55 +5,87 @@ perl, icmake, util-linux, + bash, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "yodl"; - version = "4.03.03"; - - nativeBuildInputs = [ icmake ]; - - buildInputs = [ perl ]; + version = "4.05.00"; src = fetchFromGitLab { - hash = "sha256-MeD/jjhwoiWTb/G8pHrnEEX22h+entPr9MhJ6WHO3DM="; - rev = version; - repo = "yodl"; owner = "fbb-git"; + repo = "yodl"; + tag = finalAttrs.version; + hash = "sha256-QnEjMHuZHj+iPlmiPsAcaNF8RRd/Ld59PA1neuzo1Go="; }; setSourceRoot = '' sourceRoot=$(echo */yodl) ''; - preConfigure = '' + postPatch = '' + for header in media/media.h stack/stack.h message/message.h symbol/symbol.ih symbol/sysp.c hashitem/hashitem.h args/args.h ostream/ostream.h; do + sed -i '1i#include ' "$header" + done patchShebangs ./build patchShebangs scripts/ - substituteInPlace INSTALL.im --replace /usr $out - substituteInPlace macros/rawmacros/startdoc.pl --replace /usr/bin/perl ${perl}/bin/perl - substituteInPlace scripts/yodl2whatever.in --replace getopt ${util-linux}/bin/getopt + substituteInPlace INSTALL.im \ + --replace-fail "/usr" "$out" + substituteInPlace macros/rawmacros/startdoc.pl \ + --replace-fail "/usr/bin/perl" "${lib.getExe perl}" + substituteInPlace scripts/yodl2whatever.in \ + --replace-fail "getopt" "${lib.getExe' util-linux "getopt"}" + substituteInPlace icmake/stdcpp \ + --replace-fail "printf << \" \" << file << '\n';" 'printf(" " + file + "\n");' ''; + nativeBuildInputs = [ + icmake + perl + bash + ]; + # Set TERM because icmbuild calls tput. - TERM = "xterm"; + env.TERM = "xterm"; buildPhase = '' + runHook preBuild + + CXXFLAGS+=' --std=c++20' + export CXXFLAGS ./build programs ./build macros ./build man + ./build html + + runHook postBuild ''; installPhase = '' + runHook preInstall + ./build install programs ./build install macros ./build install man + # dangling symlinks + rm $out/share/man/man1/yodl2xml.1 + rm $out/share/man/man1/yodl2txt.1 + rm $out/share/man/man1/yodl2man.1 + rm $out/share/man/man1/yodl2latex.1 + rm $out/share/man/man1/yodl2html.1 + rm $out/share/man/man1/yodl2whatever.1 + ./build install manual + + runHook postInstall ''; - meta = with lib; { + meta = { + changelog = "https://gitlab.com/fbb-git/yodl/-/blob/${finalAttrs.src.tag}/yodl/changelog"; description = "Package that implements a pre-document language and tools to process it"; homepage = "https://fbb-git.gitlab.io/yodl/"; - license = licenses.gpl3; - maintainers = with maintainers; [ pSub ]; - platforms = platforms.linux; + mainProgram = "yodl"; + license = lib.licenses.agpl3Only; # Upstream did not clarify the license used. https://gitlab.com/fbb-git/yodl/-/issues/4 + maintainers = with lib.maintainers; [ pSub ]; + platforms = lib.platforms.linux; }; -} +})