2020-12-31 07:48:55 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
pkg-config,
|
|
|
|
xorg,
|
|
|
|
libGLU,
|
2018-02-24 12:06:44 +00:00
|
|
|
libGL,
|
|
|
|
glew,
|
|
|
|
ocl-icd,
|
|
|
|
python3,
|
2023-11-27 14:39:48 +00:00
|
|
|
cudaSupport ? config.cudaSupport,
|
|
|
|
cudaPackages,
|
2022-04-05 16:26:32 +00:00
|
|
|
openclSupport ? !cudaSupport,
|
2017-11-13 22:14:46 +00:00
|
|
|
darwin,
|
2015-10-07 22:53:32 +00:00
|
|
|
}:
|
|
|
|
|
2017-10-16 00:34:16 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "opensubdiv";
|
2024-03-26 16:00:53 +00:00
|
|
|
version = "3.6.0";
|
2015-10-07 22:53:32 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PixarAnimationStudios";
|
|
|
|
repo = "OpenSubdiv";
|
2022-12-12 01:36:03 +00:00
|
|
|
rev = "v${lib.replaceStrings [ "." ] [ "_" ] version}";
|
2024-03-26 16:00:53 +00:00
|
|
|
sha256 = "sha256-liy6pQyWMk7rw0usrCoLGzZLO7RAg0z2pV/GF2NnOkE=";
|
2015-10-07 22:53:32 +00:00
|
|
|
};
|
|
|
|
|
2024-02-15 09:11:53 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
"static"
|
2023-11-27 14:39:48 +00:00
|
|
|
];
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2023-11-27 14:39:48 +00:00
|
|
|
nativeBuildInputs =
|
2024-12-10 19:26:33 +00:00
|
|
|
[
|
|
|
|
cmake
|
2023-11-27 14:39:48 +00:00
|
|
|
pkg-config
|
2024-12-10 19:26:33 +00:00
|
|
|
]
|
2023-12-08 17:55:49 +00:00
|
|
|
++ lib.optional cudaSupport [
|
2023-11-27 14:39:48 +00:00
|
|
|
cudaPackages.cuda_nvcc
|
2024-12-10 19:26:33 +00:00
|
|
|
];
|
2015-10-07 22:53:32 +00:00
|
|
|
buildInputs =
|
2020-12-31 07:48:55 +00:00
|
|
|
[
|
|
|
|
libGLU
|
|
|
|
libGL
|
|
|
|
python3
|
2015-10-07 22:53:32 +00:00
|
|
|
# FIXME: these are not actually needed, but the configure script wants them.
|
2017-02-28 14:16:01 +00:00
|
|
|
glew
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXxf86vm
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXinerama
|
|
|
|
xorg.libXi
|
2015-10-07 22:53:32 +00:00
|
|
|
]
|
2024-02-03 11:46:53 +00:00
|
|
|
++ lib.optionals (openclSupport && !stdenv.hostPlatform.isDarwin) [ ocl-icd ]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin (
|
|
|
|
with darwin.apple_sdk.frameworks;
|
|
|
|
[
|
|
|
|
OpenCL
|
|
|
|
Cocoa
|
|
|
|
CoreVideo
|
|
|
|
IOKit
|
|
|
|
AppKit
|
|
|
|
AGL
|
|
|
|
MetalKit
|
|
|
|
]
|
|
|
|
)
|
|
|
|
++ lib.optionals cudaSupport [
|
2023-11-27 14:39:48 +00:00
|
|
|
cudaPackages.cuda_cudart
|
|
|
|
];
|
|
|
|
|
|
|
|
# It's important to set OSD_CUDA_NVCC_FLAGS,
|
|
|
|
# because otherwise OSD might piggyback unwanted architectures:
|
|
|
|
# https://github.com/PixarAnimationStudios/OpenSubdiv/blob/7d0ab5530feef693ac0a920585b5c663b80773b3/CMakeLists.txt#L602
|
|
|
|
preConfigure = lib.optionalString cudaSupport ''
|
|
|
|
cmakeFlagsArray+=(
|
|
|
|
-DOSD_CUDA_NVCC_FLAGS="${lib.concatStringsSep " " cudaPackages.cudaFlags.gencode}"
|
|
|
|
)
|
|
|
|
'';
|
2015-10-07 22:53:32 +00:00
|
|
|
|
|
|
|
cmakeFlags =
|
|
|
|
[
|
|
|
|
"-DNO_TUTORIALS=1"
|
|
|
|
"-DNO_REGRESSION=1"
|
|
|
|
"-DNO_EXAMPLES=1"
|
2024-02-03 11:46:53 +00:00
|
|
|
(lib.cmakeBool "NO_METAL" (!stdenv.hostPlatform.isDarwin))
|
2023-11-27 14:39:48 +00:00
|
|
|
(lib.cmakeBool "NO_OPENCL" (!openclSupport))
|
|
|
|
(lib.cmakeBool "NO_CUDA" (!cudaSupport))
|
2017-11-13 22:14:46 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
|
2017-10-17 15:13:23 +00:00
|
|
|
"-DGLEW_INCLUDE_DIR=${glew.dev}/include"
|
|
|
|
"-DGLEW_LIBRARY=${glew.dev}/lib"
|
2018-02-25 17:06:29 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals cudaSupport [
|
2022-04-05 16:26:32 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals (!openclSupport) [
|
2018-02-25 17:06:29 +00:00
|
|
|
];
|
2015-10-07 22:53:32 +00:00
|
|
|
|
2023-08-16 22:40:22 +00:00
|
|
|
preBuild =
|
|
|
|
let
|
|
|
|
maxBuildCores = 16;
|
|
|
|
in
|
|
|
|
lib.optionalString cudaSupport ''
|
|
|
|
# https://github.com/PixarAnimationStudios/OpenSubdiv/issues/1313
|
|
|
|
NIX_BUILD_CORES=$(( NIX_BUILD_CORES < ${toString maxBuildCores} ? NIX_BUILD_CORES : ${toString maxBuildCores} ))
|
|
|
|
'';
|
|
|
|
|
2024-02-15 09:11:53 +00:00
|
|
|
postInstall = ''
|
|
|
|
moveToOutput "lib/*.a" $static
|
|
|
|
'';
|
2016-09-01 15:22:49 +00:00
|
|
|
|
2015-10-07 22:53:32 +00:00
|
|
|
meta = {
|
|
|
|
description = "Open-Source subdivision surface library";
|
2020-04-13 01:43:47 +00:00
|
|
|
homepage = "http://graphics.pixar.com/opensubdiv";
|
2022-04-05 16:26:32 +00:00
|
|
|
broken = openclSupport && cudaSupport;
|
2017-11-13 22:14:46 +00:00
|
|
|
platforms = lib.platforms.unix;
|
tree-wide: remove eelco as maintainer from things he no longer maintains
While preparing this change, I read the git blame on all of the files I
touched. I saw a working lifetime of building this system which we use
every day and love dearly and keep maintained ourselves. I saw commits
from a 14 year range between 2003 to 2017!! I could not be more thankful
for Eelco's work on building large parts of the foundation of nixpkgs
that all of us rely on now.
However, the end date of that range of the files I looked at the blame
on was 2017. I did not see surviving code from any newer date than that.
Looking at the Git logs, Eelco has been working on other things, and
that's totally fine.
However, it means that our maintenance metadata is out of date on a lot
of packages, and *that*'s the reason I am submitting this change. There
are a lot of packages that don't have anyone with their name on them to
be pinged if they need attention, even if they have had recent activity
(although it is never clear if recent activity was just someone fixing
it because ZHF or because the package actually matters to them).
There are a lot of packages with storied history that maybe don't need
to be in the set anymore at all since they have not been touched in
years; or maybe they are simply finished.
Empty maintainer lists should be a sign that we need to figure out who
maintains it or potentially remove it if it has rotted, and allowing the
maintainer list to be empty if it is already not maintained is part of a
healthy repository ecology.
Either way, I would like to have the maintenance metadata not mislead
anyone into sending Eelco emails about packages he doesn't, in practice,
work on anymore. I have not removed his name from everything; there are
some things that he is the upstream for or has worked on more recently,
for instance, like Nix, which I have left alone.
2024-08-21 08:07:42 +00:00
|
|
|
maintainers = [ ];
|
2015-10-07 22:53:32 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|