From 6e1b43747afb6fbdc3cf6d03c0cd67a195e92fe9 Mon Sep 17 00:00:00 2001 From: Christoph Neidahl Date: Tue, 31 Jan 2023 20:59:19 +0100 Subject: [PATCH] punes: 0.109 -> 0.110, add Qt6 variant (#209485) --- pkgs/applications/emulators/punes/default.nix | 77 +++++++++++-------- pkgs/top-level/all-packages.nix | 2 + 2 files changed, 49 insertions(+), 30 deletions(-) diff --git a/pkgs/applications/emulators/punes/default.nix b/pkgs/applications/emulators/punes/default.nix index b68b70c0ac44..529dce536430 100644 --- a/pkgs/applications/emulators/punes/default.nix +++ b/pkgs/applications/emulators/punes/default.nix @@ -1,13 +1,8 @@ -{ mkDerivation -, stdenv +{ stdenv , lib , fetchFromGitHub , fetchpatch -, nix-update-script -, qtbase -, qtsvg -, qttools -, autoreconfHook +, gitUpdater , cmake , pkg-config , ffmpeg @@ -16,41 +11,63 @@ , libX11 , libXrandr , sndio +, qtbase +, qtsvg +, qttools +, wrapQtAppsHook }: -mkDerivation rec { +stdenv.mkDerivation rec { pname = "punes"; - version = "0.109"; + version = "0.110"; src = fetchFromGitHub { owner = "punesemu"; repo = "puNES"; rev = "v${version}"; - sha256 = "sha256-6aRtR/d8nhzmpN9QKSZ62jye7qjfO+FpRMCXkX4Yubk="; + sha256 = "sha256-+hL168r40aYUjyLbWFXWk9G2srrrG1TH1gLYMliHftU="; }; - postPatch = '' - substituteInPlace configure.ac \ - --replace '`$PKG_CONFIG --variable=host_bins Qt5Core`/lrelease' '${qttools.dev}/bin/lrelease' - ''; - - nativeBuildInputs = [ autoreconfHook cmake pkg-config qttools ]; - - buildInputs = [ ffmpeg qtbase qtsvg libGLU ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib libX11 libXrandr ] - ++ lib.optionals stdenv.hostPlatform.isBSD [ sndio ]; - - dontUseCmakeConfigure = true; - - enableParallelBuilding = true; - - configureFlags = [ - "--prefix=${placeholder "out"}" - "--without-opengl-nvidia-cg" - "--with-ffmpeg" + patches = [ + # Fixes compilation on aarch64 + # Remove when version > 0.110 + (fetchpatch { + url = "https://github.com/punesemu/puNES/commit/90dd5bc90412bbd199c2716f67a24aa88b24d80f.patch"; + hash = "sha256-/KNpTds4qjwyaTUebWWPlVXfuxVh6M4zOInxUfYztJg="; + }) ]; - passthru.updateScript = nix-update-script { }; + nativeBuildInputs = [ + cmake + pkg-config + qttools + wrapQtAppsHook + ]; + + buildInputs = [ + ffmpeg + libGLU + qtbase + qtsvg + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libX11 + libXrandr + ] ++ lib.optionals stdenv.hostPlatform.isBSD [ + sndio + ]; + + cmakeFlags = [ + "-DENABLE_GIT_INFO=OFF" + "-DENABLE_RELEASE=ON" + "-DENABLE_FFMPEG=ON" + "-DENABLE_OPENGL=ON" + "-DENABLE_QT6_LIBS=${if lib.versionAtLeast qtbase.version "6.0" then "ON" else "OFF"}" + ]; + + passthru.updateScript = gitUpdater { + rev-prefix = "v"; + }; meta = with lib; { description = "Qt-based Nintendo Entertainment System emulator and NSF/NSFe Music Player"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 05606f94a7cf..763a6e0e62dd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2189,6 +2189,8 @@ with pkgs; punes = libsForQt5.callPackage ../applications/emulators/punes { }; + punes-qt6 = qt6Packages.callPackage ../applications/emulators/punes { }; + py65 = python3Packages.callPackage ../applications/emulators/py65 { }; resim = callPackage ../applications/emulators/resim {};