summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@users.noreply.github.com>2016-06-15 20:30:39 +0200
committerGitHub <noreply@github.com>2016-06-15 20:30:39 +0200
commit46edcd668f0e63b6c8efc171289d66cb5e824b6a (patch)
treef0eb0e5f35c1920ab733accd332699dfd0212a28 /pkgs/applications
parentcdcc1b1c53dc285c1c10a58b75a8ba8d6cc46597 (diff)
parentac4903284c75f8cae746f538dee7f8d43dda8e76 (diff)
downloadnixpkgs-46edcd668f0e63b6c8efc171289d66cb5e824b6a.tar
nixpkgs-46edcd668f0e63b6c8efc171289d66cb5e824b6a.tar.gz
nixpkgs-46edcd668f0e63b6c8efc171289d66cb5e824b6a.tar.bz2
nixpkgs-46edcd668f0e63b6c8efc171289d66cb5e824b6a.tar.lz
nixpkgs-46edcd668f0e63b6c8efc171289d66cb5e824b6a.tar.xz
nixpkgs-46edcd668f0e63b6c8efc171289d66cb5e824b6a.tar.zst
nixpkgs-46edcd668f0e63b6c8efc171289d66cb5e824b6a.zip
Merge pull request #16095 from christopher-l/gmsh
gmsh: init at 2.12.0
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/science/math/gmsh/CMakeLists.txt.patch37
-rw-r--r--pkgs/applications/science/math/gmsh/default.nix29
2 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/applications/science/math/gmsh/CMakeLists.txt.patch b/pkgs/applications/science/math/gmsh/CMakeLists.txt.patch
new file mode 100644
index 00000000000..0326a8d296a
--- /dev/null
+++ b/pkgs/applications/science/math/gmsh/CMakeLists.txt.patch
@@ -0,0 +1,37 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -324,25 +324,16 @@
+         set_config_option(HAVE_BLAS "Blas(IntelMKL)")
+         set_config_option(HAVE_LAPACK "Lapack(IntelMKL)")
+       else(LAPACK_LIBRARIES)
+-        # on Linux also try to find ATLAS without a Fortran compiler, because
+-        # cmake ships with a buggy FindBLAS e.g. on Ubuntu Lucid Lynx
+-        set(ATLAS_LIBS_REQUIRED lapack f77blas cblas atlas)
+-        find_all_libraries(LAPACK_LIBRARIES ATLAS_LIBS_REQUIRED "" "")
++        # try with generic names
++        set(GENERIC_LIBS_REQUIRED lapack blas pthread)
++        find_all_libraries(LAPACK_LIBRARIES GENERIC_LIBS_REQUIRED "" "")
+         if(LAPACK_LIBRARIES)
+-          set_config_option(HAVE_BLAS "Blas(ATLAS)")
+-          set_config_option(HAVE_LAPACK "Lapack(ATLAS)")
+-        else(LAPACK_LIBRARIES)
+-          # try with generic names
+-          set(GENERIC_LIBS_REQUIRED lapack blas pthread)
+-          find_all_libraries(LAPACK_LIBRARIES GENERIC_LIBS_REQUIRED "" "")
+-          if(LAPACK_LIBRARIES)
+-            set_config_option(HAVE_BLAS "Blas(Generic)")
+-            set_config_option(HAVE_LAPACK "Lapack(Generic)")
+-            find_library(GFORTRAN_LIB gfortran)
+-            if(GFORTRAN_LIB)
+-              list(APPEND LAPACK_LIBRARIES ${GFORTRAN_LIB})
+-            endif(GFORTRAN_LIB)
+-          endif(LAPACK_LIBRARIES)
++          set_config_option(HAVE_BLAS "Blas(Generic)")
++          set_config_option(HAVE_LAPACK "Lapack(Generic)")
++          find_library(GFORTRAN_LIB gfortran)
++          if(GFORTRAN_LIB)
++            list(APPEND LAPACK_LIBRARIES ${GFORTRAN_LIB})
++          endif(GFORTRAN_LIB)
+         endif(LAPACK_LIBRARIES)
+       endif(LAPACK_LIBRARIES)
+     elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
diff --git a/pkgs/applications/science/math/gmsh/default.nix b/pkgs/applications/science/math/gmsh/default.nix
new file mode 100644
index 00000000000..b5596120592
--- /dev/null
+++ b/pkgs/applications/science/math/gmsh/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, cmake, blas, liblapack, gfortran, fltk, libjpeg
+, zlib, mesa, mesa_glu, xorg }:
+
+let version = "2.12.0"; in
+
+stdenv.mkDerivation {
+  name = "gmsh-${version}";
+
+  src = fetchurl {
+    url = "http://gmsh.info/src/gmsh-${version}-source.tgz";
+    sha256 = "02cx2mfbxx6m18s54z4yzbk4ybch3v9489z7cr974y8y0z42xgbz";
+  };
+
+  # The original CMakeLists tries to use some version of the Lapack lib
+  # that is supposed to work without Fortran but didn't for me.
+  patches = [ ./CMakeLists.txt.patch ];
+
+  buildInputs = [ cmake blas liblapack gfortran fltk libjpeg zlib mesa
+    mesa_glu xorg.libXrender xorg.libXcursor xorg.libXfixes xorg.libXext
+    xorg.libXft xorg.libXinerama xorg.libX11 xorg.libSM xorg.libICE
+  ];
+
+  meta = {
+    description = "A three-dimensional finite element mesh generator";
+    homepage = http://gmsh.info/;
+    platforms = stdenv.lib.platforms.all;
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}