forked from mirrors/nixpkgs
raylib: support macOS
This commit is contained in:
parent
664ecf4f04
commit
3dd6060ab5
|
@ -1,13 +1,28 @@
|
||||||
{ stdenv, lib, fetchFromGitHub, cmake, fetchpatch
|
{ stdenv
|
||||||
, mesa, libGLU, glfw
|
, lib
|
||||||
, libX11, libXi, libXcursor, libXrandr, libXinerama
|
, fetchFromGitHub
|
||||||
, alsaSupport ? stdenv.hostPlatform.isLinux, alsa-lib
|
, cmake
|
||||||
, pulseSupport ? stdenv.hostPlatform.isLinux, libpulseaudio
|
, fetchpatch
|
||||||
|
, mesa
|
||||||
|
, libGLU
|
||||||
|
, glfw
|
||||||
|
, libX11
|
||||||
|
, libXi
|
||||||
|
, libXcursor
|
||||||
|
, libXrandr
|
||||||
|
, libXinerama
|
||||||
|
, alsaSupport ? stdenv.hostPlatform.isLinux
|
||||||
|
, alsa-lib
|
||||||
|
, pulseSupport ? stdenv.hostPlatform.isLinux
|
||||||
|
, libpulseaudio
|
||||||
, sharedLib ? true
|
, sharedLib ? true
|
||||||
, includeEverything ? true
|
, includeEverything ? true
|
||||||
, raylib-games
|
, raylib-games
|
||||||
|
, darwin
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
inherit (darwin.apple_sdk.frameworks) Carbon Cocoa OpenGL;
|
||||||
|
in
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "raylib";
|
pname = "raylib";
|
||||||
version = "4.5.0";
|
version = "4.5.0";
|
||||||
|
@ -21,11 +36,14 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [ glfw ]
|
||||||
mesa glfw libXi libXcursor libXrandr libXinerama
|
++ lib.optionals stdenv.isLinux [ mesa libXi libXcursor libXrandr libXinerama ]
|
||||||
] ++ lib.optional alsaSupport alsa-lib
|
++ lib.optionals stdenv.isDarwin [ Carbon Cocoa ]
|
||||||
|
++ lib.optional alsaSupport alsa-lib
|
||||||
++ lib.optional pulseSupport libpulseaudio;
|
++ lib.optional pulseSupport libpulseaudio;
|
||||||
propagatedBuildInputs = [ libGLU libX11 ];
|
|
||||||
|
propagatedBuildInputs = lib.optionals stdenv.isLinux [ libGLU libX11 ]
|
||||||
|
++ lib.optionals stdenv.isDarwin [ OpenGL ];
|
||||||
|
|
||||||
# https://github.com/raysan5/raylib/wiki/CMake-Build-Options
|
# https://github.com/raysan5/raylib/wiki/CMake-Build-Options
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
|
@ -33,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
"-DBUILD_EXAMPLES=OFF"
|
"-DBUILD_EXAMPLES=OFF"
|
||||||
"-DCUSTOMIZE_BUILD=1"
|
"-DCUSTOMIZE_BUILD=1"
|
||||||
] ++ lib.optional includeEverything "-DINCLUDE_EVERYTHING=ON"
|
] ++ lib.optional includeEverything "-DINCLUDE_EVERYTHING=ON"
|
||||||
++ lib.optional sharedLib "-DBUILD_SHARED_LIBS=ON";
|
++ lib.optional sharedLib "-DBUILD_SHARED_LIBS=ON";
|
||||||
|
|
||||||
passthru.tests = [ raylib-games ];
|
passthru.tests = [ raylib-games ];
|
||||||
|
|
||||||
|
@ -57,7 +75,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
homepage = "https://www.raylib.com/";
|
homepage = "https://www.raylib.com/";
|
||||||
license = licenses.zlib;
|
license = licenses.zlib;
|
||||||
maintainers = with maintainers; [ adamlwgriffiths ];
|
maintainers = with maintainers; [ adamlwgriffiths ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.all;
|
||||||
changelog = "https://github.com/raysan5/raylib/blob/${finalAttrs.version}/CHANGELOG";
|
changelog = "https://github.com/raysan5/raylib/blob/${finalAttrs.version}/CHANGELOG";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, raylib }:
|
{ lib, stdenv, fetchFromGitHub, raylib, darwin }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (darwin.apple_sdk.frameworks) Cocoa;
|
||||||
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "raylib-games";
|
pname = "raylib-games";
|
||||||
version = "2022-10-24";
|
version = "2022-10-24";
|
||||||
|
@ -11,7 +14,8 @@ stdenv.mkDerivation rec {
|
||||||
hash = "sha256-N9ip8yFUqXmNMKcvQuOyxDI4yF/w1YaoIh0prvS4Xr4=";
|
hash = "sha256-N9ip8yFUqXmNMKcvQuOyxDI4yF/w1YaoIh0prvS4Xr4=";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ raylib ];
|
buildInputs = [ raylib ]
|
||||||
|
++ lib.optionals stdenv.isDarwin [ Cocoa ];
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
|
|
Loading…
Reference in a new issue