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-28 15:41:10 +00:00
|
|
|
version = "1.0-unstable-2024-02-15";
|
2021-08-27 04:31:00 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~rabbits";
|
2022-10-26 08:44:04 +00:00
|
|
|
repo = "uxn";
|
2024-02-18 18:10:06 +00:00
|
|
|
rev = "c37d2cd75c855d0932a93cd8fdadd1db00b05e48";
|
|
|
|
hash = "sha256-O8XN0+ixo2xMXtJkEoJAqrKZ1M4s4YoHSxKWGOUyl1k=";
|
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
|
|
|
})
|