[Pkg-ocaml-maint-commits] [ocamlbuild] 01/02: Update condition-nativeonly-tests.patch to be cleaner

Ximin Luo infinity0 at debian.org
Sat Sep 16 11:52:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository ocamlbuild.

commit ae5314cbf9b1e78f35fcfc078b3c2c526389463d
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Jul 31 19:37:03 2017 +0200

    Update condition-nativeonly-tests.patch to be cleaner
---
 debian/changelog                                |  6 +++
 debian/patches/condition-nativeonly-tests.patch | 64 +++++++++++++------------
 2 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 782447f..901d475 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ocamlbuild (0.11.0-3) UNRELEASED; urgency=medium
+
+  * Update condition-nativeonly-tests.patch to be cleaner.
+
+ -- Ximin Luo <infinity0 at debian.org>  Mon, 31 Jul 2017 18:43:52 +0200
+
 ocamlbuild (0.11.0-2) experimental; urgency=medium
 
   * Only run native tests if ocamlopt is available, fixes FTBFS on arches
diff --git a/debian/patches/condition-nativeonly-tests.patch b/debian/patches/condition-nativeonly-tests.patch
index 53e2655..291cd41 100644
--- a/debian/patches/condition-nativeonly-tests.patch
+++ b/debian/patches/condition-nativeonly-tests.patch
@@ -2,8 +2,6 @@ Description: Only run native tests if ocamlopt is available
 Author: Ximin Luo <infinity0 at pwned.gg>
 Forwarded: https://github.com/ocaml/ocamlbuild/pull/253
 
-diff --git a/testsuite/internal.ml b/testsuite/internal.ml
-index 5198579..a0630f6 100644
 --- a/testsuite/internal.ml
 +++ b/testsuite/internal.ml
 @@ -3,6 +3,7 @@
@@ -14,7 +12,7 @@ index 5198579..a0630f6 100644
    ~tree:[T.f "dummy.ml"]
    ~matching:[M.Exact
                  (_build
-@@ -37,6 +38,7 @@ let () = test "BasicByteTree"
+@@ -37,6 +38,7 @@
  let () = test "SeveralTargets"
    ~options:[`no_ocamlfind]
    ~description:"Several targets"
@@ -22,7 +20,7 @@ index 5198579..a0630f6 100644
    ~tree:[T.f "dummy.ml"]
    ~matching:[_build (M.lf ["dummy.byte"; "dummy.native"])]
    ~targets:("dummy.byte",["dummy.native"]) ();;
-@@ -79,6 +81,7 @@ let () = test "Itarget"
+@@ -79,6 +81,7 @@
  let () = test "PackAcross"
    ~options:[`no_ocamlfind]
    ~description:"Pack using a module from the other tree (PR#4592)"
@@ -30,7 +28,7 @@ index 5198579..a0630f6 100644
    ~tree:[T.f "main.ml" ~content:"let _ = Pack.Packed.g ()\n";
           T.f "Pack.mlpack" ~content:"pack/Packed";
           T.f "_tags" ~content:"<lib>: include\n<pack/*.cmx>: for-pack(Pack)\n";
-@@ -118,6 +121,7 @@ let () = test "NativeMliCmi"
+@@ -118,6 +121,7 @@
              `tags["native"]]
    ~description:"check that ocamlopt is used for .mli->.cmi \
                  when tag 'native' is set (part of PR#4613)"
@@ -38,7 +36,7 @@ index 5198579..a0630f6 100644
    ~tree:[T.f "foo.mli" ~content:"val bar : int"]
    ~matching:[_build [M.f "foo.cmi"]]
    ~targets:("foo.cmi",[]) ();;
-@@ -157,12 +161,14 @@ let () = test "NoIncludeNoHygiene3"
+@@ -157,12 +161,14 @@
  let () = test "OutputObj"
    ~options:[`no_ocamlfind]
    ~description:"output_obj targets for native and bytecode (PR #6049)"
@@ -53,7 +51,7 @@ index 5198579..a0630f6 100644
    ~tree:[T.f "hello.ml" ~content:"print_endline \"Hello, World!\"";
           T.f "_tags" ~content:"<*.so>: runtime_variant(_pic)"]
    ~targets:("hello.byte.so",["hello.native.so"]) ();;
-@@ -170,6 +176,7 @@ let () = test "OutputShared"
+@@ -170,6 +176,7 @@
  let () = test "CmxsStubLink"
    ~options:[`no_ocamlfind]
    ~description:".cmxs link rules pass correct -I flags"
@@ -61,7 +59,7 @@ index 5198579..a0630f6 100644
    ~tree:[T.d "src" [
             T.f "foo_stubs.c" ~content:"";
             T.f "libfoo_stubs.clib" ~content:"foo_stubs.o";
-@@ -236,6 +243,7 @@ let () = test "ModularPlugin1"
+@@ -236,6 +243,7 @@
  let () = test "ModularPlugin2"
    ~description:"check that parametrized tags defined by the plugin \
                  do not warn at plugin-compilation time"
@@ -69,7 +67,7 @@ index 5198579..a0630f6 100644
    ~options:[`no_ocamlfind; `quiet]
    ~tree:[T.f "main.ml" ~content:"let x = 1";
           T.f "_tags" ~content:"<main.*>: toto(-g)";
-@@ -249,6 +257,7 @@ let () = test "ModularPlugin2"
+@@ -249,6 +257,7 @@
  let () = test "ModularPlugin3"
    ~description:"check that unknown parametrized tags encountered \
                  during plugin compilation still warn"
@@ -77,7 +75,7 @@ index 5198579..a0630f6 100644
    ~options:[`no_ocamlfind; `quiet; `plugin_tag "toto(-g)"]
    ~tree:[T.f "main.ml" ~content:"let x = 1";
           T.f "myocamlbuild.ml"
-@@ -278,6 +287,7 @@ let () = test "PluginCompilation2"
+@@ -278,6 +287,7 @@
  let () = test "PluginCompilation3"
    ~description:"check that the plugin is not executed \
                  when -just-plugin is passed"
@@ -85,7 +83,7 @@ index 5198579..a0630f6 100644
    ~options:[`no_ocamlfind; `quiet; `just_plugin]
    ~tree:[T.f "main.ml" ~content:"let x = 1";
           T.f "myocamlbuild.ml" ~content:"print_endline \"foo\";;"]
-@@ -417,6 +427,7 @@ let () = test "JustNoPlugin"
+@@ -417,6 +427,7 @@
  
  let () = test "CmxsFromMllib1"
    ~description:"Check that a .cmxs file can be built from a .mllib file"
@@ -93,7 +91,7 @@ index 5198579..a0630f6 100644
    ~options:[`no_ocamlfind; `no_plugin]
    ~tree:[
      T.f "a.ml" ~content:"let a = 1\n";
-@@ -428,6 +439,7 @@ let () = test "CmxsFromMllib1"
+@@ -428,6 +439,7 @@
  let () = test "CmxsFromMllib2"
    ~description:"Check that a .cmxs file can be built from a .mllib file,
                  even when one of the module has the same name as the library"
@@ -101,7 +99,7 @@ index 5198579..a0630f6 100644
    ~options:[`no_ocamlfind; `no_plugin]
    ~tree:[
      T.f "a.ml" ~content:"let a = 1\n";
-@@ -441,6 +453,7 @@ let () = test "CmxsFromMllib2"
+@@ -441,6 +453,7 @@
  let () = test "MldylibOverridesMllib"
    ~description:"Check that the rule producing a cmxs from a .mllib only \
                  triggers if there is no .mldylib"
@@ -109,7 +107,7 @@ index 5198579..a0630f6 100644
  (*
     GPR #132 (requested by issue #131) adds a new rule which allows producing a
     .cmxs from a .mllib, where previously this was only possible by providing
-@@ -460,6 +473,7 @@ let () = test "MldylibOverridesMllib"
+@@ -460,6 +473,7 @@
  let () = test "MldylibOverridesCmx"
    ~description:"Check that the rule producing foo.cmxs from foo.mldylib \
                  takes precedence over the one that uses foo.cmx"
@@ -117,7 +115,7 @@ index 5198579..a0630f6 100644
    ~options:[`no_ocamlfind; `no_plugin]
    ~matching:[_build [M.f "bar.cmi"]]
    ~tree:[
-@@ -472,6 +486,7 @@ let () = test "MldylibOverridesCmx"
+@@ -472,6 +486,7 @@
  let () = test "MllibOverridesCmx"
    ~description:"Check that the rule producing foo.cmxs from foo.mllib \
                  takes precedence over the one that uses foo.cmx"
@@ -125,29 +123,33 @@ index 5198579..a0630f6 100644
    ~options:[`no_ocamlfind; `no_plugin]
    ~matching:[_build [M.f "bar.cmi"]]
    ~tree:[
-diff --git a/testsuite/internal_test_header.ml b/testsuite/internal_test_header.ml
-index 5c1f9f0..8eea924 100644
 --- a/testsuite/internal_test_header.ml
 +++ b/testsuite/internal_test_header.ml
-@@ -6,3 +6,21 @@ module M = Match;;
+@@ -1,8 +1,16 @@
+ #load "unix.cma";;
+ 
++#mod_use "../src/ocamlbuild_config.ml";;
++
+ #use "ocamlbuild_test.ml";;
+ 
+ module M = Match;;
  module T = Tree;;
  
  let _build = M.d "_build";;
 +
 +let ocamlopt_available =
-+  let chan = open_in "../Makefile.config" in
-+  let rec loop () =
-+    try
-+      let line = String.trim (input_line chan) in
-+      let len = String.length line in
-+      if len >= 13 && String.sub line 0 13 = "OCAML_NATIVE=" then
-+        let native = String.sub line 13 (len - 13) in
-+        native = "true"
-+      else
-+        loop ()
-+    with End_of_file -> close_in chan; false
-+  in
-+  if loop () then
++  if Ocamlbuild_config.ocaml_native then
 +    Fullfilled
 +  else
 +    Missing ("ocamlopt")
+--- a/configure.make
++++ b/configure.make
+@@ -94,6 +94,8 @@
+ 	echo ;\
+ 	echo 'let bindir = "$(OCAMLBUILD_BINDIR)"'; \
+ 	echo 'let libdir = "$(OCAMLBUILD_LIBDIR)"'; \
++	echo 'let ocaml_native = $(OCAML_NATIVE)'; \
++	echo 'let ocaml_native_tools = $(OCAML_NATIVE_TOOLS)'; \
+ 	echo 'let supports_shared_libraries = $(SUPPORTS_SHARED_LIBRARIES)';\
+ 	echo 'let a = "$(A)"'; \
+ 	echo 'let o = "$(O)"'; \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/ocamlbuild.git



More information about the Pkg-ocaml-maint-commits mailing list