Compare commits

...

1 commit

2 changed files with 7 additions and 44 deletions

View file

@ -1,34 +0,0 @@
From 8043842ab7feceae999addf2725d44ab0f65071a Mon Sep 17 00:00:00 2001
From: Sebastian Woetzel <wose@zuendmasse.de>
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

View file

@ -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