Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / op / openctm / package.nix
blob169e4469abcd8fa546a64c531663fb70f6f3ec37
2   lib,
3   stdenv,
4   fetchurl,
5   pkg-config,
6   libglut,
7   gtk2,
8   libGLU,
9 }:
11 stdenv.mkDerivation (finalAttrs: {
12   pname = "openctm";
13   version = "1.0.3";
15   src = fetchurl {
16     url = "https://downloads.sourceforge.net/project/openctm/OpenCTM-${finalAttrs.version}/OpenCTM-${finalAttrs.version}-src.tar.bz2";
17     hash = "sha256-So0mCNlzZPfuxWt8Y3xWuTCK6YKGs+kNu3QTyQ6UPx0=";
18   };
20   outputs = [
21     "bin"
22     "dev"
23     "man"
24     "out"
25   ];
27   nativeBuildInputs = [ pkg-config ];
29   buildInputs = [
30     libglut
31     gtk2
32     libGLU
33   ];
35   postPatch = ''
36     substituteInPlace tools/tinyxml/Makefile.linux \
37       --replace-warn "-Wno-format" "-Wno-format -Wno-format-security"
38     substituteInPlace tools/Makefile.linux \
39       --replace-warn "-lglut" "-lglut -lGL -lGLU"
40   '';
42   makeFlags = [
43     "BINDIR=$(bin)/bin/"
44     "INCDIR=$(dev)/include/"
45     "LIBDIR=$(out)/lib/"
46     "MAN1DIR=$(man)/share/man//man1"
47   ];
49   makefile = if stdenv.isDarwin then "Makefile.macosx" else "Makefile.linux";
51   preInstall = "mkdir -p $bin/bin $dev/include $out/lib $man/share/man/man1";
53   meta = with lib; {
54     description = "File format, software library and a tool set for compression of 3D triangle meshes";
55     homepage = "https://sourceforge.net/projects/openctm/";
56     license = licenses.zlib;
57     maintainers = with maintainers; [ nim65s ];
58   };