btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / _4 / _4th / package.nix
blobabc2d53fe0b6064d037fa80948c60102a920d752
1 { lib
2 , stdenv
3 , fetchurl
4 }:
6 stdenv.mkDerivation (finalAttrs: {
7   pname = "4th";
8   version = "3.64.1";
10   src = fetchurl {
11     url = "https://sourceforge.net/projects/forth-4th/files/4th-${finalAttrs.version}/4th-${finalAttrs.version}-unix.tar.gz";
12     hash = "sha256-+W6nTNsqrf3Dvr+NbSz3uJdrXVbBI3OHR5v/rs7en+M=";
13   };
15   outputs = [ "out" "man" ];
17   patches = [
18     # Fix install manual; report this patch to upstream
19     ./001-install-manual-fixup.diff
20   ];
22   dontConfigure = true;
24   makeFlags = [
25     "-C sources"
26     "CC:=$(CC)"
27     "AR:=$(AR)"
28   ];
30   preInstall = ''
31     install -d ${placeholder "out"}/bin \
32                ${placeholder "out"}/lib \
33                ${placeholder "out"}/share/doc/4th \
34                ${placeholder "man"}/share/man
35   '';
37   installFlags = [
38     "BINARIES=${placeholder "out"}/bin"
39     "LIBRARIES=${placeholder "out"}/lib"
40     "DOCDIR=${placeholder "out"}/share/doc"
41     "MANDIR=${placeholder "man"}/share/man"
42   ];
44   meta = {
45     homepage = "https://thebeez.home.xs4all.nl/4tH/index.html";
46     description = "Portable Forth compiler";
47     license = lib.licenses.lgpl3Plus;
48     mainProgram = "4th";
49     maintainers = with lib.maintainers; [ AndersonTorres ];
50     platforms = lib.platforms.unix;
51   };
53 # TODO: set Makefile according to platform