mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-09 18:47:02 +00:00
add Commander X16
This commit is contained in:
parent
0f1ba4a4ff
commit
e285d3b362
3 changed files with 74 additions and 0 deletions
20
pkgs/commander-x16/cc65.nix
Normal file
20
pkgs/commander-x16/cc65.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{ stdenv, fetchFromGitHub }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "cc65";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = name;
|
||||||
|
repo = name;
|
||||||
|
rev = "b525554bfee3c3ddc5ddd7e58b4a20728f6c9cb1";
|
||||||
|
sha256 = "0san7n092bx823pliypvvsbhhzq9q39n1qqivjcyc2xab2dwir84";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
make PREFIX="$out"
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
make install PREFIX="$out"
|
||||||
|
'';
|
||||||
|
}
|
9
pkgs/commander-x16/default.nix
Normal file
9
pkgs/commander-x16/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ callPackage, symlinkJoin }:
|
||||||
|
|
||||||
|
symlinkJoin {
|
||||||
|
name = "commander-x16-tools";
|
||||||
|
paths = [
|
||||||
|
(callPackage ./cc65.nix { })
|
||||||
|
(callPackage ./emulator.nix { })
|
||||||
|
];
|
||||||
|
}
|
45
pkgs/commander-x16/emulator.nix
Normal file
45
pkgs/commander-x16/emulator.nix
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
{ stdenv, callPackage, fetchFromGitHub, SDL2 }:
|
||||||
|
let
|
||||||
|
rev = "r38";
|
||||||
|
owner = "commanderx16";
|
||||||
|
cc65 = callPackage ./cc65.nix { };
|
||||||
|
|
||||||
|
x16rom = stdenv.mkDerivation rec {
|
||||||
|
name = "x16-rom";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
inherit owner rev;
|
||||||
|
repo = name;
|
||||||
|
sha256 = "10m6v0xpjkbrnjspsn7z0r22wphbvcrxw8f59z98xv21kb98ban5";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ cc65 ];
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
patchShebangs scripts
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
cp ./build/x16/rom.bin "$out"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "x16-emulator";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
inherit owner rev;
|
||||||
|
repo = name;
|
||||||
|
sha256 = "10cidc825bz3bniwascn472a9a8087f9lfl9b20r6dkvdzz6mm2q";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ SDL2.dev ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p "$out/bin"
|
||||||
|
cp x16emu "$out/"
|
||||||
|
ln -s "${x16rom}" "$out/rom.bin"
|
||||||
|
ln -s "$out/x16emu" "$out/bin/x16emu"
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue