about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorGuilhem Saurel <guilhem.saurel@laas.fr>2024-03-26 00:07:32 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2024-04-20 17:15:27 +0200
commitdf69ac58f030234a251edebe35efa625282a7dd0 (patch)
tree08bd6585e67cc33ad2708d992600b8845dc3c0dc /pkgs
parent835c1cbf108429ed017793ee6f76fed4e1cfbb1e (diff)
openctm: init at 1.0.3
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/op/openctm/package.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/by-name/op/openctm/package.nix b/pkgs/by-name/op/openctm/package.nix
new file mode 100644
index 0000000000000..e255e209111dd
--- /dev/null
+++ b/pkgs/by-name/op/openctm/package.nix
@@ -0,0 +1,59 @@
+{
+  lib,
+  stdenv,
+  fetchurl,
+  pkg-config,
+  freeglut,
+  gtk2,
+  libGLU,
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "openctm";
+  version = "1.0.3";
+
+  src = fetchurl {
+    url = "https://downloads.sourceforge.net/project/openctm/OpenCTM-${finalAttrs.version}/OpenCTM-${finalAttrs.version}-src.tar.bz2";
+    hash = "sha256-So0mCNlzZPfuxWt8Y3xWuTCK6YKGs+kNu3QTyQ6UPx0=";
+  };
+
+  outputs = [
+    "bin"
+    "dev"
+    "man"
+    "out"
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [
+    freeglut
+    gtk2
+    libGLU
+  ];
+
+  postPatch = ''
+    substituteInPlace tools/tinyxml/Makefile.linux \
+      --replace-warn "-Wno-format" "-Wno-format -Wno-format-security"
+    substituteInPlace tools/Makefile.linux \
+      --replace-warn "-lglut" "-lglut -lGL -lGLU"
+  '';
+
+  makeFlags = [
+    "BINDIR=$(bin)/bin/"
+    "INCDIR=$(dev)/include/"
+    "LIBDIR=$(out)/lib/"
+    "MAN1DIR=$(man)/share/man//man1"
+  ];
+
+  makefile = if stdenv.isDarwin then "Makefile.macosx" else "Makefile.linux";
+
+  preInstall = "mkdir -p $bin/bin $dev/include $out/lib $man/share/man/man1";
+
+  meta = with lib; {
+    description = "File format, software library and a tool set for compression of 3D triangle meshes";
+    homepage = "https://sourceforge.net/projects/openctm/";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ nim65s ];
+  };
+})