fix deps
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<PISI>
|
||||
<Name>programming.language.ocaml</Name>
|
||||
</PISI>
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Licensed under the GNU General Public License, version 3.
|
||||
# See the file http://www.gnu.org/licenses/gpl.txt
|
||||
|
||||
from pisi.actionsapi import autotools
|
||||
from pisi.actionsapi import pisitools
|
||||
from pisi.actionsapi import shelltools
|
||||
from pisi.actionsapi import get
|
||||
|
||||
def setup():
|
||||
#shelltools.export("CFLAGS", get.CFLAGS().replace("-fomit-frame-pointer", ""))
|
||||
#shelltools.export("LDFLAGS", get.LDFLAGS())
|
||||
|
||||
autotools.rawConfigure("-prefix /usr \
|
||||
-bindir /usr/bin \
|
||||
-x11include /usr/include \
|
||||
-libdir /usr/lib/ocaml \
|
||||
-mandir /usr/share/man \
|
||||
--with-pthread")
|
||||
|
||||
def build():
|
||||
autotools.make("-j1 world")
|
||||
autotools.make("-j1 opt")
|
||||
autotools.make("-j1 opt.opt")
|
||||
autotools.make("-C emacs ocamltags")
|
||||
|
||||
def install():
|
||||
autotools.rawInstall("BINDIR=%(install)s/usr/bin \
|
||||
LIBDIR=%(install)s/usr/lib/ocaml \
|
||||
MANDIR=%(install)s/usr/share/man" \
|
||||
% { "install": get.installDIR()})
|
||||
|
||||
pisitools.dodoc("Changes", "LICENSE", "README")
|
||||
|
||||
|
||||
''' autotools.rawInstall("-C emacs \
|
||||
BINDIR=%(install)s/usr/bin \
|
||||
EMACSDIR=%(install)s/usr/share/emacs/site-lisp"
|
||||
% { "install": get.installDIR()})
|
||||
'''
|
||||
# Remove rpaths from stublibs .so files
|
||||
shelltools.system("chrpath --delete %s/usr/lib/ocaml/stublibs/*.so"
|
||||
% get.installDIR())
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
From ccc1bf226619608230dc94b26377756719cf7b20 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 24 Jun 2014 22:29:38 +0100
|
||||
Subject: [PATCH 01/12] Don't ignore ./configure, it's a real git file.
|
||||
|
||||
---
|
||||
.gitignore | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index d36195a..dbb0e3e 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -19,7 +19,6 @@
|
||||
/.depend
|
||||
/.depend.nt
|
||||
/.DS_Store
|
||||
-/configure
|
||||
/ocamlc
|
||||
/ocamlc.opt
|
||||
/expunge
|
||||
--
|
||||
2.0.4
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
From 0e3b6450f6ab803442a809b6da41d5d5c5da650f Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 7 Jun 2012 15:36:16 +0100
|
||||
Subject: [PATCH 02/12] Ensure empty compilerlibs/ directory is created by git.
|
||||
|
||||
This directory exists in the OCaml tarball, but is empty. As a
|
||||
result, git ignores it unless we put a dummy file in it.
|
||||
---
|
||||
compilerlibs/.exists | 0
|
||||
1 file changed, 0 insertions(+), 0 deletions(-)
|
||||
create mode 100644 compilerlibs/.exists
|
||||
|
||||
diff --git a/compilerlibs/.exists b/compilerlibs/.exists
|
||||
new file mode 100644
|
||||
index 0000000..e69de29
|
||||
--
|
||||
2.0.4
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
From 79f0f91e3e4abbfbd3564c11ea72e53310236afc Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 24 Jun 2014 10:00:15 +0100
|
||||
Subject: [PATCH 03/12] Don't add rpaths to libraries.
|
||||
|
||||
---
|
||||
tools/Makefile.shared | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tools/Makefile.shared b/tools/Makefile.shared
|
||||
index 2517434..75a75b4 100644
|
||||
--- a/tools/Makefile.shared
|
||||
+++ b/tools/Makefile.shared
|
||||
@@ -112,9 +112,9 @@ ocamlmklibconfig.ml: ../config/Makefile
|
||||
echo 'let ext_dll = "$(EXT_DLL)"'; \
|
||||
echo 'let supports_shared_libraries = $(SUPPORTS_SHARED_LIBRARIES)';\
|
||||
echo 'let mkdll = "$(MKDLL)"'; \
|
||||
- echo 'let byteccrpath = "$(BYTECCRPATH)"'; \
|
||||
- echo 'let nativeccrpath = "$(NATIVECCRPATH)"'; \
|
||||
- echo 'let mksharedlibrpath = "$(MKSHAREDLIBRPATH)"'; \
|
||||
+ echo 'let byteccrpath = ""'; \
|
||||
+ echo 'let nativeccrpath = ""'; \
|
||||
+ echo 'let mksharedlibrpath = ""'; \
|
||||
echo 'let toolpref = "$(TOOLPREF)"'; \
|
||||
sed -n -e 's/^#ml //p' ../config/Makefile) \
|
||||
> ocamlmklibconfig.ml
|
||||
--
|
||||
2.0.4
|
||||
|
||||
+240
@@ -0,0 +1,240 @@
|
||||
From 11b377aee2811891635982a5590fef62f12645b6 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 29 May 2012 20:40:36 +0100
|
||||
Subject: [PATCH 04/12] ocamlbyteinfo, ocamlplugininfo: Useful utilities from
|
||||
Debian, sent upstream.
|
||||
|
||||
See:
|
||||
http://git.debian.org/?p=pkg-ocaml-maint/packages/ocaml.git;a=tree;f=debian/ocamlbyteinfo;hb=HEAD
|
||||
---
|
||||
ocamlbyteinfo.ml | 101 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
ocamlplugininfo.ml | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 210 insertions(+)
|
||||
create mode 100644 ocamlbyteinfo.ml
|
||||
create mode 100644 ocamlplugininfo.ml
|
||||
|
||||
diff --git a/ocamlbyteinfo.ml b/ocamlbyteinfo.ml
|
||||
new file mode 100644
|
||||
index 0000000..eb9a293
|
||||
--- /dev/null
|
||||
+++ b/ocamlbyteinfo.ml
|
||||
@@ -0,0 +1,101 @@
|
||||
+(***********************************************************************)
|
||||
+(* *)
|
||||
+(* Objective Caml *)
|
||||
+(* *)
|
||||
+(* Xavier Leroy, projet Gallium, INRIA Rocquencourt *)
|
||||
+(* *)
|
||||
+(* Copyright 2009 Institut National de Recherche en Informatique et *)
|
||||
+(* en Automatique. All rights reserved. This file is distributed *)
|
||||
+(* under the terms of the GNU Library General Public License, with *)
|
||||
+(* the special exception on linking described in file ../../LICENSE. *)
|
||||
+(* *)
|
||||
+(***********************************************************************)
|
||||
+
|
||||
+(* $Id$ *)
|
||||
+
|
||||
+(* Dumps a bytecode binary file *)
|
||||
+
|
||||
+open Sys
|
||||
+open Dynlinkaux
|
||||
+
|
||||
+let input_stringlist ic len =
|
||||
+ let get_string_list sect len =
|
||||
+ let rec fold s e acc =
|
||||
+ if e != len then
|
||||
+ if sect.[e] = '\000' then
|
||||
+ fold (e+1) (e+1) (String.sub sect s (e-s) :: acc)
|
||||
+ else fold s (e+1) acc
|
||||
+ else acc
|
||||
+ in fold 0 0 []
|
||||
+ in
|
||||
+ let sect = String.create len in
|
||||
+ let _ = really_input ic sect 0 len in
|
||||
+ get_string_list sect len
|
||||
+
|
||||
+let print = Printf.printf
|
||||
+let perr s =
|
||||
+ Printf.eprintf "%s\n" s;
|
||||
+ exit(1)
|
||||
+let p_title title = print "%s:\n" title
|
||||
+
|
||||
+let p_section title format pdata = function
|
||||
+ | [] -> ()
|
||||
+ | l ->
|
||||
+ p_title title;
|
||||
+ List.iter
|
||||
+ (fun (name, data) -> print format (pdata data) name)
|
||||
+ l
|
||||
+
|
||||
+let p_list title format = function
|
||||
+ | [] -> ()
|
||||
+ | l ->
|
||||
+ p_title title;
|
||||
+ List.iter
|
||||
+ (fun name -> print format name)
|
||||
+ l
|
||||
+
|
||||
+let _ =
|
||||
+ try
|
||||
+ let input_name = Sys.argv.(1) in
|
||||
+ let ic = open_in_bin input_name in
|
||||
+ Bytesections.read_toc ic;
|
||||
+ List.iter
|
||||
+ (fun section ->
|
||||
+ try
|
||||
+ let len = Bytesections.seek_section ic section in
|
||||
+ if len > 0 then match section with
|
||||
+ | "CRCS" ->
|
||||
+ p_section
|
||||
+ "Imported Units"
|
||||
+ "\t%s\t%s\n"
|
||||
+ Digest.to_hex
|
||||
+ (input_value ic : (string * Digest.t) list)
|
||||
+ | "DLLS" ->
|
||||
+ p_list
|
||||
+ "Used Dlls" "\t%s\n"
|
||||
+ (input_stringlist ic len)
|
||||
+ | "DLPT" ->
|
||||
+ p_list
|
||||
+ "Additional Dll paths"
|
||||
+ "\t%s\n"
|
||||
+ (input_stringlist ic len)
|
||||
+ | "PRIM" ->
|
||||
+ let prims = (input_stringlist ic len) in
|
||||
+ print "Uses unsafe features: ";
|
||||
+ begin match prims with
|
||||
+ [] -> print "no\n"
|
||||
+ | l -> print "YES\n";
|
||||
+ p_list "Primitives declared in this module"
|
||||
+ "\t%s\n"
|
||||
+ l
|
||||
+ end
|
||||
+ | _ -> ()
|
||||
+ with Not_found | Failure _ | Invalid_argument _ -> ()
|
||||
+ )
|
||||
+ ["CRCS"; "DLLS"; "DLPT"; "PRIM"];
|
||||
+ close_in ic
|
||||
+ with
|
||||
+ | Sys_error msg ->
|
||||
+ perr msg
|
||||
+ | Invalid_argument("index out of bounds") ->
|
||||
+ perr (Printf.sprintf "Usage: %s filename" Sys.argv.(0))
|
||||
diff --git a/ocamlplugininfo.ml b/ocamlplugininfo.ml
|
||||
new file mode 100644
|
||||
index 0000000..e28800f
|
||||
--- /dev/null
|
||||
+++ b/ocamlplugininfo.ml
|
||||
@@ -0,0 +1,109 @@
|
||||
+(***********************************************************************)
|
||||
+(* *)
|
||||
+(* Objective Caml *)
|
||||
+(* *)
|
||||
+(* Xavier Leroy, projet Gallium, INRIA Rocquencourt *)
|
||||
+(* *)
|
||||
+(* Copyright 2009 Institut National de Recherche en Informatique et *)
|
||||
+(* en Automatique. All rights reserved. This file is distributed *)
|
||||
+(* under the terms of the GNU Library General Public License, with *)
|
||||
+(* the special exception on linking described in file ../../LICENSE. *)
|
||||
+(* *)
|
||||
+(***********************************************************************)
|
||||
+
|
||||
+(* $Id$ *)
|
||||
+
|
||||
+(* Dumps a .cmxs file *)
|
||||
+
|
||||
+open Natdynlink
|
||||
+open Format
|
||||
+
|
||||
+let file =
|
||||
+ try
|
||||
+ Sys.argv.(1)
|
||||
+ with _ -> begin
|
||||
+ Printf.eprintf "Usage: %s file.cmxs\n" Sys.argv.(0);
|
||||
+ exit(1)
|
||||
+ end
|
||||
+
|
||||
+exception Abnormal_exit
|
||||
+
|
||||
+let error s e =
|
||||
+ let eprint = Printf.eprintf in
|
||||
+ let print_exc s = function
|
||||
+ | End_of_file ->
|
||||
+ eprint "%s: %s\n" s file
|
||||
+ | Abnormal_exit ->
|
||||
+ eprint "%s\n" s
|
||||
+ | e -> eprint "%s\n" (Printexc.to_string e)
|
||||
+ in
|
||||
+ print_exc s e;
|
||||
+ exit(1)
|
||||
+
|
||||
+let read_in command =
|
||||
+ let cmd = Printf.sprintf command file in
|
||||
+ let ic = Unix.open_process_in cmd in
|
||||
+ try
|
||||
+ let line = input_line ic in
|
||||
+ begin match (Unix.close_process_in ic) with
|
||||
+ | Unix.WEXITED 0 -> Str.split (Str.regexp "[ ]+") line
|
||||
+ | Unix.WEXITED _ | Unix.WSIGNALED _ | Unix.WSTOPPED _ ->
|
||||
+ error
|
||||
+ (Printf.sprintf
|
||||
+ "Command \"%s\" exited abnormally"
|
||||
+ cmd
|
||||
+ )
|
||||
+ Abnormal_exit
|
||||
+ end
|
||||
+ with e -> error "File is empty" e
|
||||
+
|
||||
+let get_offset adr_off adr_sec =
|
||||
+ try
|
||||
+ let adr = List.nth adr_off 4 in
|
||||
+ let off = List.nth adr_off 5 in
|
||||
+ let sec = List.hd adr_sec in
|
||||
+
|
||||
+ let (!) x = Int64.of_string ("0x" ^ x) in
|
||||
+ let (+) = Int64.add in
|
||||
+ let (-) = Int64.sub in
|
||||
+
|
||||
+ Int64.to_int (!off + !sec - !adr)
|
||||
+
|
||||
+ with Failure _ | Invalid_argument _ ->
|
||||
+ error
|
||||
+ "Command output doesn't have the expected format"
|
||||
+ Abnormal_exit
|
||||
+
|
||||
+let print_infos name crc defines cmi cmx =
|
||||
+ let print_name_crc (name, crc) =
|
||||
+ printf "@ %s (%s)" name (Digest.to_hex crc)
|
||||
+ in
|
||||
+ let pr_imports ppf imps = List.iter print_name_crc imps in
|
||||
+ printf "Name: %s@." name;
|
||||
+ printf "CRC of implementation: %s@." (Digest.to_hex crc);
|
||||
+ printf "@[<hov 2>Globals defined:";
|
||||
+ List.iter (fun s -> printf "@ %s" s) defines;
|
||||
+ printf "@]@.";
|
||||
+ printf "@[<v 2>Interfaces imported:%a@]@." pr_imports cmi;
|
||||
+ printf "@[<v 2>Implementations imported:%a@]@." pr_imports cmx
|
||||
+
|
||||
+let _ =
|
||||
+ let adr_off = read_in "objdump -h %s | grep ' .data '" in
|
||||
+ let adr_sec = read_in "objdump -T %s | grep ' caml_plugin_header$'" in
|
||||
+
|
||||
+ let ic = open_in file in
|
||||
+ let _ = seek_in ic (get_offset adr_off adr_sec) in
|
||||
+ let header = (input_value ic : Natdynlink.dynheader) in
|
||||
+ if header.magic <> Natdynlink.dyn_magic_number then
|
||||
+ raise(Error(Natdynlink.Not_a_bytecode_file file))
|
||||
+ else begin
|
||||
+ List.iter
|
||||
+ (fun ui ->
|
||||
+ print_infos
|
||||
+ ui.name
|
||||
+ ui.crc
|
||||
+ ui.defines
|
||||
+ ui.imports_cmi
|
||||
+ ui.imports_cmx)
|
||||
+ header.units
|
||||
+ end
|
||||
--
|
||||
2.0.4
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
From 5308c47681201ef3beef3e543ab877f81aa08784 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 29 May 2012 20:44:18 +0100
|
||||
Subject: [PATCH 05/12] configure: Allow user defined C compiler flags.
|
||||
|
||||
---
|
||||
configure | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index dbc6178..c1133ee 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -1633,6 +1633,10 @@ case "$buggycc" in
|
||||
nativecccompopts="$nativecccompopts -fomit-frame-pointer";;
|
||||
esac
|
||||
|
||||
+# Allow user defined C Compiler flags
|
||||
+bytecccompopts="$bytecccompopts $CFLAGS"
|
||||
+nativecccompopts="$nativecccompopts $CFLAGS"
|
||||
+
|
||||
# Finish generated files
|
||||
|
||||
cclibs="$cclibs $mathlib"
|
||||
--
|
||||
2.0.4
|
||||
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
From 0641f11626be99c8bde349520ac28a8d93106856 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 1 Apr 2014 11:17:07 +0100
|
||||
Subject: [PATCH 09/12] arg: Add no_arg and get_arg helper functions.
|
||||
|
||||
The no_arg function in this patch is a no-op. It will do something
|
||||
useful in the followups.
|
||||
|
||||
The get_arg function simply checks the next position on the command
|
||||
line exists and returns that argument or raises a Arg.Missing.
|
||||
|
||||
This patch should introduce no functional change, it is simply code
|
||||
refactoring.
|
||||
|
||||
In particular, this should not change the treatment of Arg.current
|
||||
(see: http://caml.inria.fr/mantis/view.php?id=5197#c11147)
|
||||
---
|
||||
stdlib/arg.ml | 47 ++++++++++++++++++++++++++---------------------
|
||||
1 file changed, 26 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/stdlib/arg.ml b/stdlib/arg.ml
|
||||
index 0f6480b..a41e0a2 100644
|
||||
--- a/stdlib/arg.ml
|
||||
+++ b/stdlib/arg.ml
|
||||
@@ -134,56 +134,62 @@ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =
|
||||
try assoc3 s !speclist
|
||||
with Not_found -> stop (Unknown s)
|
||||
in
|
||||
+ let no_arg () = () in
|
||||
+ let get_arg () =
|
||||
+ if !current + 1 < l then argv.(!current + 1)
|
||||
+ else stop (Missing s)
|
||||
+ in
|
||||
begin try
|
||||
let rec treat_action = function
|
||||
- | Unit f -> f ();
|
||||
- | Bool f when !current + 1 < l ->
|
||||
- let arg = argv.(!current + 1) in
|
||||
+ | Unit f -> no_arg (); f ();
|
||||
+ | Bool f ->
|
||||
+ let arg = get_arg () in
|
||||
begin try f (bool_of_string arg)
|
||||
with Invalid_argument "bool_of_string" ->
|
||||
raise (Stop (Wrong (s, arg, "a boolean")))
|
||||
end;
|
||||
incr current;
|
||||
- | Set r -> r := true;
|
||||
- | Clear r -> r := false;
|
||||
- | String f when !current + 1 < l ->
|
||||
- f argv.(!current + 1);
|
||||
+ | Set r -> no_arg (); r := true;
|
||||
+ | Clear r -> no_arg (); r := false;
|
||||
+ | String f ->
|
||||
+ let arg = get_arg () in
|
||||
+ f arg;
|
||||
incr current;
|
||||
- | Symbol (symb, f) when !current + 1 < l ->
|
||||
- let arg = argv.(!current + 1) in
|
||||
+ | Symbol (symb, f) ->
|
||||
+ let arg = get_arg () in
|
||||
if List.mem arg symb then begin
|
||||
- f argv.(!current + 1);
|
||||
+ f arg;
|
||||
incr current;
|
||||
end else begin
|
||||
raise (Stop (Wrong (s, arg, "one of: "
|
||||
^ (make_symlist "" " " "" symb))))
|
||||
end
|
||||
- | Set_string r when !current + 1 < l ->
|
||||
- r := argv.(!current + 1);
|
||||
+ | Set_string r ->
|
||||
+ r := get_arg ();
|
||||
incr current;
|
||||
- | Int f when !current + 1 < l ->
|
||||
- let arg = argv.(!current + 1) in
|
||||
+ | Int f ->
|
||||
+ let arg = get_arg () in
|
||||
begin try f (int_of_string arg)
|
||||
with Failure "int_of_string" ->
|
||||
raise (Stop (Wrong (s, arg, "an integer")))
|
||||
end;
|
||||
incr current;
|
||||
- | Set_int r when !current + 1 < l ->
|
||||
- let arg = argv.(!current + 1) in
|
||||
+ | Set_int r ->
|
||||
+ let arg = get_arg () in
|
||||
begin try r := (int_of_string arg)
|
||||
with Failure "int_of_string" ->
|
||||
raise (Stop (Wrong (s, arg, "an integer")))
|
||||
end;
|
||||
incr current;
|
||||
- | Float f when !current + 1 < l ->
|
||||
- let arg = argv.(!current + 1) in
|
||||
+ | Float f ->
|
||||
+ let arg = get_arg () in
|
||||
begin try f (float_of_string arg);
|
||||
with Failure "float_of_string" ->
|
||||
raise (Stop (Wrong (s, arg, "a float")))
|
||||
end;
|
||||
incr current;
|
||||
- | Set_float r when !current + 1 < l ->
|
||||
- let arg = argv.(!current + 1) in
|
||||
+ | Set_float r ->
|
||||
+ let arg = get_arg () in
|
||||
begin try r := (float_of_string arg);
|
||||
with Failure "float_of_string" ->
|
||||
raise (Stop (Wrong (s, arg, "a float")))
|
||||
@@ -196,7 +202,6 @@ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =
|
||||
f argv.(!current + 1);
|
||||
incr current;
|
||||
done;
|
||||
- | _ -> raise (Stop (Missing s))
|
||||
in
|
||||
treat_action action
|
||||
with Bad m -> stop (Message m);
|
||||
--
|
||||
2.0.4
|
||||
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
From 4d1defe6f017b86b0766fd02005a468bedd9aa88 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 1 Apr 2014 11:21:40 +0100
|
||||
Subject: [PATCH 10/12] arg: Allow flags such as --flag=arg as well as --flag
|
||||
arg.
|
||||
|
||||
Allow flags to be followed directly by their argument, separated by an '='
|
||||
sign. This is consistent with what GNU getopt_long and many other
|
||||
command line parsing libraries allow.
|
||||
|
||||
Fix for the following issue:
|
||||
http://caml.inria.fr/mantis/view.php?id=5197
|
||||
---
|
||||
stdlib/arg.ml | 30 ++++++++++++++++++++++++------
|
||||
stdlib/arg.mli | 3 ++-
|
||||
2 files changed, 26 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/stdlib/arg.ml b/stdlib/arg.ml
|
||||
index a41e0a2..5ffdabc 100644
|
||||
--- a/stdlib/arg.ml
|
||||
+++ b/stdlib/arg.ml
|
||||
@@ -55,6 +55,12 @@ let rec assoc3 x l =
|
||||
| _ :: t -> assoc3 x t
|
||||
;;
|
||||
|
||||
+let split s =
|
||||
+ let i = String.index s '=' in
|
||||
+ let len = String.length s in
|
||||
+ String.sub s 0 i, String.sub s (i+1) (len-(i+1))
|
||||
+;;
|
||||
+
|
||||
let make_symlist prefix sep suffix l =
|
||||
match l with
|
||||
| [] -> "<none>"
|
||||
@@ -130,14 +136,26 @@ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =
|
||||
while !current < l do
|
||||
let s = argv.(!current) in
|
||||
if String.length s >= 1 && s.[0] = '-' then begin
|
||||
- let action =
|
||||
- try assoc3 s !speclist
|
||||
- with Not_found -> stop (Unknown s)
|
||||
+ let action, follow =
|
||||
+ try assoc3 s !speclist, None
|
||||
+ with Not_found ->
|
||||
+ try
|
||||
+ let keyword, arg = split s in
|
||||
+ assoc3 keyword !speclist, Some arg
|
||||
+ with Not_found -> stop (Unknown s)
|
||||
in
|
||||
- let no_arg () = () in
|
||||
+ let no_arg () =
|
||||
+ match follow with
|
||||
+ | None -> ()
|
||||
+ | Some arg -> stop (Wrong (s, arg, "no argument")) in
|
||||
let get_arg () =
|
||||
- if !current + 1 < l then argv.(!current + 1)
|
||||
- else stop (Missing s)
|
||||
+ match follow with
|
||||
+ | None ->
|
||||
+ if !current + 1 < l then argv.(!current + 1)
|
||||
+ else stop (Missing s)
|
||||
+ | Some arg ->
|
||||
+ decr current;
|
||||
+ arg
|
||||
in
|
||||
begin try
|
||||
let rec treat_action = function
|
||||
diff --git a/stdlib/arg.mli b/stdlib/arg.mli
|
||||
index 22eda40..7078071 100644
|
||||
--- a/stdlib/arg.mli
|
||||
+++ b/stdlib/arg.mli
|
||||
@@ -25,7 +25,8 @@
|
||||
[Unit], [Set] and [Clear] keywords take no argument. A [Rest]
|
||||
keyword takes the remaining of the command line as arguments.
|
||||
Every other keyword takes the following word on the command line
|
||||
- as argument.
|
||||
+ as argument. For compatibility with GNU getopt_long, [keyword=arg]
|
||||
+ is also allowed.
|
||||
Arguments not preceded by a keyword are called anonymous arguments.
|
||||
|
||||
Examples ([cmd] is assumed to be the command name):
|
||||
--
|
||||
2.0.4
|
||||
|
||||
+1963
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>ocaml</Name>
|
||||
<Homepage>http://www.ocaml.org/</Homepage>
|
||||
<Packager>
|
||||
<Name>Serdar Soytetir</Name>
|
||||
<Email>kaptan@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>OPL</License>
|
||||
<IsA>app:console</IsA>
|
||||
<Summary>Fast modern type-inferring functional programming language</Summary>
|
||||
<Description>A fast modern type-inferring functional programming language descended from the ML (Meta Language) family.</Description>
|
||||
<!-- Caution! Updating this package to a new version, may break ocaml modules like facile. Modules need to be recompiled to resolve this. Also, errors like below are indications of this situation:
|
||||
|
||||
File "_none_", line 1, characters 0-1:
|
||||
Error: Files /usr/lib/ocaml/facile/facile.cmxa and /usr/lib/ocaml/stdlib.cmxa
|
||||
make inconsistent assumptions over implementation Printf
|
||||
-->
|
||||
<Archive sha1sum="d86b0be89f6e921b90e7230da40620dd16758fc1" type="tarxz">http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02.1.tar.xz</Archive>
|
||||
<BuildDependencies>
|
||||
<Dependency>zlib-devel</Dependency>
|
||||
<Dependency>ncurses-devel</Dependency>
|
||||
<Dependency>libX11-devel</Dependency>
|
||||
<Dependency>chrpath</Dependency>
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<Patch>fedora/0001-Don-t-ignore-.-configure-it-s-a-real-git-file.patch</Patch>
|
||||
<Patch>fedora/0002-Ensure-empty-compilerlibs-directory-is-created-by-gi.patch</Patch>
|
||||
<Patch>fedora/0003-Don-t-add-rpaths-to-libraries.patch</Patch>
|
||||
<Patch>fedora/0004-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch</Patch>
|
||||
<Patch>fedora/0005-configure-Allow-user-defined-C-compiler-flags.patch</Patch>
|
||||
<Patch>fedora/0009-arg-Add-no_arg-and-get_arg-helper-functions.patch</Patch>
|
||||
<Patch>fedora/0010-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch</Patch>
|
||||
<Patch>fedora/0011-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch</Patch>
|
||||
</Patches>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>ocaml</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency>zlib</Dependency>
|
||||
<Dependency>ncurses</Dependency>
|
||||
<Dependency>libX11</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="executable">/usr/bin/</Path>
|
||||
<Path fileType="library">/usr/lib/</Path>
|
||||
<Path fileType="doc">/usr/share/doc/</Path>
|
||||
<Path fileType="man">/usr/share/man/</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="7">
|
||||
<Date>2015-04-04</Date>
|
||||
<Version>4.02.1</Version>
|
||||
<Comment>Version bump.</Comment>
|
||||
<Name>Yusuf Aydemir</Name>
|
||||
<Email>yusuf.aydemir@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="6">
|
||||
<Date>2014-11-16</Date>
|
||||
<Version>4.00.2</Version>
|
||||
<Comment>Rebuild</Comment>
|
||||
<Name>Yusuf Aydemir</Name>
|
||||
<Email>yusuf.aydemir@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="5">
|
||||
<Date>2014-09-23</Date>
|
||||
<Version>4.00.2</Version>
|
||||
<Comment>Version bump.</Comment>
|
||||
<Name>Serdar Soytetir</Name>
|
||||
<Email>kaptan@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="4">
|
||||
<Date>2014-05-24</Date>
|
||||
<Version>3.4.1</Version>
|
||||
<Comment>Version bump.</Comment>
|
||||
<Name>PisiLinux Community</Name>
|
||||
<Email>admins@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="3">
|
||||
<Date>2014-02-07</Date>
|
||||
<Version>4.00.1</Version>
|
||||
<Comment>Rebuild.</Comment>
|
||||
<Name>Serdar Soytetir</Name>
|
||||
<Email>kaptan@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="2">
|
||||
<Date>2014-01-29</Date>
|
||||
<Version>4.01.0</Version>
|
||||
<Comment>Version bump.</Comment>
|
||||
<Name>Stefan Gronewold(groni)</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="1">
|
||||
<Date>2012-09-20</Date>
|
||||
<Version>4.00.0</Version>
|
||||
<Comment>First release</Comment>
|
||||
<Name>Serdar Soytetir</Name>
|
||||
<Email>kaptan@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</PISI>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" ?>
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>ocaml</Name>
|
||||
<Summary xml:lang="tr">Hızlı ve modern bir programlama dili</Summary>
|
||||
<Description xml:lang="tr">OcaML, ML dilinin soyundan gelen fonksiyonel bir programlama dilidir</Description>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>ocaml-mode</Name>
|
||||
<Summary xml:lang="tr">Emacs için ocaml kipi</Summary>
|
||||
</Package>
|
||||
|
||||
<Package>
|
||||
<Name>labltk</Name>
|
||||
<Summary xml:lang="tr">Ocaml için tk araç bağlayıcıları</Summary>
|
||||
</Package>
|
||||
</PISI>
|
||||
Reference in New Issue
Block a user