Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / compilers / eli / default.nix
blob8920e34b6ee1dc931ab51ccb3d205eba76ab4b96
1 { lib, stdenv
2 , fetchurl
3 , symlinkJoin
4 , makeWrapper
5 , tcl
6 , fontconfig
7 , tk
8 , ncurses
9 , xorg
10 , file
13 let
14   # eli derives the location of the include folder from the location of the lib folder
15   tk_combined = symlinkJoin {
16     name = "tk_combined";
17     paths = [
18       tk
19       tk.dev
20     ];
21   };
22   curses_combined = symlinkJoin {
23     name = "curses_combined";
24     paths = [
25       ncurses
26       ncurses.dev
27     ];
28   };
30 stdenv.mkDerivation rec {
31   pname = "eli";
32   version = "4.8.1";
34   src = fetchurl {
35     url = "mirror://sourceforge/project/eli-project/Eli/Eli%20${version}/${pname}-${version}.tar.bz2";
36     sha256="1vran8583hbwrr5dciji4zkhz3f88w4mn8n9sdpr6zw0plpf1whj";
37   };
39   buildInputs = [
40     ncurses
41     fontconfig
42   ] ++ (with xorg; [
43     libX11.dev
44     libXt.dev
45     libXaw.dev
46     libXext.dev
47   ]);
49   nativeBuildInputs = [
50     file
51     makeWrapper
52   ];
54   # skip interactive browser check
55   buildFlags = [ "nobrowsers" ];
58   preConfigure=''
59     configureFlagsArray=(
60       --with-tcltk="${tcl} ${tk_combined}"
61       --with-curses="${curses_combined}"
62     )
63     export ODIN_LOCALIPC=1
64   '';
66   postInstall = ''
67     wrapProgram "$out/bin/eli" \
68       --set ODIN_LOCALIPC 1
69   '';
71   # Test if eli starts
72   doInstallCheck = true;
73   installCheckPhase = ''
74     export HOME="$TMP/home"
75     mkdir -p "$HOME"
76     $out/bin/eli "!ls"
77   '';
79   meta = {
80     description = "Translator Construction Made Easy";
81     longDescription = ''
82       Eli is a programming environment that supports all phases of translator
83       construction with extensive libraries implementing common tasks, yet handling
84       arbitrary special cases. Output is the C subset of C++.
85     '';
86     homepage = "http://eli-project.sourceforge.net/";
87     license = lib.licenses.gpl2;
88     maintainers = with lib.maintainers; [ timokau ];
89     platforms = lib.platforms.linux;
90   };