about summary refs log tree commit diff
path: root/pkgs/applications/emulators
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2023-08-12 23:24:28 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-08-14 01:49:43 +0000
commit6ec3610cd8926d89c42ce657c00425e5872d8855 (patch)
tree6893ae158fb30937cb91b08968e0a0b7e31cee5d /pkgs/applications/emulators
parentdbc8e3a3cfb7cd9a2b5e9df782043ac1a8f6a37f (diff)
uxn: refactor
- use finalAttrs pattern
- split projects into its own output
- set strictDeps to true
- set meta.mainProgram to uxnemu
Diffstat (limited to 'pkgs/applications/emulators')
-rw-r--r--pkgs/applications/emulators/uxn/default.nix28
1 files changed, 21 insertions, 7 deletions
diff --git a/pkgs/applications/emulators/uxn/default.nix b/pkgs/applications/emulators/uxn/default.nix
index 85a3a541f963f..66df76e1bac04 100644
--- a/pkgs/applications/emulators/uxn/default.nix
+++ b/pkgs/applications/emulators/uxn/default.nix
@@ -5,7 +5,7 @@
 , unstableGitUpdater
 }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation (finalAttrs: {
   pname = "uxn";
   version = "unstable-2023-08-10";
 
@@ -16,12 +16,23 @@ stdenv.mkDerivation {
     hash = "sha256-3Q8460pkoATKCEqfa+OfpQ4Lp18Ro5i84s88pkz+uzU=";
   };
 
+  outputs = [ "out" "projects" ];
+
+  nativeBuildInputs = [
+    SDL2
+  ];
+
   buildInputs = [
     SDL2
   ];
 
+  strictDeps = true;
+
   postPatch = ''
-     sed -i -e 's|UXNEMU_LDFLAGS="$(brew.*$|UXNEMU_LDFLAGS="$(sdl2-config --cflags --libs)"|' build.sh
+    patchShebangs build.sh
+    substituteInPlace build.sh \
+      --replace "-L/usr/local/lib " "" \
+      --replace "\$(brew --prefix)/lib/libSDL2.a " ""
   '';
 
   buildPhase = ''
@@ -32,13 +43,15 @@ stdenv.mkDerivation {
     runHook postBuild
   '';
 
+  # ./build.sh --install is meant to install in $HOME, therefore not useful for
+  # package maintainers
   installPhase = ''
     runHook preInstall
 
-    install -d $out/bin/ $out/share/uxn/
-
+    install -d $out/bin/
     cp bin/uxnasm bin/uxncli bin/uxnemu $out/bin/
-    cp -r projects $out/share/uxn/
+    install -d $projects/share/uxn/
+    cp -r projects $projects/share/uxn/
 
     runHook postInstall
   '';
@@ -49,7 +62,8 @@ stdenv.mkDerivation {
     homepage = "https://wiki.xxiivv.com/site/uxn.html";
     description = "An assembler and emulator for the Uxn stack machine";
     license = lib.licenses.mit;
-    maintainers = with lib.maintainers; [ AndersonTorres kototama ];
+    maintainers = with lib.maintainers; [ AndersonTorres ];
+    mainProgram = "uxnemu";
     inherit (SDL2.meta) platforms;
   };
-}
+})