nixpkgs/pkgs/applications/audio/jamesdsp/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

92 lines
2.1 KiB
Nix

{ copyDesktopItems
, fetchFromGitHub
, glibmm
, gst_all_1
, lib
, libarchive
, makeDesktopItem
, pipewire
, pkg-config
, pulseaudio
, qmake
, qtbase
, qtsvg
, qtwayland
, stdenv
, usePipewire ? true
, usePulseaudio ? false
, wrapQtAppsHook
}:
assert lib.asserts.assertMsg (usePipewire != usePulseaudio) "You need to enable one and only one of pulseaudio or pipewire support";
stdenv.mkDerivation (finalAttrs: {
pname = "jamesdsp";
version = "2.7.0";
src = fetchFromGitHub {
owner = "Audio4Linux";
repo = "JDSP4Linux";
fetchSubmodules = true;
rev = finalAttrs.version;
hash = "sha256-eVndqIqJ3DRceuFMT++g2riXq0CL5r+TWbvzvaYIfZ8=";
};
nativeBuildInputs = [
qmake
pkg-config
copyDesktopItems
wrapQtAppsHook
];
buildInputs = [
glibmm
libarchive
qtbase
qtsvg
qtwayland
] ++ lib.optionals usePipewire [
pipewire
] ++ lib.optionals usePulseaudio [
pulseaudio
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gstreamer
];
preFixup = lib.optionalString usePulseaudio ''
qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
'';
qmakeFlags = lib.optionals usePulseaudio [ "CONFIG+=USE_PULSEAUDIO" ];
desktopItems = [
(makeDesktopItem {
name = "jamesdsp";
desktopName = "JamesDSP";
genericName = "Audio effects processor";
exec = "jamesdsp";
icon = "jamesdsp";
comment = "JamesDSP for Linux";
categories = [ "AudioVideo" "Audio" ];
startupNotify = false;
keywords = [ "equalizer" "audio" "effect" ];
})
];
postInstall = ''
install -D resources/icons/icon.png $out/share/pixmaps/jamesdsp.png
install -D resources/icons/icon.svg $out/share/icons/hicolor/scalable/apps/jamesdsp.svg
'';
meta = {
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
description = "Audio effect processor for PipeWire clients";
mainProgram = "jamesdsp";
homepage = "https://github.com/Audio4Linux/JDSP4Linux";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ pasqui23 rewine ];
platforms = lib.platforms.linux;
};
})