83627f9931
GitOrigin-RevId: 2893f56de08021cffd9b6b6dfc70fd9ccd51eb60
73 lines
1.7 KiB
Nix
73 lines
1.7 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, help2man
|
|
, gzip
|
|
, vtk_9
|
|
, autoPatchelfHook
|
|
, Cocoa
|
|
, OpenGL
|
|
, python3Packages
|
|
, withManual ? !stdenv.isDarwin
|
|
, withPythonBinding ? false
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "f3d";
|
|
version = "2.4.0";
|
|
|
|
outputs = [ "out" ] ++ lib.optionals withManual [ "man" ];
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "f3d-app";
|
|
repo = "f3d";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-mqkPegbGos38S50CoV4Qse9Z4wZ327UmIwmSrrP35uI=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
] ++ lib.optionals withManual [
|
|
# manpage
|
|
help2man
|
|
gzip
|
|
] ++ lib.optionals stdenv.hostPlatform.isElf [
|
|
# https://github.com/f3d-app/f3d/pull/1217
|
|
autoPatchelfHook
|
|
];
|
|
|
|
buildInputs = [
|
|
vtk_9
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
Cocoa
|
|
OpenGL
|
|
] ++ lib.optionals withPythonBinding [
|
|
python3Packages.python
|
|
# Using C++ header files, not Python import
|
|
python3Packages.pybind11
|
|
];
|
|
|
|
cmakeFlags = [
|
|
# conflict between VTK and Nixpkgs;
|
|
# see https://github.com/NixOS/nixpkgs/issues/89167
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
|
"-DF3D_MODULE_EXTERNAL_RENDERING=ON"
|
|
] ++ lib.optionals withManual [
|
|
"-DF3D_LINUX_GENERATE_MAN=ON"
|
|
] ++ lib.optionals withPythonBinding [
|
|
"-DF3D_BINDINGS_PYTHON=ON"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Fast and minimalist 3D viewer using VTK";
|
|
homepage = "https://f3d-app.github.io/f3d";
|
|
changelog = "https://github.com/f3d-app/f3d/releases/tag/v${version}";
|
|
license = licenses.bsd3;
|
|
maintainers = with maintainers; [ bcdarwin pbsds ];
|
|
platforms = with platforms; unix;
|
|
mainProgram = "f3d";
|
|
};
|
|
}
|