2024-02-07 01:22:34 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, help2man
|
|
|
|
, gzip
|
|
|
|
, vtk_9
|
|
|
|
, autoPatchelfHook
|
|
|
|
, libX11
|
|
|
|
, libGL
|
|
|
|
, Cocoa
|
|
|
|
, OpenGL
|
2024-06-05 15:53:02 +00:00
|
|
|
, withManual ? !stdenv.isDarwin
|
2024-02-07 01:22:34 +00:00
|
|
|
}:
|
2020-10-11 12:50:04 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "f3d";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.4.0";
|
2024-02-07 01:22:34 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
outputs = [ "out" ] ++ lib.optionals withManual [ "man" ];
|
2020-10-11 12:50:04 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "f3d-app";
|
2020-10-11 12:50:04 +00:00
|
|
|
repo = "f3d";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-mqkPegbGos38S50CoV4Qse9Z4wZ327UmIwmSrrP35uI=";
|
2020-10-11 12:50:04 +00:00
|
|
|
};
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals withManual [
|
|
|
|
# manpage
|
2024-02-07 01:22:34 +00:00
|
|
|
help2man
|
|
|
|
gzip
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isElf [
|
2024-02-07 01:22:34 +00:00
|
|
|
# https://github.com/f3d-app/f3d/pull/1217
|
|
|
|
autoPatchelfHook
|
|
|
|
];
|
2020-10-11 12:50:04 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
buildInputs = [ vtk_9 ] ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
|
2020-10-11 12:50:04 +00:00
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
cmakeFlags = [
|
2024-02-07 01:22:34 +00:00
|
|
|
# conflict between VTK and Nixpkgs;
|
|
|
|
# see https://github.com/NixOS/nixpkgs/issues/89167
|
2022-09-14 18:05:37 +00:00
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
|
|
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals withManual [
|
2024-02-07 01:22:34 +00:00
|
|
|
"-DF3D_LINUX_GENERATE_MAN=ON"
|
2022-09-14 18:05:37 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-11 12:50:04 +00:00
|
|
|
description = "Fast and minimalist 3D viewer using VTK";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://f3d-app.github.io/f3d";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/f3d-app/f3d/releases/tag/v${version}";
|
2020-10-11 12:50:04 +00:00
|
|
|
license = licenses.bsd3;
|
2024-02-07 01:22:34 +00:00
|
|
|
maintainers = with maintainers; [ bcdarwin pbsds ];
|
2020-10-11 12:50:04 +00:00
|
|
|
platforms = with platforms; unix;
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "f3d";
|
2020-10-11 12:50:04 +00:00
|
|
|
};
|
|
|
|
}
|