Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
64 lines
1.4 KiB
Nix
64 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchurl,
|
|
cmake,
|
|
libGLU,
|
|
libGL,
|
|
libglut,
|
|
glew,
|
|
libXmu,
|
|
libXext,
|
|
libX11,
|
|
fixDarwinDylibNames,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "opencsg";
|
|
version = "1.8.1";
|
|
|
|
src = fetchurl {
|
|
url = "http://www.opencsg.org/OpenCSG-${finalAttrs.version}.tar.gz";
|
|
hash = "sha256-r8wASontO8R4qeS6ObIPPVibJOI+J1tzg/kaWQ1NV8U=";
|
|
};
|
|
|
|
patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./opencsgexample.patch ];
|
|
|
|
nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
|
|
|
|
buildInputs = [
|
|
glew
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
libGLU
|
|
libGL
|
|
libglut
|
|
libXmu
|
|
libXext
|
|
libX11
|
|
];
|
|
|
|
doCheck = false;
|
|
|
|
postInstall = ''
|
|
install -D ../copying.txt "$out/share/doc/opencsg/copying.txt"
|
|
'';
|
|
|
|
postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
app=$out/Applications/opencsgexample.app/Contents/MacOS/opencsgexample
|
|
install_name_tool -change \
|
|
$(otool -L $app | awk '/opencsg.+dylib/ { print $1 }') \
|
|
$(otool -D $out/lib/libopencsg.dylib | tail -n 1) \
|
|
$app
|
|
'';
|
|
|
|
meta = {
|
|
description = "Constructive Solid Geometry library";
|
|
mainProgram = "opencsgexample";
|
|
homepage = "http://www.opencsg.org/";
|
|
platforms = lib.platforms.unix;
|
|
maintainers = [ lib.maintainers.raskin ];
|
|
license = lib.licenses.gpl2Plus;
|
|
};
|
|
})
|