Unverified Commit 6e1b4374 authored by Christoph Neidahl's avatar Christoph Neidahl Committed by GitHub
Browse files

punes: 0.109 -> 0.110, add Qt6 variant (#209485)

parent 59e9ca3a
Loading
Loading
Loading
Loading
+44 −27
Original line number Diff line number Diff line
{ 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 ];
  patches = [
    # Fixes compilation on aarch64
    # Remove when version > 0.110
    (fetchpatch {
      url = "https://github.com/punesemu/puNES/commit/90dd5bc90412bbd199c2716f67a24aa88b24d80f.patch";
      hash = "sha256-/KNpTds4qjwyaTUebWWPlVXfuxVh6M4zOInxUfYztJg=";
    })
  ];

  dontUseCmakeConfigure = true;
  nativeBuildInputs = [
    cmake
    pkg-config
    qttools
    wrapQtAppsHook
  ];

  enableParallelBuilding = true;
  buildInputs = [
    ffmpeg
    libGLU
    qtbase
    qtsvg
  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
    alsa-lib
    libX11
    libXrandr
  ] ++ lib.optionals stdenv.hostPlatform.isBSD [
    sndio
  ];

  configureFlags = [
    "--prefix=${placeholder "out"}"
    "--without-opengl-nvidia-cg"
    "--with-ffmpeg"
  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 = nix-update-script { };
  passthru.updateScript = gitUpdater {
    rev-prefix = "v";
  };

  meta = with lib; {
    description = "Qt-based Nintendo Entertainment System emulator and NSF/NSFe Music Player";
+2 −0
Original line number Diff line number Diff line
@@ -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 {};