From 16eb4b2458ab4716c8dcdd8e48565c8a864bf04b Mon Sep 17 00:00:00 2001 From: Sebastian Jaeckel Date: Tue, 22 Apr 2025 17:02:45 +0200 Subject: [PATCH] pkgs/openfoam: set OpenFOAM version to 11.20240704 --- ...rc-add-placeholder-for-FOAM_INST_DIR.patch | 34 ------------------- pkgs/openfoam/default.nix | 17 ++++------ 2 files changed, 7 insertions(+), 44 deletions(-) delete mode 100644 pkgs/openfoam/0001-etc-bashrc-add-placeholder-for-FOAM_INST_DIR.patch diff --git a/pkgs/openfoam/0001-etc-bashrc-add-placeholder-for-FOAM_INST_DIR.patch b/pkgs/openfoam/0001-etc-bashrc-add-placeholder-for-FOAM_INST_DIR.patch deleted file mode 100644 index 21ee2f2..0000000 --- a/pkgs/openfoam/0001-etc-bashrc-add-placeholder-for-FOAM_INST_DIR.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 8043842ab7feceae999addf2725d44ab0f65071a Mon Sep 17 00:00:00 2001 -From: Sebastian Woetzel -Date: Sun, 20 Apr 2025 18:00:41 +0200 -Subject: [PATCH] etc/bashrc: add placeholder for FOAM_INST_DIR - ---- - etc/bashrc | 11 ++--------- - 1 file changed, 2 insertions(+), 9 deletions(-) - -diff --git a/etc/bashrc b/etc/bashrc -index 1ead5cc1c7..59d0bdb2ad 100644 ---- a/etc/bashrc -+++ b/etc/bashrc -@@ -42,15 +42,8 @@ export WM_PROJECT_VERSION=12 - # the directory two levels below this file, or $HOME/$WM_PROJECT if that - # directory cannot be determined. - # --[ "$BASH" ] && bashrcFile=${BASH_SOURCE} --[ "$ZSH_NAME" ] && bashrcFile=$0 --if [ -n "$bashrcFile" ] --then -- export FOAM_INST_DIR=$(cd $(dirname $bashrcFile)/../.. && pwd -P) --else -- export FOAM_INST_DIR=$HOME/$WM_PROJECT --fi --unset bashrcFile -+# FOAM_INST_DIR is set in postPatch phase -+# __inst_dir_placeholder__ - # - # Please set to the appropriate path if the above default is not correct. E.g., - # --- -2.49.0 - diff --git a/pkgs/openfoam/default.nix b/pkgs/openfoam/default.nix index aef505c..017ebdb 100644 --- a/pkgs/openfoam/default.nix +++ b/pkgs/openfoam/default.nix @@ -4,9 +4,9 @@ pkgs, ... }: let - version = "12.20250206"; - major = "12"; - revision = "20250206"; + version = "11.20240704"; + major = "11"; + revision = "20240704"; realname = "OpenFOAM"; in let pkg = stdenv.mkDerivation { @@ -17,21 +17,18 @@ in let owner = realname; repo = "${realname}-${major}"; rev = "${revision}"; - sha256 = "sha256-MZ29G5+49ZjE2hHC4uRF6PTR7cI5hrdjOn66lMnIgIw="; + sha256 = "sha256-AUApKWg9YZ0Nmz8+pOcgu6RBPfGHk0X49lERFEiV0ZM="; }; nativeBuildInputs = with pkgs; [bash m4 flex bison]; buildInputs = with pkgs; [fftw mpi scotch boost cgal zlib]; - patches = [ - ./0001-etc-bashrc-add-placeholder-for-FOAM_INST_DIR.patch - ]; - postPatch = '' substituteInPlace etc/bashrc \ - --replace 'export SCOTCH_TYPE=ThirdParty' 'export SCOTCH_TYPE=system' \ - --replace 'export ZOLTAN_TYPE=ThirdParty' 'export ZOLTAN_TYPE=none' + --replace '[ "$BASH" -o "$ZSH_NAME" ] && \' '#' \ + --replace 'export FOAM_INST_DIR=$(cd $(dirname ${"$"}{BASH_SOURCE:-$0})/../.. && pwd -P) || \' '#' \ + --replace 'export FOAM_INST_DIR=$HOME/$WM_PROJECT' '# __inst_dir_placeholder__' patchShebangs Allwmake patchShebangs etc