summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/in/intercal/package.nix
blob: ad86423ede8b5686976ebc98c9ea1a7afe9e7386 (plain)
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
54
55
56
57
58
{
  lib,
  stdenv,
  fetchurl,
  fetchpatch,
  autoreconfHook,
  bison,
  flex,
  makeWrapper,
  pkg-config,
}:

stdenv.mkDerivation rec {

  pname = "intercal";
  version = "0.35";

  src = fetchurl {
    url = "http://catb.org/esr/intercal/intercal-${version}.tar.gz";
    hash = "sha256-tV6O3GjiUXoGepAnZuL1e5e1AlU/3LritaskY7pY8OE=";
  };

  postPatch = ''
    # Workaround: https://gitlab.com/esr/intercal/-/work_items/9
    substituteInPlace src/abcessh.in --replace-fail "#ifdef HAVE_STDARG_H" "#if 1"
  '';

  nativeBuildInputs = [
    autoreconfHook
    bison
    flex
    makeWrapper
    pkg-config
  ];

  # Intercal invokes gcc, so we need an explicit PATH
  postInstall = ''
    wrapProgram $out/bin/ick --suffix PATH ':' ${stdenv.cc}/bin
  '';

  meta = {
    description = "Original esoteric programming language";
    longDescription = ''
      INTERCAL, an abbreviation for "Compiler Language With No
      Pronounceable Acronym", is a famously esoterical programming
      language. It was created in 1972, by Donald R. Woods and James
      M. Lyon, with the unusual goal of creating a language with no
      similarities whatsoever to any existing programming
      languages. The language largely succeeds in this goal, apart
      from its use of an assignment statement.
    '';
    homepage = "http://www.catb.org/~esr/intercal/";
    license = lib.licenses.gpl2Plus;
    maintainers = [ ];
    platforms = lib.platforms.linux;
  };
}
# TODO: investigate if LD_LIBRARY_PATH needs to be set