2021-08-27 04:31:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromSourcehut
|
|
|
|
, SDL2
|
2023-07-29 11:48:01 +00:00
|
|
|
, unstableGitUpdater
|
2021-08-27 04:31:00 +00:00
|
|
|
}:
|
|
|
|
|
2023-08-13 02:24:28 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-08-27 04:31:00 +00:00
|
|
|
pname = "uxn";
|
2024-02-15 11:39:53 +00:00
|
|
|
version = "unstable-2024-02-14";
|
2021-08-27 04:31:00 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~rabbits";
|
2022-10-26 08:44:04 +00:00
|
|
|
repo = "uxn";
|
2024-02-15 11:39:53 +00:00
|
|
|
rev = "8abb621b12df11f7975ad1485d556ebb8bcb2042";
|
|
|
|
hash = "sha256-R36qrnNpR7cNosPnWxMr5/RMwA3ge/GvYPNCzcOziYk=";
|
2021-08-27 04:31:00 +00:00
|
|
|
};
|
|
|
|
|
2023-08-13 02:24:28 +00:00
|
|
|
outputs = [ "out" "projects" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
SDL2
|
|
|
|
];
|
|
|
|
|
2021-08-27 04:31:00 +00:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
];
|
|
|
|
|
2023-08-13 02:24:28 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-10-26 08:44:04 +00:00
|
|
|
postPatch = ''
|
2023-08-13 02:24:28 +00:00
|
|
|
patchShebangs build.sh
|
|
|
|
substituteInPlace build.sh \
|
2023-11-03 22:40:14 +00:00
|
|
|
--replace "-L/usr/local/lib " ""
|
2022-10-26 08:44:04 +00:00
|
|
|
'';
|
|
|
|
|
2021-08-27 04:31:00 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
2022-10-26 08:44:04 +00:00
|
|
|
./build.sh --no-run
|
2021-08-27 04:31:00 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
2023-08-13 02:24:28 +00:00
|
|
|
# ./build.sh --install is meant to install in $HOME, therefore not useful for
|
|
|
|
# package maintainers
|
2021-08-27 04:31:00 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2023-08-13 02:24:28 +00:00
|
|
|
install -d $out/bin/
|
2022-10-26 08:44:04 +00:00
|
|
|
cp bin/uxnasm bin/uxncli bin/uxnemu $out/bin/
|
2023-08-13 02:24:28 +00:00
|
|
|
install -d $projects/share/uxn/
|
|
|
|
cp -r projects $projects/share/uxn/
|
2021-08-27 04:31:00 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-07-29 11:48:01 +00:00
|
|
|
passthru.updateScript = unstableGitUpdater { };
|
|
|
|
|
|
|
|
meta = {
|
2021-08-27 04:31:00 +00:00
|
|
|
homepage = "https://wiki.xxiivv.com/site/uxn.html";
|
|
|
|
description = "An assembler and emulator for the Uxn stack machine";
|
2023-07-29 11:48:01 +00:00
|
|
|
license = lib.licenses.mit;
|
2023-08-13 02:24:28 +00:00
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
mainProgram = "uxnemu";
|
2023-07-29 11:48:01 +00:00
|
|
|
inherit (SDL2.meta) platforms;
|
2021-08-27 04:31:00 +00:00
|
|
|
};
|
2023-08-13 02:24:28 +00:00
|
|
|
})
|