Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raylib: init at 3.5.0 #98030

Merged
merged 2 commits into from Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Expand Up @@ -182,6 +182,12 @@
githubId = 124545;
name = "Anthony Cowley";
};
adamlwgriffiths = {
email = "adam.lw.griffiths@gmail.com";
github = "adamlwgriffiths";
githubId = 1239156;
name = "Adam Griffiths";
};
adamt = {
email = "mail@adamtulinius.dk";
github = "adamtulinius";
Expand Down
54 changes: 54 additions & 0 deletions pkgs/development/libraries/raylib/default.nix
@@ -0,0 +1,54 @@
{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake,
mesa, libGLU, glfw,
libX11, libXi, libXcursor, libXrandr, libXinerama,
alsaSupport ? stdenv.hostPlatform.isLinux, alsaLib,
pulseSupport ? stdenv.hostPlatform.isLinux, libpulseaudio,
includeEverything ? true
}:

stdenv.mkDerivation rec {
pname = "raylib";
version = "3.5.0";

src = fetchFromGitHub {
owner = "raysan5";
repo = pname;
rev = version;
sha256 = "0syvd5js1lbx3g4cddwwncqg95l6hb3fdz5nsh5pqy7fr6v84kwj";
};

patches = [
# fixes examples not compiling in 3.5.0
(fetchpatch {
url = "https://patch-diff.githubusercontent.com/raw/raysan5/raylib/pull/1470.patch";
sha256 = "1ff5l839wl8dxwrs2bwky7kqa8kk9qmsflg31sk5vbil68dzbzg0";
})
];

nativeBuildInputs = [ cmake ];
buildInputs = [
mesa libGLU glfw libX11 libXi libXcursor libXrandr libXinerama
] ++ lib.optional alsaSupport alsaLib
++ lib.optional pulseSupport libpulseaudio;

# https://github.com/raysan5/raylib/wiki/CMake-Build-Options
cmakeFlags = [
"-DUSE_EXTERNAL_GLFW=ON"
"-DSHARED=ON"
"-DBUILD_EXAMPLES=OFF"
adamlwgriffiths marked this conversation as resolved.
Show resolved Hide resolved
] ++ lib.optional includeEverything "-DINCLUDE_EVERYTHING=ON";
adamlwgriffiths marked this conversation as resolved.
Show resolved Hide resolved

# fix libasound.so/libpulse.so not being found
preFixup = ''
${lib.optionalString alsaSupport "patchelf --add-needed ${alsaLib}/lib/libasound.so $out/lib/libraylib.so.${version}"}
${lib.optionalString pulseSupport "patchelf --add-needed ${libpulseaudio}/lib/libpulse.so $out/lib/libraylib.so.${version}"}
'';

meta = with lib; {
description = "A simple and easy-to-use library to enjoy videogames programming";
homepage = "http://www.raylib.com/";
license = licenses.zlib;
maintainers = with maintainers; [ adamlwgriffiths ];
platforms = platforms.linux;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -16337,6 +16337,8 @@ in

raul = callPackage ../development/libraries/audio/raul { };

raylib = callPackage ../development/libraries/raylib { };

readline = readline6;
readline6 = readline63;

Expand Down