mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 03:30:45 +00:00
openctm: fix darwin support (#351642)
This commit is contained in:
commit
d0ba2f90d9
|
@ -6,6 +6,7 @@
|
|||
libglut,
|
||||
gtk2,
|
||||
libGLU,
|
||||
darwin,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
|
@ -26,18 +27,30 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
buildInputs = [
|
||||
libglut
|
||||
gtk2
|
||||
libGLU
|
||||
];
|
||||
buildInputs =
|
||||
[
|
||||
libglut
|
||||
libGLU
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isLinux [ gtk2 ]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ];
|
||||
|
||||
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/"
|
||||
|
|
Loading…
Reference in a new issue