From 6e7e61cc0c4503b09eaca2dfce4dd5521921dff4 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 23 Mar 2025 13:47:57 +0100 Subject: [PATCH 1/2] {bambootracker,bambootracker-qt6}: 0.6.4 -> 0.6.5 --- .../audio/bambootracker/default.nix | 44 ++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/audio/bambootracker/default.nix b/pkgs/applications/audio/bambootracker/default.nix index 5bf7445d2682..66f3059ddcd8 100644 --- a/pkgs/applications/audio/bambootracker/default.nix +++ b/pkgs/applications/audio/bambootracker/default.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitHub, + fetchpatch, gitUpdater, pkg-config, qmake, @@ -17,17 +18,40 @@ assert lib.versionAtLeast qtbase.version "6.0" -> qt5compat != null; stdenv.mkDerivation (finalAttrs: { - pname = "bambootracker"; - version = "0.6.4"; + pname = "bambootracker" + lib.optionalString (lib.versionAtLeast qtbase.version "6.0") "-qt6"; + version = "0.6.5"; src = fetchFromGitHub { owner = "BambooTracker"; repo = "BambooTracker"; - rev = "v${finalAttrs.version}"; + tag = "v${finalAttrs.version}"; fetchSubmodules = true; - hash = "sha256-tFUliKR55iZybNyYIF1FXh8RGf8jKEsGrWBuldB277g="; + hash = "sha256-WoyOqInOOOIEwsMOc2yoTdh9UhJOvFKE1GfkxOuXDe0="; }; + patches = [ + # Remove when version > 0.6.5 + (fetchpatch { + name = "0001-bambootracker-Fix-compiler-warnings.patch"; + url = "https://github.com/BambooTracker/BambooTracker/commit/d670cf8b6113318cd938cf19be76b6b14d3635f1.patch"; + hash = "sha256-yyOMaOYKSc1hbbCL7wjFNPDmX2oMYo10J4hjZJss2zs="; + }) + + # Remove when version > 0.6.5 + (fetchpatch { + name = "0002-bambootracker-Fix-GCC15-compat.patch"; + url = "https://github.com/BambooTracker/BambooTracker/commit/92c0a7d1cfb05d1c6ae9482181c5c378082b772c.patch"; + hash = "sha256-6K0RZD0LevggxFr92LaNmq+eMgOFJgFX60IgAw7tYdM="; + }) + + # Remove when version > 0.6.5 + (fetchpatch { + name = "0003-bambootracker-Drop-unused-property.patch"; + url = "https://github.com/BambooTracker/BambooTracker/commit/de4459f0315f099d3e0a2d20b938ec76285f2d46.patch"; + hash = "sha256-zTh6i+hgQZ3kEid0IzQaR/PsrYlnhplccdlaS5g8FeA="; + }) + ]; + postPatch = lib.optionalString (lib.versionAtLeast qtbase.version "6.0") '' # Work around lrelease finding in qmake being broken by using pre-Qt5.12 code path # https://github.com/NixOS/nixpkgs/issues/214765 @@ -60,9 +84,9 @@ stdenv.mkDerivation (finalAttrs: { "CONFIG+=system_rtaudio" "CONFIG+=system_rtmidi" ] - ++ lib.optionals (stdenv.cc.isClang || (lib.versionAtLeast qtbase.version "6.0")) [ + ++ lib.optionals stdenv.cc.isClang [ # Clang is extra-strict about some deprecations - # Latest Qt6 deprecated QCheckBox::stateChanged(int) + # https://github.com/BambooTracker/BambooTracker/issues/506 "CONFIG+=no_warnings_are_errors" ]; @@ -84,12 +108,12 @@ stdenv.mkDerivation (finalAttrs: { }; }; - meta = with lib; { + meta = { description = "Tracker for YM2608 (OPNA) which was used in NEC PC-8801/9801 series computers"; mainProgram = "BambooTracker"; homepage = "https://bambootracker.github.io/BambooTracker/"; - license = licenses.gpl2Plus; - platforms = platforms.all; - maintainers = with maintainers; [ OPNA2608 ]; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ OPNA2608 ]; }; }) From 44fa0d91d7c909f294003538670102b9427cacb0 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 23 Mar 2025 13:49:01 +0100 Subject: [PATCH 2/2] {bambootracker,bambootracker-qt6}: Migrate to pkgs/by-name --- .../ba/bambootracker/package.nix} | 52 +++++++++++-------- pkgs/top-level/all-packages.nix | 3 +- 2 files changed, 30 insertions(+), 25 deletions(-) rename pkgs/{applications/audio/bambootracker/default.nix => by-name/ba/bambootracker/package.nix} (83%) diff --git a/pkgs/applications/audio/bambootracker/default.nix b/pkgs/by-name/ba/bambootracker/package.nix similarity index 83% rename from pkgs/applications/audio/bambootracker/default.nix rename to pkgs/by-name/ba/bambootracker/package.nix index 66f3059ddcd8..5b96caa3e842 100644 --- a/pkgs/applications/audio/bambootracker/default.nix +++ b/pkgs/by-name/ba/bambootracker/package.nix @@ -4,21 +4,19 @@ fetchFromGitHub, fetchpatch, gitUpdater, + libsForQt5, pkg-config, - qmake, - qt5compat ? null, - qtbase, - qttools, - qtwayland, + qt6Packages, rtaudio_6, rtmidi, - wrapQtAppsHook, + withQt6 ? false, }: -assert lib.versionAtLeast qtbase.version "6.0" -> qt5compat != null; - +let + qtPackages = if withQt6 then qt6Packages else libsForQt5; +in stdenv.mkDerivation (finalAttrs: { - pname = "bambootracker" + lib.optionalString (lib.versionAtLeast qtbase.version "6.0") "-qt6"; + pname = "bambootracker" + lib.optionalString withQt6 "-qt6"; version = "0.6.5"; src = fetchFromGitHub { @@ -52,32 +50,40 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - postPatch = lib.optionalString (lib.versionAtLeast qtbase.version "6.0") '' + postPatch = lib.optionalString withQt6 '' # Work around lrelease finding in qmake being broken by using pre-Qt5.12 code path # https://github.com/NixOS/nixpkgs/issues/214765 substituteInPlace BambooTracker/lang/lang.pri \ --replace 'equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 12)' 'if(true)' ''; - nativeBuildInputs = [ - pkg-config - qmake - qttools - wrapQtAppsHook - ]; + nativeBuildInputs = + [ + pkg-config + ] + ++ (with qtPackages; [ + qmake + qttools + wrapQtAppsHook + ]); buildInputs = [ - qtbase rtaudio_6 rtmidi ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ] - ++ lib.optionals (lib.versionAtLeast qtbase.version "6.0") [ - qt5compat - ]; + ++ ( + with qtPackages; + [ + qtbase + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ] + ++ lib.optionals withQt6 [ + qt5compat + ] + ); qmakeFlags = [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c58ea108f2c7..dbf63c9f8488 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12830,8 +12830,7 @@ with pkgs; av-98 = callPackage ../applications/networking/browsers/av-98 { }; - bambootracker = libsForQt5.callPackage ../applications/audio/bambootracker { }; - bambootracker-qt6 = qt6Packages.callPackage ../applications/audio/bambootracker { }; + bambootracker-qt6 = bambootracker.override { withQt6 = true; }; schismtracker = callPackage ../applications/audio/schismtracker { inherit (darwin.apple_sdk.frameworks) Cocoa;