openfoam: 4.0 -> 8 (using older compiler didn't work with CGAL)
This commit is contained in:
@@ -23,7 +23,7 @@ self: super: pkgs: with pkgs; {
|
|||||||
|
|
||||||
inherit (callPackage ./opengl/default.nix { inherit super; }) libGL mesa_glxgallium;
|
inherit (callPackage ./opengl/default.nix { inherit super; }) libGL mesa_glxgallium;
|
||||||
|
|
||||||
openfoam = callPackage ./openfoam { stdenv = overrideCC stdenv gcc7; };
|
openfoam = callPackage ./openfoam.nix { };
|
||||||
|
|
||||||
openslide = callPackage ./openslide { };
|
openslide = callPackage ./openslide { };
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,33 @@
|
|||||||
{ stdenv, fetchurl, makeWrapper, flex, bison
|
{ stdenv, bashInteractive, fetchFromGitHub, makeWrapper, flex, bison
|
||||||
, zlib, boost, openmpi, readline, gperftools, cgal, metis, scotch, mpfr }:
|
, zlib, boost, openmpi, readline, gperftools, cgal, metis, scotch, mpfr }:
|
||||||
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "4.0";
|
version = "20201114";
|
||||||
name = "openfoam-${version}";
|
pname = "OpenFOAM-8";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchFromGitHub {
|
||||||
url = "https://github.com/OpenFOAM/OpenFOAM-4.x/archive/version-${version}.tar.gz";
|
owner = "OpenFOAM";
|
||||||
sha256 = "0jfzc561ra1wzg8wbp5ipp1r5r1qg84krhmcvi8injqkl4svxbkk";
|
repo = pname;
|
||||||
|
name = "${pname}-${version}.zip";
|
||||||
|
rev = version;
|
||||||
|
sha256 = "1hl7zr405ifkppbm519yax5yqcm8zy1f98sfgy6zdnph2jx8fs34";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./newer-cgal.patch ];
|
|
||||||
|
|
||||||
# a lot of assumptions about being under a directory named OpenFOAM-${version}
|
# a lot of assumptions about being under a directory named OpenFOAM-${version}
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
echo "resettting sourceRoot to ''${sourceRoot/-4.x-version/}"
|
echo "resettting sourceRoot to ''${sourceRoot/-${version}.zip/}"
|
||||||
mv "$sourceRoot" "''${sourceRoot/-4.x-version/}"
|
mv "$sourceRoot" "''${sourceRoot/-${version}.zip/}"
|
||||||
sourceRoot="''${sourceRoot/-4.x-version/}"
|
sourceRoot="''${sourceRoot/-${version}.zip/}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
|
||||||
|
# alternative to disabling exit on command failure with etc/bashrc could be
|
||||||
|
#
|
||||||
|
# sed -ie 's|^\( *unalias .\+ 2> */dev/null *\)$|\1 \|\| true|' etc/config.sh/aliases
|
||||||
|
# sed -ie 's|^\( *complete .\+\)$|\1 \|\| true|' etc/config.sh/bash_completion
|
||||||
|
patchPhase = ''
|
||||||
|
patchShebangs .
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# one of the following would bake in the rpath, but sourcing etc/bashrc file updates LD_LIBRARY_PATH
|
# one of the following would bake in the rpath, but sourcing etc/bashrc file updates LD_LIBRARY_PATH
|
||||||
@@ -25,11 +35,13 @@ stdenv.mkDerivation rec {
|
|||||||
# NIX_LDFLAGS="${NIX_LDFLAGS/"$out/lib$WM_ARCH_OPTION"/"$out/platform/$WM_OPTIONS/lib"}"
|
# NIX_LDFLAGS="${NIX_LDFLAGS/"$out/lib$WM_ARCH_OPTION"/"$out/platform/$WM_OPTIONS/lib"}"
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
sed -ie 's|FOAM_INST_DIR=$HOME/$WM_PROJECT.*|FOAM_INST_DIR='"$out"/lib/OpenFOAM-${version}'|' etc/bashrc
|
sed -ie 's|FOAM_INST_DIR=$HOME/$WM_PROJECT.*|FOAM_INST_DIR='"$out"/lib/OpenFOAM-${version}'|' etc/bashrc
|
||||||
sed -ie 's|BOOST_ARCH_PATH=.*$|BOOST_ARCH_PATH=${boost}|' etc/config.sh/CGAL
|
|
||||||
sed -ie 's|CGAL_ARCH_PATH=.*$|CGAL_ARCH_PATH=${cgal}|' etc/config.sh/CGAL
|
|
||||||
sed -ie 's|METIS_ARCH_PATH=.*$|METIS_ARCH_PATH=${metis}|' etc/config.sh/metis
|
sed -ie 's|METIS_ARCH_PATH=.*$|METIS_ARCH_PATH=${metis}|' etc/config.sh/metis
|
||||||
sed -ie 's|SCOTCH_ARCH_PATH=.*$|SCOTCH_ARCH_PATH=${scotch}|' etc/config.sh/scotch
|
sed -ie 's|SCOTCH_ARCH_PATH=.*$|SCOTCH_ARCH_PATH=${scotch}|' etc/config.sh/scotch
|
||||||
|
sed -ie 's|gperftools_install=.*$|gperftools_install=${gperftools}|' etc/config.sh/gperftools
|
||||||
|
declare opts=$(shopt -p) output
|
||||||
|
set +o errexit
|
||||||
source "$PWD/etc/bashrc"
|
source "$PWD/etc/bashrc"
|
||||||
|
eval "$opts"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
--- OpenFOAM-4.0/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/CV2D.H_ 2019-05-08 12:06:37.310401266 -0400
|
|
||||||
+++ OpenFOAM-4.0/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/CV2D.H 2019-05-08 12:07:12.582103107 -0400
|
|
||||||
@@ -150,6 +150,7 @@
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
+ typedef Foam::point point;
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user