Skip to content

Commit 44fa0d9

Browse files
committed
{bambootracker,bambootracker-qt6}: Migrate to pkgs/by-name
1 parent 6e7e61c commit 44fa0d9

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

pkgs/applications/audio/bambootracker/default.nix renamed to pkgs/by-name/ba/bambootracker/package.nix

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@
44
fetchFromGitHub,
55
fetchpatch,
66
gitUpdater,
7+
libsForQt5,
78
pkg-config,
8-
qmake,
9-
qt5compat ? null,
10-
qtbase,
11-
qttools,
12-
qtwayland,
9+
qt6Packages,
1310
rtaudio_6,
1411
rtmidi,
15-
wrapQtAppsHook,
12+
withQt6 ? false,
1613
}:
1714

18-
assert lib.versionAtLeast qtbase.version "6.0" -> qt5compat != null;
19-
15+
let
16+
qtPackages = if withQt6 then qt6Packages else libsForQt5;
17+
in
2018
stdenv.mkDerivation (finalAttrs: {
21-
pname = "bambootracker" + lib.optionalString (lib.versionAtLeast qtbase.version "6.0") "-qt6";
19+
pname = "bambootracker" + lib.optionalString withQt6 "-qt6";
2220
version = "0.6.5";
2321

2422
src = fetchFromGitHub {
@@ -52,32 +50,40 @@ stdenv.mkDerivation (finalAttrs: {
5250
})
5351
];
5452

55-
postPatch = lib.optionalString (lib.versionAtLeast qtbase.version "6.0") ''
53+
postPatch = lib.optionalString withQt6 ''
5654
# Work around lrelease finding in qmake being broken by using pre-Qt5.12 code path
5755
# https://github.com/NixOS/nixpkgs/issues/214765
5856
substituteInPlace BambooTracker/lang/lang.pri \
5957
--replace 'equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 12)' 'if(true)'
6058
'';
6159

62-
nativeBuildInputs = [
63-
pkg-config
64-
qmake
65-
qttools
66-
wrapQtAppsHook
67-
];
60+
nativeBuildInputs =
61+
[
62+
pkg-config
63+
]
64+
++ (with qtPackages; [
65+
qmake
66+
qttools
67+
wrapQtAppsHook
68+
]);
6869

6970
buildInputs =
7071
[
71-
qtbase
7272
rtaudio_6
7373
rtmidi
7474
]
75-
++ lib.optionals stdenv.hostPlatform.isLinux [
76-
qtwayland
77-
]
78-
++ lib.optionals (lib.versionAtLeast qtbase.version "6.0") [
79-
qt5compat
80-
];
75+
++ (
76+
with qtPackages;
77+
[
78+
qtbase
79+
]
80+
++ lib.optionals stdenv.hostPlatform.isLinux [
81+
qtwayland
82+
]
83+
++ lib.optionals withQt6 [
84+
qt5compat
85+
]
86+
);
8187

8288
qmakeFlags =
8389
[

pkgs/top-level/all-packages.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12830,8 +12830,7 @@ with pkgs;
1283012830

1283112831
av-98 = callPackage ../applications/networking/browsers/av-98 { };
1283212832

12833-
bambootracker = libsForQt5.callPackage ../applications/audio/bambootracker { };
12834-
bambootracker-qt6 = qt6Packages.callPackage ../applications/audio/bambootracker { };
12833+
bambootracker-qt6 = bambootracker.override { withQt6 = true; };
1283512834

1283612835
schismtracker = callPackage ../applications/audio/schismtracker {
1283712836
inherit (darwin.apple_sdk.frameworks) Cocoa;

0 commit comments

Comments
 (0)