2022-09-09 14:08:57 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, fetchpatch
|
|
|
|
, mesa, libGLU, glfw
|
|
|
|
, libX11, libXi, libXcursor, libXrandr, libXinerama
|
|
|
|
, alsaSupport ? stdenv.hostPlatform.isLinux, alsa-lib
|
|
|
|
, pulseSupport ? stdenv.hostPlatform.isLinux, libpulseaudio
|
|
|
|
, sharedLib ? true
|
|
|
|
, includeEverything ? true
|
2022-11-02 22:02:43 +00:00
|
|
|
, raylib-games
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-03-09 03:18:52 +00:00
|
|
|
pname = "raylib";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "4.5.0";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "raysan5";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = "raylib";
|
|
|
|
rev = finalAttrs.version;
|
|
|
|
hash = "sha256-Uqqzq5shDp0AgSBT5waHBNUkEu0LRj70SNOlR5R2yAM=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2022-11-02 22:02:43 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
buildInputs = [
|
2022-11-02 22:02:43 +00:00
|
|
|
mesa glfw libXi libXcursor libXrandr libXinerama
|
2021-06-28 23:13:55 +00:00
|
|
|
] ++ lib.optional alsaSupport alsa-lib
|
2021-03-09 03:18:52 +00:00
|
|
|
++ lib.optional pulseSupport libpulseaudio;
|
2022-11-02 22:02:43 +00:00
|
|
|
propagatedBuildInputs = [ libGLU libX11 ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
# https://github.com/raysan5/raylib/wiki/CMake-Build-Options
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_EXTERNAL_GLFW=ON"
|
|
|
|
"-DBUILD_EXAMPLES=OFF"
|
2022-09-09 14:08:57 +00:00
|
|
|
"-DCUSTOMIZE_BUILD=1"
|
2021-06-04 09:07:49 +00:00
|
|
|
] ++ lib.optional includeEverything "-DINCLUDE_EVERYTHING=ON"
|
|
|
|
++ lib.optional sharedLib "-DBUILD_SHARED_LIBS=ON";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
passthru.tests = [ raylib-games ];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A simple and easy-to-use library to enjoy videogames programming";
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "https://www.raylib.com/";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.zlib;
|
|
|
|
maintainers = with maintainers; [ adamlwgriffiths ];
|
|
|
|
platforms = platforms.linux;
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/raysan5/raylib/blob/${finalAttrs.version}/CHANGELOG";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|