Skip to content

Commit 53c766a

Browse files
authored
punes: migrate to by-name (#425429)
2 parents 2f2b5ef + b5fda38 commit 53c766a

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
punes,
3+
}:
4+
5+
punes.override {
6+
withQt6 = true;
7+
}

pkgs/applications/emulators/punes/default.nix renamed to pkgs/by-name/pu/punes/package.nix

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,22 @@
1212
libX11,
1313
libXrandr,
1414
sndio,
15-
qtbase,
16-
qtsvg,
17-
qttools,
18-
wrapQtAppsHook,
15+
libsForQt5,
16+
qt6Packages,
17+
withQt6 ? false,
1918
}:
2019

20+
let
21+
qtPackages = if withQt6 then qt6Packages else libsForQt5;
22+
in
2123
stdenv.mkDerivation (finalAttrs: {
2224
pname = "punes";
2325
version = "0.111";
2426

2527
src = fetchFromGitHub {
2628
owner = "punesemu";
2729
repo = "puNES";
28-
rev = "v${finalAttrs.version}";
30+
tag = "v${finalAttrs.version}";
2931
hash = "sha256-TIXjYkInWV3yVnvXrdHcmeWYeps5TcvkG2Xjg4roIds=";
3032
};
3133

@@ -50,16 +52,20 @@ stdenv.mkDerivation (finalAttrs: {
5052
nativeBuildInputs = [
5153
cmake
5254
pkg-config
55+
]
56+
++ (with qtPackages; [
5357
qttools
5458
wrapQtAppsHook
55-
];
59+
]);
5660

5761
buildInputs = [
5862
ffmpeg
5963
libGLU
64+
]
65+
++ (with qtPackages; [
6066
qtbase
6167
qtsvg
62-
]
68+
])
6369
++ lib.optionals stdenv.hostPlatform.isLinux [
6470
alsa-lib
6571
libX11
@@ -74,20 +80,20 @@ stdenv.mkDerivation (finalAttrs: {
7480
"-DENABLE_RELEASE=ON"
7581
"-DENABLE_FFMPEG=ON"
7682
"-DENABLE_OPENGL=ON"
77-
"-DENABLE_QT6_LIBS=${if lib.versionAtLeast qtbase.version "6.0" then "ON" else "OFF"}"
83+
(lib.strings.cmakeBool "ENABLE_QT6_LIBS" withQt6)
7884
];
7985

8086
passthru.updateScript = gitUpdater {
8187
rev-prefix = "v";
8288
};
8389

84-
meta = with lib; {
90+
meta = {
8591
description = "Qt-based Nintendo Entertainment System emulator and NSF/NSFe Music Player";
8692
mainProgram = "punes";
8793
homepage = "https://github.com/punesemu/puNES";
8894
changelog = "https://github.com/punesemu/puNES/blob/v${finalAttrs.version}/ChangeLog";
89-
license = licenses.gpl2Plus;
90-
maintainers = with maintainers; [ OPNA2608 ];
91-
platforms = with platforms; linux ++ freebsd ++ openbsd ++ windows;
95+
license = lib.licenses.gpl2Plus;
96+
maintainers = with lib.maintainers; [ OPNA2608 ];
97+
platforms = with lib.platforms; linux ++ freebsd ++ openbsd ++ windows;
9298
};
9399
})

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,10 +1418,6 @@ with pkgs;
14181418
in
14191419
ppsspp.override argset;
14201420

1421-
punes = libsForQt5.callPackage ../applications/emulators/punes { };
1422-
1423-
punes-qt6 = qt6Packages.callPackage ../applications/emulators/punes { };
1424-
14251421
py65 = with python3.pkgs; toPythonApplication py65;
14261422

14271423
rmg-wayland = callPackage ../by-name/rm/rmg/package.nix {

0 commit comments

Comments
 (0)