2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromSourcehut
|
|
|
|
, SDL2
|
2023-08-04 22:07:22 +00:00
|
|
|
, unstableGitUpdater
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-09-18 10:52:07 +00:00
|
|
|
pname = "uxn";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "unstable-2023-07-30";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~rabbits";
|
2022-10-30 15:09:59 +00:00
|
|
|
repo = "uxn";
|
2023-08-04 22:07:22 +00:00
|
|
|
rev = "9ca8e9623d0ab1c299f08d3dd9d54098557f5749";
|
|
|
|
hash = "sha256-K51YiLnBwFWgD3h3l2BhsvzhnHHolZPsjjUWJSe4sPQ=";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's|UXNEMU_LDFLAGS="$(brew.*$|UXNEMU_LDFLAGS="$(sdl2-config --cflags --libs)"|' build.sh
|
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
./build.sh --no-run
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
install -d $out/bin/ $out/share/uxn/
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
cp bin/uxnasm bin/uxncli bin/uxnemu $out/bin/
|
|
|
|
cp -r projects $out/share/uxn/
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
passthru.updateScript = unstableGitUpdater { };
|
|
|
|
|
|
|
|
meta = {
|
2021-09-18 10:52:07 +00:00
|
|
|
homepage = "https://wiki.xxiivv.com/site/uxn.html";
|
|
|
|
description = "An assembler and emulator for the Uxn stack machine";
|
2023-08-04 22:07:22 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres kototama ];
|
|
|
|
inherit (SDL2.meta) platforms;
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
}
|