17 pname = "libfive-unstable";
18 version = "2022-05-19";
20 src = fetchFromGitHub {
23 rev = "d83cc22709ff1f7c478be07ff2419e30e024834e";
24 sha256 = "lNJg2LCpFcTewSA00s7omUtzhVxycAXvo6wEM/JjrN0=";
27 nativeBuildInputs = [ wrapQtAppsHook cmake ninja pkg-config ];
28 buildInputs = [ eigen zlib libpng boost guile_3_0 ];
31 substituteInPlace studio/src/guile/interpreter.cpp \
32 --replace "qputenv(\"GUILE_LOAD_COMPILED_PATH\", \"libfive/bind/guile\");" \
33 "qputenv(\"GUILE_LOAD_COMPILED_PATH\", \"libfive/bind/guile:$out/lib/guile/3.0/ccache\");"
35 substituteInPlace libfive/bind/guile/CMakeLists.txt \
36 --replace "LIBFIVE_FRAMEWORK_DIR=$<TARGET_FILE_DIR:libfive>" \
37 "LIBFIVE_FRAMEWORK_DIR=$out/lib" \
38 --replace "LIBFIVE_STDLIB_DIR=$<TARGET_FILE_DIR:libfive-stdlib>" \
39 "LIBFIVE_STDLIB_DIR=$out/lib"
41 export XDG_CACHE_HOME=$(mktemp -d)/.cache
45 "-DGUILE_CCACHE_DIR=${placeholder "out"}/lib/guile/3.0/ccache"
48 postInstall = if stdenv.isDarwin then ''
49 # No rules to install the mac app, so do it manually.
50 mkdir -p $out/Applications
51 cp -r studio/Studio.app $out/Applications/Studio.app
54 -change libfive.dylib $out/lib/libfive.dylib \
55 -change libfive-guile.dylib $out/lib/libfive-guile.dylib \
56 $out/Applications/Studio.app/Contents/MacOS/Studio
58 # Link "Studio" binary to "libfive-studio" to be more obvious:
59 ln -s "$out/bin/Studio" "$out/bin/libfive-studio"
63 description = "Infrastructure for solid modeling with F-Reps in C, C++, and Guile";
64 homepage = "https://libfive.com/";
65 maintainers = with maintainers; [ hodapp kovirobi ];
66 license = with licenses; [ mpl20 gpl2Plus ];
67 platforms = with platforms; linux ++ darwin;