Make ryfs a proper derivation, patch it's shebangs

This commit is contained in:
xenia 2024-02-04 12:48:36 +01:00
parent 27acaa51f8
commit 1a89d1e48e

View File

@ -24,12 +24,24 @@
hash = "sha256-VQ/ABkiPMFZtA8XKLW2oQTihVkLmq5+gL8IVe5Kfv/I=";
};
ryfs = pkgs.fetchFromGitHub {
ryfs = pkgs.stdenv.mkDerivation {
name = "ryfs";
src = pkgs.fetchFromGitHub {
owner = "ry755";
repo = "ryfs";
rev = "e5034f4e11250a626388d7e9c1bcbf9af53f5702";
hash = "sha256-wA89XLHhinxpiaKzGKKqLuRQ6Q4x4uw/NwGK8Hs2+MQ=";
};
dontBuild = true;
nativeBuildInputs = [ pkgs.python311 ];
# Not sure why we need to run patchShebangs manually, from what I can see in the docs it should patch all output scripts automatically -xenia
installPhase = ''
mkdir -p $out/bin
cp ryfs.py $out/bin/ryfs.py
chmod u+x $out/bin/ryfs.py
patchShebangs --build $out/bin/ryfs.py
'';
};
fox32os = pkgs.stdenv.mkDerivation {
name = "fox32os";
@ -44,7 +56,7 @@
FOX32ASM = "${asm}/bin/fox32asm";
GFX2INC = "${gfx2inc}/bin/gfx2inc";
OKAMERON = "${okameron}/okameron.lua";
RYFS = "${ryfs}/ryfs.py";
RYFS = "${ryfs}/bin/ryfs.py";
installPhase = ''
mkdir -p "$out/bin"
@ -60,6 +72,7 @@
in rec {
packages.fox32os = fox32os;
packages.fox32os-dev = fox32os-dev;
packages.ryfs = ryfs;
packages.default = fox32os;
devShells.default = pkgs.mkShell {
@ -68,7 +81,7 @@
export FOX32ASM="${asm}/bin/fox32asm";
export GFX2INC="${gfx2inc}/bin/gfx2inc";
export OKAMERON="${okameron}/okameron.lua";
export RYFS="${ryfs}/ryfs.py";
export RYFS="${ryfs}/bin/ryfs.py";
mkdir -p ./fox32rom
cp ${rom-dev}/dev/fox32rom.def ./fox32rom/fox32rom.def