summaryrefslogtreecommitdiff
path: root/smalltalk/release.nix
blob: 5c4f402de5b93c16ee02e1f32beb8230b4226973 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
/* Continuous integration of GNU with Hydra/Nix.
   Copyright (C) 2013  Rob Vermaas <rob.vermaas@gmail.com>

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

{ nixpkgs ? <nixpkgs>
, smalltalk ? { outPath = <smalltalk>; }
}:

let
  pkgs = import nixpkgs {};
  meta = {
    description = "GNU Smalltalk is a free implementation of the Smalltalk-80 language.";
    homepage = http://smalltalk.gnu.org/;
    maintainers = [ "Holger Hans Peter Freyther <holger@freyther.de>" ];
  };
  libsigsegv_patched = pkgs: pkgs.lib.overrideDerivation pkgs.libsigsegv (args: { NIX_CFLAGS_COMPILE = "-fPIC"; });
  buildInputs = pkgs: with pkgs; [ zip unzip libffi (libsigsegv_patched pkgs) libtool sqlite readline ncurses expat gdbm freeglut];
in
  import ../gnu-jobs.nix {
    name = "smalltalk";
    src  = smalltalk;
    inherit nixpkgs meta;

    customEnv = {
      tarball = pkgs: {
        autoconfPhase = ''
          # /usr/bin/env references in some build-aux scripts
          patchShebangs build-aux

          # configure fails that it cannot find libffi otherwise
          sed -i 's|GST_HAVE_LIB(libffi|GST_HAVE_LIB(ffi|' configure.ac

          autoreconf -vi
        '';
        buildInputs = with pkgs; [
          bison
          flex
          gettext_0_18
          git
          gperf
          help2man
          perl
          texinfo
          wget
        ] ++ (buildInputs pkgs);
        dontBuild = false;
      };

      build = pkgs: {
        buildInputs = buildInputs pkgs;
        inherit meta;
      };

      coverage = pkgs: {
        buildInputs = buildInputs pkgs;
        inherit meta;
      };
    };
  }