Skip to content

Commit

Permalink
Support NixOS
Browse files Browse the repository at this point in the history
Signed-off-by: magic_rb <richard@brezak.sk>
  • Loading branch information
MagicRB committed Oct 9, 2023
1 parent b37fd84 commit 305c569
Showing 1 changed file with 34 additions and 15 deletions.
49 changes: 34 additions & 15 deletions h-raylib.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ flag platform-bsd
default: False
manual: True

flag platform-nixos
description: Use external GLFW
default: False
manual: True

flag mingw-cross
description:
Cross-compiling for mingw (used in combination with Windows)
Expand All @@ -85,6 +90,9 @@ common example-options
buildable: False

else
-- if (flag(platform-nixos))
extra-libraries:
raylib
build-depends:
, base
, h-raylib
Expand Down Expand Up @@ -227,22 +235,27 @@ library
extra-libraries:
GL
pthread

else

-- Unsupported OS, do nothing. If you can get it working on an
-- OS that isn't on here, please add it here.
c-sources:
lib/rl_bindings.c
lib/rl_internal.c
lib/rlgl_bindings.c
raylib/src/raudio.c
raylib/src/rcore.c
raylib/src/rmodels.c
raylib/src/rshapes.c
raylib/src/rtext.c
raylib/src/rtextures.c
raylib/src/utils.c
if (!flag(platform-nixos))
c-sources:
lib/rl_bindings.c
lib/rl_internal.c
lib/rlgl_bindings.c
raylib/src/raudio.c
raylib/src/rcore.c
raylib/src/rmodels.c
raylib/src/rshapes.c
raylib/src/rtext.c
raylib/src/rtextures.c
raylib/src/utils.c
elif (flag(platform-nixos))
c-sources:
lib/rl_bindings.c
lib/rl_internal.c
lib/rlgl_bindings.c

if (flag(platform-mac) || (flag(detect-platform) && os(osx)))
-- Use rgflw.m instead of .c on Mac to force objective-c
Expand All @@ -251,12 +264,18 @@ library
elif (flag(ghci) && (flag(platform-windows) || (flag(detect-platform) && os(windows))))
c-sources: lib/glfw_patch/rglfw_patch.c

elif (flag(platform-nixos))

else
c-sources: raylib/src/rglfw.c

if flag(ghci)
cpp-options: -DGHCI

include-dirs:
lib raylib/src raylib/src/external/glfw/src
raylib/src/external/glfw/include
if (flag(platform-nixos))
include-dirs:
lib
else
include-dirs:
lib raylib/src raylib/src/external/glfw/src
raylib/src/external/glfw/include

0 comments on commit 305c569

Please sign in to comment.