Skip to content

Commit

Permalink
Merge pull request #26 from MagicRB/support-nixos
Browse files Browse the repository at this point in the history
Support NixOS
  • Loading branch information
Anut-py committed Oct 18, 2023
2 parents 0dc2f41 + 9693e30 commit fbf4d11
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 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: Build for Nix (use external GLFW)
default: False
manual: True

flag mingw-cross
description:
Cross-compiling for mingw (used in combination with Windows)
Expand Down Expand Up @@ -228,6 +233,10 @@ library
GL
pthread

elif (flag(platform-nixos))
pkgconfig-depends:
raylib

else

-- Unsupported OS, do nothing. If you can get it working on an
Expand All @@ -236,13 +245,16 @@ library
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:
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-mac) || (flag(detect-platform) && os(osx)))
-- Use rgflw.m instead of .c on Mac to force objective-c
Expand All @@ -251,12 +263,16 @@ library
elif (flag(ghci) && (flag(platform-windows) || (flag(detect-platform) && os(windows))))
c-sources: lib/glfw_patch/rglfw_patch.c

else
elif (!flag(platform-nixos))
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
lib

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

0 comments on commit fbf4d11

Please sign in to comment.