2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, which, perl, jdk
|
2020-04-24 23:36:52 +00:00
|
|
|
, ocamlPackages, openssl
|
|
|
|
, coreutils, zlib, ncurses, makeWrapper
|
|
|
|
, gcc, binutils, gnumake, nodejs
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "opa";
|
|
|
|
version = "4310";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MLstate";
|
|
|
|
repo = "opalang";
|
|
|
|
rev = "a13d45af30bc955c40c4b320353fb21e4ecacbc5";
|
|
|
|
sha256 = "1qs91rq9xrafv2mf2v415k8lv91ab3ycz0xkpjh1mng5ca3pjlf3";
|
|
|
|
};
|
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
patches = [ ./ocaml-4.03.patch ./ocaml-4.04.patch ];
|
2020-11-03 02:18:15 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Paths so the opa compiler code generation will use the same programs as were
|
|
|
|
# used to build opa.
|
2021-02-05 17:12:51 +00:00
|
|
|
codeGeneratorPaths = lib.makeBinPath [ ocamlPackages.ocaml gcc binutils gnumake nodejs ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs .
|
|
|
|
(
|
|
|
|
cat ./compiler/buildinfos/buildInfos.ml.pre
|
2020-11-03 02:18:15 +00:00
|
|
|
./compiler/buildinfos/generate_buildinfos.sh . --release --version ./compiler/buildinfos/version_major.txt
|
2020-04-24 23:36:52 +00:00
|
|
|
echo let opa_git_version = ${version}
|
|
|
|
echo 'let opa_git_sha = "xxxx"'
|
|
|
|
cat ./compiler/buildinfos/buildInfos.ml.post
|
|
|
|
)> ./compiler/buildinfos/buildInfos.ml
|
|
|
|
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-11-03 02:18:15 +00:00
|
|
|
export OCAMLBUILD=${ocamlPackages.ocamlbuild}/bin/ocamlbuild
|
|
|
|
substituteInPlace _tags --replace ', warn_error_A' ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
prefixKey = "-prefix ";
|
|
|
|
|
|
|
|
configureFlags = [ "-ocamlfind ${ocamlPackages.findlib}/bin/ocamlfind" ];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [ gcc binutils nodejs which makeWrapper ];
|
|
|
|
buildInputs = [ perl jdk openssl coreutils zlib ncurses
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ (with ocamlPackages; [
|
2022-05-18 14:49:53 +00:00
|
|
|
ocaml findlib ssl camlzip ulex ocamlgraph camlp4
|
2020-04-24 23:36:52 +00:00
|
|
|
]);
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
NIX_LDFLAGS = lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
|
2020-04-24 23:36:52 +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.
|
|
|
|
mkdir -p $out/share/emacs/site-lisp/opa
|
|
|
|
install -m 0644 -v ./tools/editors/emacs/{opa-mode.el,site-start.el} $out/share/emacs/site-lisp/opa
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A concise and elegant language for writing distributed web applications";
|
|
|
|
longDescription = ''
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
homepage = "http://opalang.org/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.gpl3;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = [ ];
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = with lib.platforms; unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|