about summary refs log tree commit diff
path: root/pkgs/applications/audio
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2024-05-01 09:37:47 +0300
committerK900 <me@0upti.me>2024-05-01 09:37:47 +0300
commita9c7210d0b6d3b17f3b060c5f979f7e88ec94a97 (patch)
treeef03637bff6d8215cc904425c8b59499174c90ad /pkgs/applications/audio
parent09b96cbb7ac9489b9e7e6546bced869b90744344 (diff)
parent28496bb2c5a6f90329a00e41c3787eec2b6be1b4 (diff)
Merge branch 'master' into staging-next
Diffstat (limited to 'pkgs/applications/audio')
-rw-r--r--pkgs/applications/audio/bambootracker/default.nix8
-rw-r--r--pkgs/applications/audio/feishin/default.nix123
-rw-r--r--pkgs/applications/audio/listenbrainz-mpd/default.nix6
-rw-r--r--pkgs/applications/audio/virtual-ans/default.nix4
4 files changed, 86 insertions, 55 deletions
diff --git a/pkgs/applications/audio/bambootracker/default.nix b/pkgs/applications/audio/bambootracker/default.nix
index 5ebc2caf0f715..5f955334fef20 100644
--- a/pkgs/applications/audio/bambootracker/default.nix
+++ b/pkgs/applications/audio/bambootracker/default.nix
@@ -8,7 +8,7 @@
 , qtbase
 , qttools
 , qtwayland
-, rtaudio
+, rtaudio_6
 , rtmidi
 , wrapQtAppsHook
 }:
@@ -43,16 +43,16 @@ stdenv.mkDerivation (finalAttrs: {
 
   buildInputs = [
     qtbase
+    rtaudio_6
     rtmidi
   ] ++ lib.optionals stdenv.hostPlatform.isLinux [
     qtwayland
   ] ++ lib.optionals (lib.versionAtLeast qtbase.version "6.0") [
     qt5compat
-  ] ++ rtaudio.buildInputs;
+  ];
 
   qmakeFlags = [
-    # we don't have RtAudio 6 yet: https://github.com/NixOS/nixpkgs/pull/245075
-    # "CONFIG+=system_rtaudio"
+    "CONFIG+=system_rtaudio"
     "CONFIG+=system_rtmidi"
   ];
 
diff --git a/pkgs/applications/audio/feishin/default.nix b/pkgs/applications/audio/feishin/default.nix
index 5168d084af72a..e0e35bae6df09 100644
--- a/pkgs/applications/audio/feishin/default.nix
+++ b/pkgs/applications/audio/feishin/default.nix
@@ -1,8 +1,10 @@
 {
   lib,
+  stdenv,
   buildNpmPackage,
   fetchFromGitHub,
   electron_27,
+  darwin,
   copyDesktopItems,
   makeDesktopItem,
   ...
@@ -21,8 +23,7 @@ let
   electron = electron_27;
 in
 buildNpmPackage {
-  pname = "feishin";
-  inherit version;
+  inherit pname version;
 
   inherit src;
   npmDepsHash = "sha256-+pr9fWg/9kxkYMmthtqhjgF6MOomSQxVCO5V8tHHRdE=";
@@ -32,17 +33,25 @@ buildNpmPackage {
 
   env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
 
-  nativeBuildInputs = [ copyDesktopItems ];
+  nativeBuildInputs =
+    lib.optionals (stdenv.isLinux) [ copyDesktopItems ]
+    ++ lib.optionals stdenv.isDarwin [ darwin.autoSignDarwinBinariesHook ];
 
-  postPatch = ''
-    # release/app dependencies are installed on preConfigure
-    substituteInPlace package.json \
-      --replace-fail "electron-builder install-app-deps &&" ""
+  postPatch =
+    ''
+      # release/app dependencies are installed on preConfigure
+      substituteInPlace package.json \
+        --replace-fail "electron-builder install-app-deps &&" ""
 
-    # https://github.com/electron/electron/issues/31121
-    substituteInPlace src/main/main.ts \
-      --replace-fail "process.resourcesPath" "'$out/share/feishin/resources'"
-  '';
+      # Don't check for updates.
+      substituteInPlace src/main/main.ts \
+        --replace-fail "autoUpdater.checkForUpdatesAndNotify();" ""
+    ''
+    + lib.optionalString stdenv.isLinux ''
+      # https://github.com/electron/electron/issues/31121
+      substituteInPlace src/main/main.ts \
+        --replace-fail "process.resourcesPath" "'$out/share/feishin/resources'"
+    '';
 
   preConfigure =
     let
@@ -67,40 +76,59 @@ buildNpmPackage {
       done
     '';
 
-  postBuild = ''
-    npm exec electron-builder -- \
-      --dir \
-      -c.electronDist=${electron}/libexec/electron \
-      -c.electronVersion=${electron.version} \
-      -c.npmRebuild=false
-  '';
-
-  installPhase = ''
-    runHook preInstall
-
-    mkdir -p $out/share/feishin
-    pushd release/build/*/
-    cp -r locales resources{,.pak} $out/share/feishin
-    popd
-
-    # Code relies on checking app.isPackaged, which returns false if the executable is electron.
-    # Set ELECTRON_FORCE_IS_PACKAGED=1.
-    # https://github.com/electron/electron/issues/35153#issuecomment-1202718531
-    makeWrapper ${lib.getExe electron} $out/bin/feishin \
-      --add-flags $out/share/feishin/resources/app.asar \
-      --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
-      --set ELECTRON_FORCE_IS_PACKAGED=1 \
-      --inherit-argv0
-
-    for size in 32 64 128 256 512 1024; do
-      mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
-      ln -s \
-        $out/share/feishin/resources/assets/icons/"$size"x"$size".png \
-        $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png
-    done
-
-    runHook postInstall
-  '';
+  postBuild =
+    lib.optionalString stdenv.isDarwin ''
+      # electron-builder appears to build directly on top of Electron.app, by overwriting the files in the bundle.
+      cp -r ${electron}/Applications/Electron.app ./
+      find ./Electron.app -name 'Info.plist' | xargs -d '\n' chmod +rw
+
+      # Disable code signing during build on macOS.
+      # https://github.com/electron-userland/electron-builder/blob/fa6fc16/docs/code-signing.md#how-to-disable-code-signing-during-the-build-process-on-macos
+      export CSC_IDENTITY_AUTO_DISCOVERY=false
+      sed -i "/afterSign/d" package.json
+    ''
+    + ''
+      npm exec electron-builder -- \
+        --dir \
+        -c.electronDist=${if stdenv.isDarwin then "./" else "${electron}/libexec/electron"} \
+        -c.electronVersion=${electron.version} \
+        -c.npmRebuild=false
+    '';
+
+  installPhase =
+    ''
+      runHook preInstall
+    ''
+    + lib.optionalString stdenv.isDarwin ''
+      mkdir -p $out/{Applications,bin}
+      cp -r release/build/**/Feishin.app $out/Applications/
+      makeWrapper $out/Applications/Feishin.app/Contents/MacOS/Feishin $out/bin/feishin
+    ''
+    + lib.optionalString stdenv.isLinux ''
+      mkdir -p $out/share/feishin
+      pushd release/build/*/
+      cp -r locales resources{,.pak} $out/share/feishin
+      popd
+
+      # Code relies on checking app.isPackaged, which returns false if the executable is electron.
+      # Set ELECTRON_FORCE_IS_PACKAGED=1.
+      # https://github.com/electron/electron/issues/35153#issuecomment-1202718531
+      makeWrapper ${lib.getExe electron} $out/bin/feishin \
+        --add-flags $out/share/feishin/resources/app.asar \
+        --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
+        --set ELECTRON_FORCE_IS_PACKAGED=1 \
+        --inherit-argv0
+
+      for size in 32 64 128 256 512 1024; do
+        mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
+        ln -s \
+          $out/share/feishin/resources/assets/icons/"$size"x"$size".png \
+          $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png
+      done
+    ''
+    + ''
+      runHook postInstall
+    '';
 
   desktopItems = [
     (makeDesktopItem {
@@ -125,6 +153,9 @@ buildNpmPackage {
     license = licenses.gpl3Plus;
     platforms = platforms.unix;
     mainProgram = "feishin";
-    maintainers = with maintainers; [ onny ];
+    maintainers = with maintainers; [
+      onny
+      jlbribeiro
+    ];
   };
 }
diff --git a/pkgs/applications/audio/listenbrainz-mpd/default.nix b/pkgs/applications/audio/listenbrainz-mpd/default.nix
index 5a7ef4417876b..9f633fc8d0793 100644
--- a/pkgs/applications/audio/listenbrainz-mpd/default.nix
+++ b/pkgs/applications/audio/listenbrainz-mpd/default.nix
@@ -14,17 +14,17 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "listenbrainz-mpd";
-  version = "2.3.4";
+  version = "2.3.5";
 
   src = fetchFromGitea {
     domain = "codeberg.org";
     owner = "elomatreb";
     repo = "listenbrainz-mpd";
     rev = "v${version}";
-    hash = "sha256-QHhSrmBNvUTffPzjns670Tn3Z3UDcDvarq605Qx9k4w=";
+    hash = "sha256-z3SVpPCWZqCVXPKbPxZAKGtk8Z/Tf5PULn0dWsKlVrE=";
   };
 
-  cargoHash = "sha256-vtU439Pd3zWx+qakh1xTENQhun7S+WsJMndXqPWrPWU=";
+  cargoHash = "sha256-eCdUrxt9edJm6K3f8V8bjgYWMq3mgj/ZfUZYWE3ZBqw=";
 
   nativeBuildInputs = [ pkg-config installShellFiles asciidoctor ];
 
diff --git a/pkgs/applications/audio/virtual-ans/default.nix b/pkgs/applications/audio/virtual-ans/default.nix
index a14d5c5a37e23..4bec1952e03eb 100644
--- a/pkgs/applications/audio/virtual-ans/default.nix
+++ b/pkgs/applications/audio/virtual-ans/default.nix
@@ -10,11 +10,11 @@
 
 stdenv.mkDerivation rec {
   pname = "virtual-ans";
-  version = "3.0.2c";
+  version = "3.0.3";
 
   src = fetchzip {
     url = "https://warmplace.ru/soft/ans/virtual_ans-${version}.zip";
-    sha256 = "03r1v3l7rd59dakr7ndvgsqchv00ppkvi6sslgf1ng07r3rsvb1n";
+    sha256 = "sha256-tqR7icgURUFOyLJ8+mS17JRf2gK53I2FW/2m8IJPtJE=";
   };
 
   nativeBuildInputs = [