Blob Blame History Raw
From be0f6933f16fea6d6fb2e39178816974be4c3724 Mon Sep 17 00:00:00 2001
From: Markus Mottl <markus.mottl@gmail.com>
Date: Fri, 12 Feb 2021 16:19:50 -0500
Subject: [PATCH 1/4] Switched to Dune lang 2.7

---
 dune-project    |   5 +--
 examples/dune   |   1 +
 gsl.opam        |  41 +++++++++++--------
 src/config/dune |   4 ++
 src/dune        | 106 ++++++++++++++++++++++++------------------------
 5 files changed, 85 insertions(+), 72 deletions(-)

diff --git a/dune-project b/dune-project
index eb39614..27bdde7 100644
--- a/dune-project
+++ b/dune-project
@@ -1,11 +1,11 @@
-(lang dune 1.10)
+(lang dune 2.7)
 (name gsl)
 (version 1.24.3)
 
 (generate_opam_files true)
 
 (source (github mmottl/gsl-ocaml))
-(license "GPL-3+")
+(license "GPL-3.0+")
 (homepage "https://mmottl.github.io/gsl-ocaml")
 (documentation "https://mmottl.github.io/gsl-ocaml/api")
 
@@ -26,7 +26,6 @@
 linear algebra, etc.")
   (depends
     (ocaml (>= 4.08))
-    (dune (>= 1.10))
     dune-configurator
     (conf-gsl :build)
     (conf-pkg-config :build)
diff --git a/examples/dune b/examples/dune
index 23b8475..b00ade2 100644
--- a/examples/dune
+++ b/examples/dune
@@ -35,4 +35,5 @@
     wavelet_ex
   )
   (libraries gsl)
+  (modes byte exe)
 )
diff --git a/gsl.opam b/gsl.opam
index b00bf08..ee63305 100644
--- a/gsl.opam
+++ b/gsl.opam
@@ -1,32 +1,41 @@
 version: "1.24.3"
 # This file is generated by dune, edit dune-project instead
 opam-version: "2.0"
-build: [
-  ["dune" "subst"] {pinned}
-  ["dune" "build" "-p" name "-j" jobs]
-  ["dune" "runtest" "-p" name "-j" jobs] {with-test}
-  ["dune" "build" "-p" name "@doc"] {with-doc}
-]
+synopsis: "GSL - Bindings to the GNU Scientific Library"
+description: """
+gsl-ocaml interfaces the GSL (GNU Scientific Library), providing many of the
+most frequently used functions for scientific computation including algorithms
+for optimization, differential equations, statistics, random number generation,
+linear algebra, etc."""
 maintainer: ["Markus Mottl <markus.mottl@gmail.com>"]
 authors: [
   "Olivier Andrieu <oandrieu@gmail.com>"
   "Markus Mottl <markus.mottl@gmail.com>"
 ]
-bug-reports: "https://github.com/mmottl/gsl-ocaml/issues"
+license: "GPL-3.0+"
 homepage: "https://mmottl.github.io/gsl-ocaml"
 doc: "https://mmottl.github.io/gsl-ocaml/api"
-license: "GPL-3+"
-dev-repo: "git+https://github.com/mmottl/gsl-ocaml.git"
-synopsis: "GSL - Bindings to the GNU Scientific Library"
-description: """
-gsl-ocaml interfaces the GSL (GNU Scientific Library), providing many of the
-most frequently used functions for scientific computation including algorithms
-for optimization, differential equations, statistics, random number generation,
-linear algebra, etc."""
+bug-reports: "https://github.com/mmottl/gsl-ocaml/issues"
 depends: [
+  "dune" {>= "2.7"}
   "ocaml" {>= "4.08"}
-  "dune" {>= "1.10"}
   "dune-configurator"
   "conf-gsl" {build}
   "conf-pkg-config" {build}
-]
\ No newline at end of file
+  "odoc" {with-doc}
+]
+build: [
+  ["dune" "subst"] {dev}
+  [
+    "dune"
+    "build"
+    "-p"
+    name
+    "-j"
+    jobs
+    "@install"
+    "@runtest" {with-test}
+    "@doc" {with-doc}
+  ]
+]
+dev-repo: "git+https://github.com/mmottl/gsl-ocaml.git"
diff --git a/src/config/dune b/src/config/dune
index b511db9..641001f 100644
--- a/src/config/dune
+++ b/src/config/dune
@@ -7,22 +7,26 @@
   (name discover)
   (modules discover)
   (libraries dune.configurator)
+  (modes byte exe)
 )
 
 (executable
   (name do_cdf)
   (modules do_cdf)
   (libraries do_common str)
+  (modes byte exe)
 )
 
 (executable
   (name do_const)
   (modules do_const)
   (libraries do_common str)
+  (modes byte exe)
 )
 
 (executable
   (name do_sf)
   (modules do_sf)
   (libraries do_common str)
+  (modes byte exe)
 )
diff --git a/src/dune b/src/dune
index a6d8ce9..c05e494 100644
--- a/src/dune
+++ b/src/dune
@@ -1,58 +1,58 @@
 (library
   (public_name gsl)
-  (c_names
-    mlgsl_blas
-    mlgsl_blas_complex
-    mlgsl_blas_complex_float
-    mlgsl_blas_float
-    mlgsl_bspline
-    mlgsl_cdf
-    mlgsl_cheb
-    mlgsl_combi
-    mlgsl_complex
-    mlgsl_deriv
-    mlgsl_eigen
-    mlgsl_error
-    mlgsl_fft
-    mlgsl_fit
-    mlgsl_fun
-    mlgsl_histo
-    mlgsl_ieee
-    mlgsl_integration
-    mlgsl_interp
-    mlgsl_linalg
-    mlgsl_linalg_complex
-    mlgsl_math
-    mlgsl_matrix_complex
-    mlgsl_matrix_complex_float
-    mlgsl_matrix_double
-    mlgsl_matrix_float
-    mlgsl_min
-    mlgsl_monte
-    mlgsl_multifit
-    mlgsl_multimin
-    mlgsl_multiroots
-    mlgsl_odeiv
-    mlgsl_permut
-    mlgsl_poly
-    mlgsl_qrng
-    mlgsl_randist
-    mlgsl_rng
-    mlgsl_roots
-    mlgsl_sf
-    mlgsl_sort
-    mlgsl_stats
-    mlgsl_sum
-    mlgsl_vector_double
-    mlgsl_vector_float
-    mlgsl_wavelet
-  )
-  (c_flags
-    (:standard)
-    (:include c_flags.sexp) -fPIC -DPIC
-    ; NOTE: for limiting excessive warning about unused parameters
-    -Wno-unused-parameter
-  )
+  (foreign_stubs
+    (language c)
+    (names
+      mlgsl_blas
+      mlgsl_blas_complex
+      mlgsl_blas_complex_float
+      mlgsl_blas_float
+      mlgsl_bspline
+      mlgsl_cdf
+      mlgsl_cheb
+      mlgsl_combi
+      mlgsl_complex
+      mlgsl_deriv
+      mlgsl_eigen
+      mlgsl_error
+      mlgsl_fft
+      mlgsl_fit
+      mlgsl_fun
+      mlgsl_histo
+      mlgsl_ieee
+      mlgsl_integration
+      mlgsl_interp
+      mlgsl_linalg
+      mlgsl_linalg_complex
+      mlgsl_math
+      mlgsl_matrix_complex
+      mlgsl_matrix_complex_float
+      mlgsl_matrix_double
+      mlgsl_matrix_float
+      mlgsl_min
+      mlgsl_monte
+      mlgsl_multifit
+      mlgsl_multimin
+      mlgsl_multiroots
+      mlgsl_odeiv
+      mlgsl_permut
+      mlgsl_poly
+      mlgsl_qrng
+      mlgsl_randist
+      mlgsl_rng
+      mlgsl_roots
+      mlgsl_sf
+      mlgsl_sort
+      mlgsl_stats
+      mlgsl_sum
+      mlgsl_vector_double
+      mlgsl_vector_float
+      mlgsl_wavelet)
+    (flags
+      (:standard)
+      (:include c_flags.sexp) -fPIC -DPIC
+      ; NOTE: for limiting excessive warning about unused parameters
+      -Wno-unused-parameter))
   (c_library_flags (:include c_library_flags.sexp))
   (libraries bigarray)
 )
-- 
2.41.0