Skip to content

Commit

Permalink
openctm: fix darwin support
Browse files Browse the repository at this point in the history
  • Loading branch information
yzx9 committed Oct 28, 2024
1 parent 44607a5 commit 6a7220c
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions pkgs/by-name/op/openctm/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,22 @@ stdenv.mkDerivation (finalAttrs: {
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"
'';
postPatch =
lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace "tools/tinyxml/Makefile.linux" \
--replace-warn "-Wno-format" "-Wno-format -Wno-format-security"
substituteInPlace "tools/Makefile.linux" \
--replace-warn "-lglut" "-lglut -lGL -lGLU"
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace "lib/Makefile.macosx" \
"tools/Makefile.macosx" \
"tools/jpeg/makefile.macosx" \
"tools/zlib/Makefile.macosx" \
--replace-warn "gcc" "${stdenv.cc.targetPrefix}cc"
substituteInPlace "lib/Makefile.macosx" "tools/Makefile.macosx" "tools/tinyxml/Makefile.macosx" \
--replace-warn "g++" "${stdenv.cc.targetPrefix}c++"
'';

makeFlags = [
"BINDIR=$(bin)/bin/"
Expand Down

0 comments on commit 6a7220c

Please sign in to comment.