From 893a4feeb5749f2072a6ec58ccfe722cd49f7458 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 11 Jun 2024 09:33:07 +0200 Subject: [PATCH] dune3d: fix darwin build --- pkgs/by-name/du/dune3d/package.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/du/dune3d/package.nix b/pkgs/by-name/du/dune3d/package.nix index e3784975ddf5..122a9691c53b 100644 --- a/pkgs/by-name/du/dune3d/package.nix +++ b/pkgs/by-name/du/dune3d/package.nix @@ -1,5 +1,6 @@ { cmake, + desktopToDarwinBundle, eigen, fetchFromGitHub, glm, @@ -7,19 +8,26 @@ gtkmm4, lib, libepoxy, + libossp_uuid, librsvg, libspnav, libuuid, + libxml2, + llvmPackages_17, meson, ninja, - opencascade-occt, + opencascade-occt_7_6, pkg-config, python3, stdenv, wrapGAppsHook3, }: -stdenv.mkDerivation (finalAttrs: { +let + stdenv' = if stdenv.isDarwin then llvmPackages_17.stdenv else stdenv; + opencascade-occt = opencascade-occt_7_6; +in +stdenv'.mkDerivation (finalAttrs: { pname = "dune3d"; version = "1.1.0"; @@ -36,7 +44,9 @@ stdenv.mkDerivation (finalAttrs: { ninja pkg-config wrapGAppsHook3 - ]; + libxml2 # for xmllints + ] ++ lib.optional stdenv.isDarwin desktopToDarwinBundle; + buildInputs = [ cmake eigen @@ -45,7 +55,7 @@ stdenv.mkDerivation (finalAttrs: { libepoxy librsvg libspnav - libuuid + (if stdenv.isLinux then libuuid else libossp_uuid) opencascade-occt (python3.withPackages (pp: [ pp.pygobject3 @@ -60,6 +70,6 @@ stdenv.mkDerivation (finalAttrs: { license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ _0x4A6F jue89 ]; mainProgram = "dune3d"; - platforms = lib.platforms.linux; + platforms = lib.platforms.linux ++ lib.platforms.darwin; }; })