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-04-01 20:33:53 +00:00
|
|
|
version = "unstable-2024-03-30";
|
2021-08-27 04:31:00 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~rabbits";
|
2022-10-26 08:44:04 +00:00
|
|
|
repo = "uxn";
|
2024-04-01 20:33:53 +00:00
|
|
|
rev = "fc6ec0b387723940868133fade8854ad37648881";
|
|
|
|
hash = "sha256-Ver8oI3IzxwF6KeZ85d3mmiCwARVoH+RZoFNCxhGFDc=";
|
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;
|
2024-02-26 18:23:51 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2021-08-27 04:31:00 +00:00
|
|
|
};
|
2023-08-13 02:24:28 +00:00
|
|
|
})
|