about summary refs log tree commit diff
path: root/pkgs/by-name/_4/_4th/package.nix
blob: d965f8c5e07f033bfcdf17b7192b4b158885a713 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ lib
, stdenv
, fetchurl
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "4th";
  version = "3.64.1";

  src = fetchurl {
    url = "https://sourceforge.net/projects/forth-4th/files/4th-${finalAttrs.version}/4th-${finalAttrs.version}-unix.tar.gz";
    hash = "sha256-+W6nTNsqrf3Dvr+NbSz3uJdrXVbBI3OHR5v/rs7en+M=";
  };

  outputs = [ "out" "man" ];

  patches = [
    # Fix install manual; report this patch to upstream
    ./001-install-manual-fixup.diff
  ];

  dontConfigure = true;

  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 = "A portable Forth compiler";
    license = lib.licenses.lgpl3Plus;
    mainProgram = "4th";
    maintainers = with lib.maintainers; [ AndersonTorres ];
    platforms = lib.platforms.unix;
  };
})
# TODO: set Makefile according to platform