# HG changeset patch
# User Markus Mützel <markus.muetzel@gmx.de>
# Date 1552757001 -3600
#      Sat Mar 16 18:23:21 2019 +0100
# Node ID 9061d71b3f3da3d62ee2963168440ad0398bb24b
# Parent  9fb478d2036b3b2a5b8e3c0113c48af812e5fef1
Update sundials to 4.1.0 while keeping version 2.7.0

diff -r 9fb478d2036b -r 9061d71b3f3d dist-files.mk
--- a/dist-files.mk	Wed Mar 13 08:25:35 2019 +0000
+++ b/dist-files.mk	Sat Mar 16 18:23:21 2019 +0100
@@ -692,7 +692,8 @@
   stable-octave.mk \
   suitesparse-1.patch \
   suitesparse.mk \
-  sundials-ida-1.patch \
+  sundials-27-ida-1.patch \
+  sundials-27-ida.mk \
   sundials-ida.mk \
   t4k_common.mk \
   taglib-1-static.patch \
diff -r 9fb478d2036b -r 9061d71b3f3d index.html
--- a/index.html	Wed Mar 13 08:25:35 2019 +0000
+++ b/index.html	Sat Mar 16 18:23:21 2019 +0100
@@ -2622,6 +2622,10 @@
         <td class="website"><a href="http://www.cise.ufl.edu/research/sparse/SuiteSparse/">SuiteSparse</a></td>
     </tr>
     <tr>
+        <td class="package">sundials-27-ida</td>
+        <td class="website"><a href="http://computation.llnl.gov/projects/sundials/">Sundials IDA v2.7.0</a> (can be removed once Octave 5 is phased out)</td>
+    </tr>
+    <tr>
         <td class="package">sundials-ida</td>
         <td class="website"><a href="http://computation.llnl.gov/projects/sundials/">Sundials IDA</a></td>
     </tr>
diff -r 9fb478d2036b -r 9061d71b3f3d src/sundials-27-ida-1.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sundials-27-ida-1.patch	Sat Mar 16 18:23:21 2019 +0100
@@ -0,0 +1,20 @@
+Add missing dependency on KLU when building IDA shared library.
+
+Based on a patch in the Debian sundials package by Dima Kogan.
+
+https://anonscm.debian.org/cgit/debian-science/packages/sundials.git/tree/debian/patches/0001-Added-missing-linkages-
+
+diff --git a/src/ida/CMakeLists.txt b/src/ida/CMakeLists.txt
+--- a/src/ida/CMakeLists.txt
++++ b/src/ida/CMakeLists.txt
+@@ -135,6 +135,10 @@ IF(BUILD_SHARED_LIBS)
+   ADD_LIBRARY(sundials_ida_shared SHARED
+     ${ida_SOURCES}  ${ida_BL_SOURCES} ${shared_SOURCES})
+ 
++  IF(KLU_FOUND)
++    TARGET_LINK_LIBRARIES(sundials_ida_shared -lklu)
++  ENDIF(KLU_FOUND)
++
+   # Set the library name and make sure it is not deleted
+   SET_TARGET_PROPERTIES(sundials_ida_shared
+     PROPERTIES OUTPUT_NAME sundials_ida CLEAN_DIRECT_OUTPUT 1)
diff -r 9fb478d2036b -r 9061d71b3f3d src/sundials-27-ida.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sundials-27-ida.mk	Sat Mar 16 18:23:21 2019 +0100
@@ -0,0 +1,43 @@
+# This file is part of MXE.
+# See index.html for further information.
+# This file can be removed once Octave 5 is phased out.
+
+PKG             := sundials-27-ida
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 2.7.0
+$(PKG)_CHECKSUM := 3559c375ce9f875542e4a39978908f91792e6d57
+$(PKG)_SUBDIR   := sundials-$($(PKG)_VERSION)
+$(PKG)_FILE     := sundials-$($(PKG)_VERSION).tar.gz
+$(PKG)_URL      := https://computation.llnl.gov/projects/sundials/download/$($(PKG)_FILE)
+$(PKG)_DEPS     := lapack libgomp suitesparse
+
+define $(PKG)_UPDATE
+    echo 'Warning: Updates are temporarily disabled for package $(PKG).' >&2;
+    echo $($(PKG)_VERSION)
+endef
+
+define $(PKG)_BUILD
+    mkdir '$(1).build'
+    cd '$(1).build' && cmake \
+        -DEXAMPLES_ENABLE=OFF \
+        -DKLU_ENABLE=ON \
+        -DKLU_INCLUDE_DIR=$(HOST_INCDIR)/suitesparse \
+        -DKLU_LIBRARY_DIR=$(HOST_LIBDIR) \
+        -DSUITESPARSECONFIG_LIBRARY=$(HOST_LIBDIR)/libsuitesparseconfig.dll.a \
+        -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
+	-DBUILD_ARKODE=OFF \
+	-DBUILD_CVODE=OFF \
+	-DBUILD_CVODES=OFF \
+	-DBUILD_IDA=ON \
+	-DBUILD_IDAS=OFF \
+	-DBUILD_KINSOL=OFF \
+	-DBUILD_CPODES=OFF \
+        '$(1)'
+    $(MAKE) -C '$(1).build' -j '$(JOBS)' install DESTDIR='$(3)' VERBOSE=1
+
+    if [ $(MXE_SYSTEM) = mingw ]; then \
+        echo "Install dlls"; \
+        $(INSTALL) -d '$(3)$(HOST_BINDIR)'; \
+        mv '$(3)$(HOST_LIBDIR)/'libsundials*.dll '$(3)$(HOST_BINDIR)/'; \
+    fi
+endef
diff -r 9fb478d2036b -r 9061d71b3f3d src/sundials-ida-1.patch
--- a/src/sundials-ida-1.patch	Wed Mar 13 08:25:35 2019 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-Add missing dependency on KLU when building IDA shared library.
-
-Based on a patch in the Debian sundials package by Dima Kogan.
-
-https://anonscm.debian.org/cgit/debian-science/packages/sundials.git/tree/debian/patches/0001-Added-missing-linkages-
-
-diff --git a/src/ida/CMakeLists.txt b/src/ida/CMakeLists.txt
---- a/src/ida/CMakeLists.txt
-+++ b/src/ida/CMakeLists.txt
-@@ -135,6 +135,10 @@ IF(BUILD_SHARED_LIBS)
-   ADD_LIBRARY(sundials_ida_shared SHARED
-     ${ida_SOURCES}  ${ida_BL_SOURCES} ${shared_SOURCES})
- 
-+  IF(KLU_FOUND)
-+    TARGET_LINK_LIBRARIES(sundials_ida_shared -lklu)
-+  ENDIF(KLU_FOUND)
-+
-   # Set the library name and make sure it is not deleted
-   SET_TARGET_PROPERTIES(sundials_ida_shared
-     PROPERTIES OUTPUT_NAME sundials_ida CLEAN_DIRECT_OUTPUT 1)
diff -r 9fb478d2036b -r 9061d71b3f3d src/sundials-ida.mk
--- a/src/sundials-ida.mk	Wed Mar 13 08:25:35 2019 +0000
+++ b/src/sundials-ida.mk	Sat Mar 16 18:23:21 2019 +0100
@@ -3,8 +3,8 @@
 
 PKG             := sundials-ida
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 2.7.0
-$(PKG)_CHECKSUM := 3559c375ce9f875542e4a39978908f91792e6d57
+$(PKG)_VERSION  := 4.1.0
+$(PKG)_CHECKSUM := ef2a4175b3974960febd5cba4f65e53628009cc6
 $(PKG)_SUBDIR   := sundials-$($(PKG)_VERSION)
 $(PKG)_FILE     := sundials-$($(PKG)_VERSION).tar.gz
 $(PKG)_URL      := https://computation.llnl.gov/projects/sundials/download/$($(PKG)_FILE)
