1{ stdenv, fetchgit, which, perl, jdk
2, ocamlPackages, openssl
3, coreutils, zlib, ncurses, makeWrapper
4, gcc, binutils, gnumake, nodejs} :
5
6stdenv.mkDerivation rec {
7 pname = "opa";
8 version = "4309";
9 name = "${pname}-${version}";
10
11 src = fetchgit {
12 url = https://github.com/MLstate/opalang.git;
13 rev = "047f58bfd4be35ee30176156b3718c707a6c0f76";
14 sha256 = "1jbxfrmpbjjk7qvaxdn47044w5m8wr96q9yx65ib3wlapmjbvdvf";
15 };
16
17 # Paths so the opa compiler code generation will use the same programs as were
18 # used to build opa.
19 codeGeneratorPaths = "${ocamlPackages.ocaml}/bin:${gcc}/bin:${binutils}/bin:${gnumake}/bin:${nodejs}/bin";
20
21 preConfigure = ''
22 patchShebangs .
23 (
24 cat ./compiler/buildinfos/buildInfos.ml.pre
25 ./compiler/buildinfos/generate_buildinfos.sh . --release --version ./compiler/buildinfos/version_major.txt
26 echo let opa_git_version = ${version}
27 echo 'let opa_git_sha = "xxxx"'
28 cat ./compiler/buildinfos/buildInfos.ml.post
29 )> ./compiler/buildinfos/buildInfos.ml
30 '';
31
32 prefixKey = "-prefix ";
33
34 configureFlags = "-ocamlfind ${ocamlPackages.findlib}/bin/ocamlfind ";
35
36 buildInputs = [ which perl jdk openssl coreutils zlib ncurses
37 makeWrapper gcc binutils gnumake nodejs
38 ] ++ (with ocamlPackages; [
39 ocaml findlib ocaml_ssl cryptokit camlzip ulex ocamlgraph
40 ]);
41
42 NIX_LDFLAGS = "-lgcc_s";
43
44 postInstall = ''
45 # Have compiler use same tools for code generation as used to build it.
46 for p in $out/bin/opa ; do
47 wrapProgram $p --prefix PATH ":" "${codeGeneratorPaths}" ;
48 done
49
50 # Install emacs mode.
51 mkdir -p $out/share/emacs/site-lisp/opa
52 install -m 0644 -v ./tools/editors/emacs/{opa-mode.el,site-start.el} $out/share/emacs/site-lisp/opa
53 '';
54
55 meta = {
56 description = "A concise and elegant language for writing distributed web applications";
57 longDescription = ''
58 Opa is a new generation of web development platform that lets you write distributed
59 web applications using a single technology. Among the the many features of Opa are these:
60 Opa is concise, simple, concurrent, dynamically distributed, and secure.
61 '';
62 homepage = http://opalang.org/;
63 license = stdenv.lib.licenses.gpl3;
64 maintainers = [ stdenv.lib.maintainers.kkallio ];
65 platforms = with stdenv.lib.platforms; linux;
66 };
67}