Skip to content

Commit

Permalink
{febio, febio-studio}: darwin sdk refactor; fix qt 6.8 build (NixOS#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman authored Nov 20, 2024
2 parents 4ba8b30 + 2e61f32 commit 5261c3c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
32 changes: 17 additions & 15 deletions pkgs/by-name/fe/febio-studio/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
lib,
stdenv,
overrideSDK,
fetchFromGitHub,
cmake,
ninja,
Expand All @@ -10,6 +9,9 @@
qt6Packages,
febio,
glew,
apple-sdk_11,
darwinMinVersionHook,
fetchpatch,
sshSupport ? true,
openssl,
libssh,
Expand All @@ -23,18 +25,7 @@
withCadFeatures ? false,
}:

let
stdenv' =
if stdenv.hostPlatform.isDarwin then
overrideSDK stdenv {
darwinSdkVersion = "11.0";
darwinMinVersion = "10.15";
}
else
stdenv;
in

stdenv'.mkDerivation (finalAttrs: {
stdenv.mkDerivation (finalAttrs: {
pname = "febio-studio";
version = "2.7";

Expand All @@ -45,7 +36,14 @@ stdenv'.mkDerivation (finalAttrs: {
hash = "sha256-ggIzz6bvNjqlI8s31EVnbM0TOspBSc9/myKpWukS3MU=";
};

patches = [ ./cmake-install.patch ];
patches = [
./cmake-install.patch
# Fix qt 6.8 compile, can be removed after next release
(fetchpatch {
url = "https://github.com/febiosoftware/FEBioStudio/commit/15524d958a6f5ef81ccee58b4efa1ea25de91543.patch";
hash = "sha256-LRToK1/RQC+bLXgroDTQOV6H8pI+IZ38Y0nsl/Fz1WE=";
})
];

cmakeFlags =
[ (lib.cmakeFeature "Qt_Root" "${qt6Packages.qtbase}") ]
Expand Down Expand Up @@ -76,7 +74,11 @@ stdenv'.mkDerivation (finalAttrs: {
]
++ lib.optional tetgenSupport tetgen
++ lib.optional ffmpegSupport ffmpeg
++ lib.optional dicomSupport dcmtk;
++ lib.optional dicomSupport dcmtk
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_11
(darwinMinVersionHook "10.15")
];

meta = {
description = "FEBio Suite Solver";
Expand Down
15 changes: 5 additions & 10 deletions pkgs/by-name/fe/febio/package.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
{
lib,
stdenv,
overrideSDK,
fetchFromGitHub,
fetchpatch2,
substituteAll,
apple-sdk_11,
cmake,
darwinMinVersionHook,
ninja,
zlib,
darwin,
mklSupport ? true,
mkl,
}:

let
stdenv' = if stdenv.hostPlatform.isDarwin then overrideSDK stdenv "11.0" else stdenv;
in

stdenv'.mkDerivation (finalAttrs: {
stdenv.mkDerivation (finalAttrs: {
pname = "FEBio";
version = "4.7";

Expand Down Expand Up @@ -57,9 +53,8 @@ stdenv'.mkDerivation (finalAttrs: {
[ zlib ]
++ lib.optionals mklSupport [ mkl ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.CoreGraphics
darwin.apple_sdk.frameworks.CoreVideo
darwin.apple_sdk.frameworks.Accelerate
apple-sdk_11
(darwinMinVersionHook "10.15")
];

meta = {
Expand Down

0 comments on commit 5261c3c

Please sign in to comment.