Skip to content

Instantly share code, notes, and snippets.

@jboynyc
Created May 27, 2024 21:36
Show Gist options
  • Save jboynyc/c4cbe8929fedb65748958e021141672e to your computer and use it in GitHub Desktop.
Save jboynyc/c4cbe8929fedb65748958e021141672e to your computer and use it in GitHub Desktop.
nix dev shell with raylib-guile
with import <nixpkgs> {};
let
raylib-version = "4.5.0";
raylib-api-xml = fetchurl {
url = "https://raw.githubusercontent.com/raysan5/raylib/${raylib-version}/parser/output/raylib_api.xml";
hash = "sha256-guPSduYmJ1ZUZO9B282I93RHFUhC2g0gZxy0j8RISTA=";
};
raylib-guile = stdenv.mkDerivation {
pname = "raylib-guile";
version = raylib-version;
src = fetchFromGitHub {
owner = "petelliott";
repo = "raylib-guile";
rev = "e6b2ac8a21ac83c426ece993daa90ac04a90d0c2";
hash = "sha256-rDCEGU+En/kQnhjJOUgfKTsckYymfggQx595zFkWm4Q=";
};
nativeBuildInputs = [
guile
pkg-config
];
propagatedBuildInputs = [
raylib
];
patchPhase = ''
patchShebangs generate-bindings.scm
'';
postConfigure = ''
cp ${raylib-api-xml} raylib_api.xml
'';
makeFlags = [
"GUILE_AUTO_COMPILE=0"
];
installPhase = ''
moddir=$out/share/guile/site/3.0
mkdir -p $moddir
install libraylib-guile.so $moddir
install raylib.scm $moddir
'';
};
in
mkShell {
packages = [
rlwrap
guile
raylib-guile
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment