Files
nixpkgs/pkgs/by-name/_4/_4th/package.nix
KPCCoiL 3dbbca0371 _4th: fix editor for 64bit systems
Use headers in `sources/include{32, 64}` to fix the builtin editor, as suggested by `README`.
The problem is described in the FAQ section of the [manual](https://thebeez.home.xs4all.nl/4tH/4tHmanual.pdf).
Although the manual suggests regenerating the headers (section 27.8), the required headers seem to be already in the distirbution.
2026-05-16 15:29:48 +09:00

58 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "4th";
version = "3.64.2";
src = fetchurl {
url = "https://sourceforge.net/projects/forth-4th/files/4th-${finalAttrs.version}/4th-${finalAttrs.version}-unix.tar.gz";
hash = "sha256-ufQiuRDPmcYzFSQf16cuZSrOEbH3itq7yZYo87zPs1g=";
};
outputs = [
"out"
"man"
];
dontConfigure = true;
preBuild = ''
cp sources/include${if stdenv.hostPlatform.is64bit then "64" else "32"}/* sources/
make -C sources clean
'';
makeFlags = [
"-C sources"
"CC:=$(CC)"
"AR:=$(AR)"
];
preInstall = ''
install -d ${placeholder "out"}/bin \
${placeholder "out"}/lib \
${placeholder "out"}/share/doc/4th \
${placeholder "man"}/share/man
'';
installFlags = [
"BINARIES=${placeholder "out"}/bin"
"LIBRARIES=${placeholder "out"}/lib"
"DOCDIR=${placeholder "out"}/share/doc"
"MANDIR=${placeholder "man"}/share/man"
];
meta = {
homepage = "https://thebeez.home.xs4all.nl/4tH/index.html";
description = "Portable Forth compiler";
license = lib.licenses.lgpl3Plus;
mainProgram = "4th";
maintainers = with lib.maintainers; [ chillcicada ];
platforms = lib.platforms.unix;
};
})
# TODO: set Makefile according to platform