streamlink: 7.1.1 -> 7.1.2 (#373269)
[NixPkgs.git] / pkgs / by-name / op / openctm / package.nix
blobbb6bd763ea1ddfa29339831b641e06759a80315c
2   lib,
3   stdenv,
4   fetchurl,
5   pkg-config,
6   libglut,
7   gtk2,
8   libGLU,
9   darwin,
12 stdenv.mkDerivation (finalAttrs: {
13   pname = "openctm";
14   version = "1.0.3";
16   src = fetchurl {
17     url = "mirror://sourceforge/project/openctm/OpenCTM-${finalAttrs.version}/OpenCTM-${finalAttrs.version}-src.tar.bz2";
18     hash = "sha256-So0mCNlzZPfuxWt8Y3xWuTCK6YKGs+kNu3QTyQ6UPx0=";
19   };
21   outputs = [
22     "bin"
23     "dev"
24     "man"
25     "out"
26   ];
28   nativeBuildInputs = [ pkg-config ];
30   buildInputs =
31     [
32       libglut
33       libGLU
34     ]
35     ++ lib.optionals stdenv.hostPlatform.isLinux [ gtk2 ]
36     ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ];
38   postPatch =
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"
44     ''
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++"
53     '';
55   makeFlags = [
56     "BINDIR=$(bin)/bin/"
57     "INCDIR=$(dev)/include/"
58     "LIBDIR=$(out)/lib/"
59     "MAN1DIR=$(man)/share/man//man1"
60   ];
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";
66   meta = with lib; {
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 ];
71   };