From 1a89d1e48e22fa95d85c6575853b4f88f64e26aa Mon Sep 17 00:00:00 2001 From: xenia Date: Sun, 4 Feb 2024 12:48:36 +0100 Subject: [PATCH] Make ryfs a proper derivation, patch it's shebangs --- flake.nix | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 176fb99..2169e52 100644 --- a/flake.nix +++ b/flake.nix @@ -24,11 +24,23 @@ hash = "sha256-VQ/ABkiPMFZtA8XKLW2oQTihVkLmq5+gL8IVe5Kfv/I="; }; - ryfs = pkgs.fetchFromGitHub { - owner = "ry755"; - repo = "ryfs"; - rev = "e5034f4e11250a626388d7e9c1bcbf9af53f5702"; - hash = "sha256-wA89XLHhinxpiaKzGKKqLuRQ6Q4x4uw/NwGK8Hs2+MQ="; + 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 { @@ -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