2016-10-23 14:04:56 +00:00
|
|
|
{ stdenv, fetchFromGitHub, which, perl, jdk
|
2014-11-18 00:25:15 +00:00
|
|
|
, ocamlPackages, openssl
|
|
|
|
, coreutils, zlib, ncurses, makeWrapper
|
2016-10-23 14:04:56 +00:00
|
|
|
, gcc, binutils, gnumake, nodejs
|
|
|
|
}:
|
2011-11-27 23:58:46 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "opa";
|
2016-10-23 14:04:56 +00:00
|
|
|
version = "4310";
|
2011-11-27 23:58:46 +00:00
|
|
|
|
2016-10-23 14:04:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MLstate";
|
|
|
|
repo = "opalang";
|
|
|
|
rev = "a13d45af30bc955c40c4b320353fb21e4ecacbc5";
|
|
|
|
sha256 = "1qs91rq9xrafv2mf2v415k8lv91ab3ycz0xkpjh1mng5ca3pjlf3";
|
2011-11-27 23:58:46 +00:00
|
|
|
};
|
|
|
|
|
2020-10-22 06:14:16 +00:00
|
|
|
patches = [ ./ocaml-4.03.patch ];
|
|
|
|
|
2011-11-27 23:58:46 +00:00
|
|
|
# Paths so the opa compiler code generation will use the same programs as were
|
|
|
|
# used to build opa.
|
2016-08-23 00:29:23 +00:00
|
|
|
codeGeneratorPaths = stdenv.lib.makeBinPath [ ocamlPackages.ocaml gcc binutils gnumake nodejs ];
|
2011-11-27 23:58:46 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
2015-01-08 09:26:49 +00:00
|
|
|
patchShebangs .
|
2014-08-12 12:22:19 +00:00
|
|
|
(
|
|
|
|
cat ./compiler/buildinfos/buildInfos.ml.pre
|
2020-10-22 06:14:16 +00:00
|
|
|
./compiler/buildinfos/generate_buildinfos.sh . --release --version ./compiler/buildinfos/version_major.txt
|
2014-08-12 12:22:19 +00:00
|
|
|
echo let opa_git_version = ${version}
|
|
|
|
echo 'let opa_git_sha = "xxxx"'
|
|
|
|
cat ./compiler/buildinfos/buildInfos.ml.post
|
|
|
|
)> ./compiler/buildinfos/buildInfos.ml
|
2016-10-23 14:04:56 +00:00
|
|
|
for p in configure tools/platform_helper.sh
|
|
|
|
do
|
|
|
|
substituteInPlace $p --replace 'IS_MAC=1' 'IS_LINUX=1'
|
|
|
|
done
|
|
|
|
export CAMLP4O=${ocamlPackages.camlp4}/bin/camlp4o
|
|
|
|
export CAMLP4ORF=${ocamlPackages.camlp4}/bin/camlp4orf
|
2020-10-22 06:14:16 +00:00
|
|
|
export OCAMLBUILD=${ocamlPackages.ocamlbuild}/bin/ocamlbuild
|
|
|
|
substituteInPlace _tags --replace ', warn_error_A' ""
|
2011-11-27 23:58:46 +00:00
|
|
|
'';
|
|
|
|
|
2014-11-18 00:25:15 +00:00
|
|
|
prefixKey = "-prefix ";
|
|
|
|
|
2018-07-25 21:44:21 +00:00
|
|
|
configureFlags = [ "-ocamlfind ${ocamlPackages.findlib}/bin/ocamlfind" ];
|
2011-11-27 23:58:46 +00:00
|
|
|
|
2014-11-18 00:25:15 +00:00
|
|
|
buildInputs = [ which perl jdk openssl coreutils zlib ncurses
|
|
|
|
makeWrapper gcc binutils gnumake nodejs
|
|
|
|
] ++ (with ocamlPackages; [
|
2017-10-05 17:09:50 +00:00
|
|
|
ocaml findlib ssl cryptokit camlzip ulex ocamlgraph camlp4
|
2014-11-18 00:25:15 +00:00
|
|
|
]);
|
2011-11-27 23:58:46 +00:00
|
|
|
|
2016-10-23 14:04:56 +00:00
|
|
|
NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
|
2011-11-27 23:58:46 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Have compiler use same tools for code generation as used to build it.
|
|
|
|
for p in $out/bin/opa ; do
|
|
|
|
wrapProgram $p --prefix PATH ":" "${codeGeneratorPaths}" ;
|
|
|
|
done
|
|
|
|
|
|
|
|
# Install emacs mode.
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/share/emacs/site-lisp/opa
|
2014-11-18 00:25:15 +00:00
|
|
|
install -m 0644 -v ./tools/editors/emacs/{opa-mode.el,site-start.el} $out/share/emacs/site-lisp/opa
|
2011-11-27 23:58:46 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2013-01-17 21:34:08 +00:00
|
|
|
description = "A concise and elegant language for writing distributed web applications";
|
2011-11-27 23:58:46 +00:00
|
|
|
longDescription = ''
|
2013-01-17 21:34:08 +00:00
|
|
|
Opa is a new generation of web development platform that lets you write distributed
|
|
|
|
web applications using a single technology. Among the the many features of Opa are these:
|
|
|
|
Opa is concise, simple, concurrent, dynamically distributed, and secure.
|
2011-11-27 23:58:46 +00:00
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://opalang.org/";
|
2011-11-27 23:58:46 +00:00
|
|
|
license = stdenv.lib.licenses.gpl3;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.kkallio ];
|
2016-10-23 14:04:56 +00:00
|
|
|
platforms = with stdenv.lib.platforms; unix;
|
2011-11-27 23:58:46 +00:00
|
|
|
};
|
|
|
|
}
|