2023-01-31 19:59:19 +00:00
|
|
|
{ stdenv
|
2021-04-26 15:14:57 +00:00
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2022-01-04 04:14:19 +00:00
|
|
|
, fetchpatch
|
2023-01-31 19:59:19 +00:00
|
|
|
, gitUpdater
|
2021-04-26 15:14:57 +00:00
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, ffmpeg
|
|
|
|
, libGLU
|
2021-06-10 02:57:09 +00:00
|
|
|
, alsa-lib
|
2021-07-20 13:40:32 +00:00
|
|
|
, libX11
|
|
|
|
, libXrandr
|
2021-04-26 15:14:57 +00:00
|
|
|
, sndio
|
2023-01-31 19:59:19 +00:00
|
|
|
, qtbase
|
|
|
|
, qtsvg
|
|
|
|
, qttools
|
|
|
|
, wrapQtAppsHook
|
2021-04-26 15:14:57 +00:00
|
|
|
}:
|
|
|
|
|
2023-01-31 19:59:19 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-04-26 15:14:57 +00:00
|
|
|
pname = "punes";
|
2023-01-31 19:59:19 +00:00
|
|
|
version = "0.110";
|
2021-04-26 15:14:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "punesemu";
|
|
|
|
repo = "puNES";
|
2022-01-04 04:14:19 +00:00
|
|
|
rev = "v${version}";
|
2023-01-31 19:59:19 +00:00
|
|
|
sha256 = "sha256-+hL168r40aYUjyLbWFXWk9G2srrrG1TH1gLYMliHftU=";
|
2021-04-26 15:14:57 +00:00
|
|
|
};
|
|
|
|
|
2023-01-31 19:59:19 +00:00
|
|
|
patches = [
|
|
|
|
# Fixes compilation on aarch64
|
|
|
|
# Remove when version > 0.110
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/punesemu/puNES/commit/90dd5bc90412bbd199c2716f67a24aa88b24d80f.patch";
|
|
|
|
hash = "sha256-/KNpTds4qjwyaTUebWWPlVXfuxVh6M4zOInxUfYztJg=";
|
|
|
|
})
|
|
|
|
];
|
2021-04-26 15:14:57 +00:00
|
|
|
|
2023-01-31 19:59:19 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
qttools
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
2021-04-26 15:14:57 +00:00
|
|
|
|
2023-01-31 19:59:19 +00:00
|
|
|
buildInputs = [
|
|
|
|
ffmpeg
|
|
|
|
libGLU
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
|
|
alsa-lib
|
|
|
|
libX11
|
|
|
|
libXrandr
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isBSD [
|
|
|
|
sndio
|
|
|
|
];
|
2021-04-26 15:14:57 +00:00
|
|
|
|
2023-01-31 19:59:19 +00:00
|
|
|
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"}"
|
2021-04-26 15:14:57 +00:00
|
|
|
];
|
|
|
|
|
2023-01-31 19:59:19 +00:00
|
|
|
passthru.updateScript = gitUpdater {
|
|
|
|
rev-prefix = "v";
|
|
|
|
};
|
2021-04-26 15:14:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-09-17 12:38:22 +00:00
|
|
|
description = "Qt-based Nintendo Entertainment System emulator and NSF/NSFe Music Player";
|
2021-04-26 15:14:57 +00:00
|
|
|
homepage = "https://github.com/punesemu/puNES";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
|
|
|
platforms = with platforms; linux ++ freebsd ++ openbsd ++ windows;
|
|
|
|
};
|
|
|
|
}
|