1{ lib, stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 pname = "4th";
5 version = "3.64.1";
6
7 src = fetchurl {
8 url = "https://sourceforge.net/projects/forth-4th/files/${pname}-${version}/${pname}-${version}-unix.tar.gz";
9 hash = "sha256-+W6nTNsqrf3Dvr+NbSz3uJdrXVbBI3OHR5v/rs7en+M=";
10 };
11
12 patches = [
13 # Fix install manual; report this patch to upstream
14 ./001-install-manual-fixup.diff
15 ];
16
17 dontConfigure = true;
18
19 makeFlags = [
20 "-C sources"
21 "CC=${stdenv.cc.targetPrefix}cc"
22 ];
23
24 preInstall = ''
25 install -d ${placeholder "out"}/bin \
26 ${placeholder "out"}/lib \
27 ${placeholder "out"}/share/doc/${pname} \
28 ${placeholder "out"}/share/man
29 '';
30
31 installFlags = [
32 "BINARIES=${placeholder "out"}/bin"
33 "LIBRARIES=${placeholder "out"}/lib"
34 "DOCDIR=${placeholder "out"}/share/doc"
35 "MANDIR=${placeholder "out"}/share/man"
36 ];
37
38 meta = with lib; {
39 homepage = "https://thebeez.home.xs4all.nl/4tH/index.html";
40 description = "A portable Forth compiler";
41 license = licenses.lgpl3Plus;
42 maintainers = with maintainers; [ AndersonTorres ];
43 platforms = platforms.unix;
44 };
45}
46# TODO: set Makefile according to platform