From 4d643055abc061e6f6b8f85ac3e8b020cc863296 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 20 Jan 2024 22:22:06 -0300 Subject: [PATCH 1/3] mgba: refactor - split outputs - strictDeps - get rid of nested with - meta.changelog --- pkgs/applications/emulators/mgba/default.nix | 32 ++++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/emulators/mgba/default.nix b/pkgs/applications/emulators/mgba/default.nix index a52ee7ca30ce..47b2c17819a0 100644 --- a/pkgs/applications/emulators/mgba/default.nix +++ b/pkgs/applications/emulators/mgba/default.nix @@ -1,17 +1,17 @@ { lib -, stdenv -, fetchFromGitHub , SDL2 , cmake +, fetchFromGitHub , ffmpeg , libedit , libelf , libepoxy +, libsForQt5 , libzip , lua5_4 , minizip , pkg-config -, libsForQt5 +, stdenv , wrapGAppsHook }: @@ -34,18 +34,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-+AwIYhnqp984Banwb7zmB5yzenExfLLU1oGJSxeTl/M="; }; + outputs = [ "out" "dev" "doc" "lib" "man" ]; + nativeBuildInputs = [ + SDL2 cmake pkg-config wrapGAppsHook wrapQtAppsHook ]; - dontWrapGApps = true; - preFixup = '' - qtWrapperArgs+=("''${gappsWrapperArgs[@]}") - ''; - buildInputs = [ SDL2 ffmpeg @@ -60,7 +58,15 @@ stdenv.mkDerivation (finalAttrs: { qttools ]; - meta = with lib; { + strictDeps = true; + + dontWrapGApps = true; + + preFixup = '' + qtWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + + meta = { homepage = "https://mgba.io"; description = "A modern GBA emulator with a focus on accuracy"; longDescription = '' @@ -77,10 +83,10 @@ stdenv.mkDerivation (finalAttrs: { runners, and a modern feature set for emulators that older emulators may not support. ''; - changelog = "https://github.com/mgba-emu/mgba/blob/${finalAttrs.version}/CHANGES"; - license = licenses.mpl20; - maintainers = with maintainers; [ MP2E AndersonTorres ]; - platforms = platforms.linux; + changelog = "https://raw.githubusercontent.com/mgba-emu/mgba/${finalAttrs.src.rev}/CHANGES"; + license = with lib.licenses; [ mpl20 ]; mainProgram = "mgba"; + maintainers = with lib.maintainers; [ MP2E AndersonTorres ]; + platforms = lib.platforms.linux; }; }) From 4c1a14fe5c58ab4fe7e9b957a1ea2b4f670d2ece Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 20 Jan 2024 22:49:51 -0300 Subject: [PATCH 2/3] mgba: 0.10.2 -> 0.10.3 Including-but-disabling discord-rpc, because the upstream includes it however it doesn't work. --- pkgs/applications/emulators/mgba/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/emulators/mgba/default.nix b/pkgs/applications/emulators/mgba/default.nix index 47b2c17819a0..93ee78a70c8c 100644 --- a/pkgs/applications/emulators/mgba/default.nix +++ b/pkgs/applications/emulators/mgba/default.nix @@ -3,6 +3,7 @@ , cmake , fetchFromGitHub , ffmpeg +, discord-rpc , libedit , libelf , libepoxy @@ -13,6 +14,7 @@ , pkg-config , stdenv , wrapGAppsHook +, enableDiscordRpc ? false }: let @@ -25,13 +27,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "mgba"; - version = "0.10.2"; + version = "0.10.3"; src = fetchFromGitHub { owner = "mgba-emu"; repo = "mgba"; rev = finalAttrs.version; - hash = "sha256-+AwIYhnqp984Banwb7zmB5yzenExfLLU1oGJSxeTl/M="; + hash = "sha256-wSt3kyjRxKBnDOVY10jq4cpv7uIaBUIcsZr6aU7XnMA="; }; outputs = [ "out" "dev" "doc" "lib" "man" ]; @@ -56,6 +58,11 @@ stdenv.mkDerivation (finalAttrs: { qtbase qtmultimedia qttools + ] + ++ lib.optionals enableDiscordRpc [ discord-rpc ]; + + cmakeFlags = [ + (lib.cmakeBool "USE_DISCORD_RPC" enableDiscordRpc) ]; strictDeps = true; @@ -88,5 +95,6 @@ stdenv.mkDerivation (finalAttrs: { mainProgram = "mgba"; maintainers = with lib.maintainers; [ MP2E AndersonTorres ]; platforms = lib.platforms.linux; + broken = enableDiscordRpc; # Some obscure `ld` error }; }) From 9838c39daca7487229811c8da6eb70d22255fbbe Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 20 Jan 2024 23:13:49 -0300 Subject: [PATCH 3/3] mgba: unpin lua --- pkgs/applications/emulators/mgba/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/emulators/mgba/default.nix b/pkgs/applications/emulators/mgba/default.nix index 93ee78a70c8c..4e0e8687b61e 100644 --- a/pkgs/applications/emulators/mgba/default.nix +++ b/pkgs/applications/emulators/mgba/default.nix @@ -9,7 +9,7 @@ , libepoxy , libsForQt5 , libzip -, lua5_4 +, lua , minizip , pkg-config , stdenv @@ -18,7 +18,6 @@ }: let - lua = lua5_4; inherit (libsForQt5) qtbase qtmultimedia