12 stdenv.mkDerivation (finalAttrs: {
17 url = "mirror://sourceforge/project/openctm/OpenCTM-${finalAttrs.version}/OpenCTM-${finalAttrs.version}-src.tar.bz2";
18 hash = "sha256-So0mCNlzZPfuxWt8Y3xWuTCK6YKGs+kNu3QTyQ6UPx0=";
28 nativeBuildInputs = [ pkg-config ];
35 ++ lib.optionals stdenv.hostPlatform.isLinux [ gtk2 ]
36 ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ];
39 lib.optionalString stdenv.hostPlatform.isLinux ''
40 substituteInPlace "tools/tinyxml/Makefile.linux" \
41 --replace-warn "-Wno-format" "-Wno-format -Wno-format-security"
42 substituteInPlace "tools/Makefile.linux" \
43 --replace-warn "-lglut" "-lglut -lGL -lGLU"
45 + lib.optionalString stdenv.hostPlatform.isDarwin ''
46 substituteInPlace "lib/Makefile.macosx" \
47 "tools/Makefile.macosx" \
48 "tools/jpeg/makefile.macosx" \
49 "tools/zlib/Makefile.macosx" \
50 --replace-warn "gcc" "${stdenv.cc.targetPrefix}cc"
51 substituteInPlace "lib/Makefile.macosx" "tools/Makefile.macosx" "tools/tinyxml/Makefile.macosx" \
52 --replace-warn "g++" "${stdenv.cc.targetPrefix}c++"
57 "INCDIR=$(dev)/include/"
59 "MAN1DIR=$(man)/share/man//man1"
62 makefile = if stdenv.hostPlatform.isDarwin then "Makefile.macosx" else "Makefile.linux";
64 preInstall = "mkdir -p $bin/bin $dev/include $out/lib $man/share/man/man1";
67 description = "File format, software library and a tool set for compression of 3D triangle meshes";
68 homepage = "https://sourceforge.net/projects/openctm/";
69 license = licenses.zlib;
70 maintainers = with maintainers; [ nim65s ];