1{ lib, stdenv, fetchurl, fetchpatch
2, pkg-config
3, bison, flex
4, makeWrapper }:
5
6stdenv.mkDerivation rec {
7
8 pname = "intercal";
9 version = "0.31";
10
11 src = fetchurl {
12 url = "http://catb.org/esr/intercal/${pname}-${version}.tar.gz";
13 sha256 = "1z2gpa5rbqb7jscqlf258k0b0jc7d2zkyipb5csjpj6d3sw45n4k";
14 };
15
16 patches = [
17 # Pull patch pending upstream inclusion for -fno-common toolchains:
18 # https://gitlab.com/esr/intercal/-/issues/4
19 (fetchpatch {
20 name = "fno-common.patch";
21 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-lang/c-intercal/files/c-intercal-31.0-no-common.patch?id=a110a98b4de6f280d770ba3cc92a4612326205a3";
22 sha256 = "03523fc40042r2ryq5val27prlim8pld4950qqpawpism4w3y1p2";
23 })
24 ];
25
26 nativeBuildInputs = [ pkg-config bison flex makeWrapper ];
27
28 # Intercal invokes gcc, so we need an explicit PATH
29 postInstall = ''
30 wrapProgram $out/bin/ick --suffix PATH ':' ${stdenv.cc}/bin
31 '';
32
33 meta = with lib; {
34 description = "The original esoteric programming language";
35 longDescription = ''
36 INTERCAL, an abbreviation for "Compiler Language With No
37 Pronounceable Acronym", is a famously esoterical programming
38 language. It was created in 1972, by Donald R. Woods and James
39 M. Lyon, with the unusual goal of creating a language with no
40 similarities whatsoever to any existing programming
41 languages. The language largely succeeds in this goal, apart
42 from its use of an assignment statement.
43 '';
44 homepage = "http://www.catb.org/~esr/intercal/";
45 license = licenses.gpl2Plus;
46 maintainers = [ maintainers.AndersonTorres ];
47 platforms = platforms.linux;
48 };
49}
50# TODO: investigate if LD_LIBRARY_PATH needs to be set