about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libfive/default.nix
blob: 3833a7fe880a7f35271f726a3b359c6adc29ca59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ lib
, mkDerivation
, wrapQtAppsHook
, fetchFromGitHub
, cmake
, ninja
, pkg-config
, eigen
, zlib
, libpng
, boost
, guile
, stdenv
}:

mkDerivation {
  pname = "libfive-unstable";
  version = "2020-02-15";

  src = fetchFromGitHub {
    owner = "libfive";
    repo = "libfive";
    rev = "5b7717a25064478cd6bdb190683566eaf4c7afdd";
    sha256 = "102zw2n3vzv84i323is4qrwwqqha8v1cniw54ss8f4bq6dmic0bg";
  };

  nativeBuildInputs = [ wrapQtAppsHook cmake ninja pkg-config ];
  buildInputs = [ eigen zlib libpng boost guile ];

  postInstall = if stdenv.isDarwin then ''
    # No rules to install the mac app, so do it manually.
    mkdir -p $out/Applications
    cp -r studio/Studio.app $out/Applications/Studio.app

    install_name_tool \
      -change libfive.dylib $out/lib/libfive.dylib \
      -change libfive-guile.dylib $out/lib/libfive-guile.dylib \
      $out/Applications/Studio.app/Contents/MacOS/Studio

    wrapQtApp $out/Applications/Studio.app/Contents/MacOS/Studio
  '' else ''
    # Link "Studio" binary to "libfive-studio" to be more obvious:
    ln -s "$out/bin/Studio" "$out/bin/libfive-studio"
  '';

  meta = with lib; {
    description = "Infrastructure for solid modeling with F-Reps in C, C++, and Guile";
    homepage = "https://libfive.com/";
    maintainers = with maintainers; [ hodapp kovirobi ];
    license = with licenses; [ mpl20 gpl2Plus ];
    platforms = with platforms; linux ++ darwin;
  };
}