Updates (and fixes) opa

This commit is contained in:
Vincent Laporte 2014-11-18 00:25:15 +00:00
parent 2d252e78c1
commit 1354bc0eba
4 changed files with 25 additions and 143 deletions

View File

@ -1,32 +1,25 @@
{ stdenv, fetchurl, which, ocaml, perl, jdk
, findlib, ocaml_ssl, openssl, cryptokit, camlzip, ulex
, ocamlgraph, coreutils, zlib, ncurses, makeWrapper
, gcc, binutils, gnumake, nodejs, git } :
{ stdenv, fetchgit, which, perl, jdk
, ocamlPackages, openssl
, coreutils, zlib, ncurses, makeWrapper
, gcc, binutils, gnumake, nodejs} :
stdenv.mkDerivation rec {
pname = "opa";
version = "4308";
version = "4309";
name = "${pname}-${version}";
src = fetchurl {
url = "https://github.com/MLstate/opalang/tarball/v${version}";
name = "opa-${version}.tar.gz";
sha256 = "1farii9474i14ack6bpqm1jihs6i8pvwky3a7q8v8pbnl4i6lb5g";
src = fetchgit {
url = https://github.com/MLstate/opalang.git;
rev = "047f58bfd4be35ee30176156b3718c707a6c0f76";
sha256 = "1jbxfrmpbjjk7qvaxdn47044w5m8wr96q9yx65ib3wlapmjbvdvf";
};
# Paths so the opa compiler code generation will use the same programs as were
# used to build opa.
codeGeneratorPaths = "${ocaml}/bin:${gcc}/bin:${binutils}/bin:${gnumake}/bin";
prePatch = ''
find . -type f -exec sed -i 's@/usr/bin/env@${coreutils}/bin/env@' {} \;
find . -type f -exec sed -i 's@/usr/bin/perl@${perl}/bin/perl@' {} \;
'';
patches = [];
codeGeneratorPaths = "${ocamlPackages.ocaml}/bin:${gcc}/bin:${binutils}/bin:${gnumake}/bin:${nodejs}/bin";
preConfigure = ''
configureFlags="$configureFlags -prefix $out"
patchShebangs .
(
cat ./compiler/buildinfos/buildInfos.ml.pre
./compiler/buildinfos/generate_buildinfos.sh . --release --version ./compiler/buildinfos/version_major.txt
@ -36,14 +29,17 @@ stdenv.mkDerivation rec {
)> ./compiler/buildinfos/buildInfos.ml
'';
dontAddPrefix = true;
prefixKey = "-prefix ";
configureFlags = "-ocamlfind ${findlib}/bin/ocamlfind ";
configureFlags = "-ocamlfind ${ocamlPackages.findlib}/bin/ocamlfind ";
buildInputs = [ which ocaml perl jdk findlib ocaml_ssl openssl cryptokit camlzip ulex
ocamlgraph coreutils zlib ncurses makeWrapper gcc binutils gnumake
nodejs git
];
buildInputs = [ which perl jdk openssl coreutils zlib ncurses
makeWrapper gcc binutils gnumake nodejs
] ++ (with ocamlPackages; [
ocaml findlib ocaml_ssl cryptokit camlzip ulex ocamlgraph
]);
NIX_LDFLAGS = "-lgcc_s";
postInstall = ''
# Have compiler use same tools for code generation as used to build it.
@ -53,7 +49,7 @@ stdenv.mkDerivation rec {
# Install emacs mode.
mkdir -p $out/share/emacs/site-lisp/opa
install -m 0644 -v ./utils/emacs/{opa-mode.el,site-start.el} $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 = {
@ -66,15 +62,6 @@ stdenv.mkDerivation rec {
homepage = http://opalang.org/;
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.kkallio ];
platforms = [ "x86_64-linux" ];
# File "compiler/libqmlcompil/dbGen/schema_io.ml", line 199, characters 3-53:
# Error: Signature mismatch:
# ...
# The field `remove_edge_e' is required but not provided
# The field `remove_edge' is required but not provided
# The field `remove_vertex' is required but not provided
# Command exited with code 2.
# make: *** [node] Error 10
broken = true;
platforms = with stdenv.lib.platforms; linux;
};
}

View File

@ -1,93 +0,0 @@
These patches have the compiler place path flags in various places so that
ocaml and c libraries are found in their Nixpkgs locations.
diff -x '*~' -Naur MLstate-opalang-6b295a9//build_rules.ml MLstate-opalang-6b295a9-new//build_rules.ml
--- MLstate-opalang-6b295a9//build_rules.ml 2011-11-21 08:07:04.000000000 -0430
+++ MLstate-opalang-6b295a9-new//build_rules.ml 2011-11-27 00:34:35.845277134 -0430
@@ -373,7 +373,11 @@
| Some dep -> dep::list
) (tags_of_pathname (env "%.opa_plugin")) []
in
- let lib_dir s = [A"--ml";A"-I";A"--ml";P (if Pathname.exists s then ".." / s else ("+"^s))] in
+ let cryptokitdir_opt = function
+ | Some path -> path
+ | None -> ""
+ in
+ let lib_dir s = [A"--ml";A"-I";A"--ml";P (if Pathname.exists s then ".." / s else (if s = "cryptokit" then (cryptokitdir_opt Config.Libdir.cryptokit) else ("+"^s)))] in
let include_dirs = List.flatten (List.map lib_dir caml_use_lib) in
let files = List.map ((^) path) files in
build_list build files;
diff -x '*~' -Naur MLstate-opalang-6b295a9//config.mli MLstate-opalang-6b295a9-new//config.mli
--- MLstate-opalang-6b295a9//config.mli 2011-11-21 08:07:04.000000000 -0430
+++ MLstate-opalang-6b295a9-new//config.mli 2011-11-27 00:30:39.312443906 -0430
@@ -43,6 +43,9 @@
(** Flag for Dbm present *)
val has_dbm : bool
+(** openssh link directory *)
+val openssl : string option
+
(** library directories, if the libs are enabled *)
val libnatpmp : (string*string*string) option (** name of the lib, lib dir, include dir *)
diff -x '*~' -Naur MLstate-opalang-6b295a9//configure MLstate-opalang-6b295a9-new//configure
--- MLstate-opalang-6b295a9//configure 2011-11-21 08:07:04.000000000 -0430
+++ MLstate-opalang-6b295a9-new//configure 2011-11-27 00:40:52.496151405 -0430
@@ -27,6 +27,7 @@
NO_CAMLIDL=1
NO_DBM=1
+CONFIG_LIB_OPENSSL=""
while [ $# -gt 0 ]; do
case "$1" in
@@ -51,6 +52,11 @@
shift
OCAMLOPT=$1
;;
+ -openssl)
+ if [ $# -lt 2 ]; then echo "Error: option $1 requires an argument" >&2; exit 1; fi
+ shift
+ CONFIG_LIB_OPENSSL=$1
+ ;;
-ocamlfind)
if [ $# -lt 2 ]; then echo "Error: option $1 requires an argument" >&2; exit 1; fi
shift
@@ -647,6 +653,8 @@
let miniupnpc = $(camlopt "$HAS_MINIUPNPC" "$(camlstrtuple "${MINIUPNPC[@]}")")
let has_dbm = $(camlbool "$HAS_DBM")
+let openssl = $(camlopt "$CONFIG_LIB_OPENSSL" '"'"$CONFIG_LIB_OPENSSL"'"')
+
let available = [ $TAGS_LIST]
let all_tags = [ $(for t in $ALL_TAGS_LIST; do echo -n "\"$t\"; "; done)]
diff -x '*~' -Naur MLstate-opalang-6b295a9//qml2ocaml/qml2ocamlOptions.ml MLstate-opalang-6b295a9-new//qml2ocaml/qml2ocamlOptions.ml
--- MLstate-opalang-6b295a9//qml2ocaml/qml2ocamlOptions.ml 2011-11-21 08:07:04.000000000 -0430
+++ MLstate-opalang-6b295a9-new//qml2ocaml/qml2ocamlOptions.ml 2011-11-27 00:32:57.721442828 -0430
@@ -44,6 +44,7 @@
let options_linker =
["-w a"]
+ @ (match Config.openssl with | Some dir -> ["-ccopt"; "-L"^dir] | None -> [])
@ (if Base.is_windows then
["-cclib"; "Dnsapi.lib"; "-cclib"; "libeay32.lib"; "-cclib"; "ssleay32.lib" (*; "ssl_stubs.obj" *)]
else [])
@@ -51,11 +52,13 @@
(**
Absolute path for include directory, will be passed with the option -I to the ocaml compiler.
*)
+ let uselibdirpath = fun po p -> match po with | Some path -> path | None -> p
+
let server_include_dir = [
- "+zip" ; "+site-lib/zip" ; "+site-lib/camlzip" ;
- "+ssl" ; "+site-lib/ssl" ;
- "+cryptokit"; "+site-lib/cryptokit" ;
- "+ulex" ; "+site-lib/ulex" ;
+ uselibdirpath Config.Libdir.camlzip "+zip" ; "+site-lib/zip" ; "+site-lib/camlzip" ;
+ uselibdirpath Config.Libdir.ssl "+ssl" ; "+site-lib/ssl" ;
+ uselibdirpath Config.Libdir.cryptokit "+cryptokit"; "+site-lib/cryptokit" ;
+ uselibdirpath Config.Libdir.ulex "+ulex" ; "+site-lib/ulex" ;
] @ (
if Config.has_dbm then [
"+dbm" ; "+site-lib/dbm" ;

View File

@ -1,14 +0,0 @@
Needed to have ocamlfind discover ocamlgraph with Nixpkgs.
diff -x '*~' -Naur MLstate-opalang-ee92891/configure MLstate-opalang-ee92891-new//configure
--- MLstate-opalang-ee92891/configure 2011-09-30 05:41:18.000000000 -0430
+++ MLstate-opalang-ee92891-new//configure 2011-11-24 13:47:01.332558705 -0430
@@ -567,7 +567,7 @@
fi
# - checking ocamlgraph
-if ! CONFIG_LIB_OCAMLGRAPH=$(locate-ocaml-lib "Graph" "ocamlgraph/graph")
+if ! CONFIG_LIB_OCAMLGRAPH=$(locate-ocaml-lib "Graph" "ocamlgraph" "graph")
then lib-not-found "ocamlgraph" "libocamlgraph-ocaml-dev"
fi

View File

@ -3761,7 +3761,9 @@ let
ocaml_make = callPackage ../development/ocaml-modules/ocamlmake { };
opa = let callPackage = newScope pkgs.ocamlPackages_4_00_1; in callPackage ../development/compilers/opa { };
opa = callPackage ../development/compilers/opa {
ocamlPackages = ocamlPackages_4_00_1;
};
opam_1_0_0 = callPackage ../development/tools/ocaml/opam/1.0.0.nix { };
opam_1_1 = callPackage ../development/tools/ocaml/opam/1.1.nix {