nixpkgs/pkgs/by-name/so/sony-headphones-client/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

63 lines
1.8 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config, bluez, dbus, glew, glfw, imgui, makeDesktopItem, copyDesktopItems }:
stdenv.mkDerivation rec {
pname = "SonyHeadphonesClient";
version = "1.3.2";
src = fetchFromGitHub {
owner = "Plutoberth";
repo = "SonyHeadphonesClient";
rev = "v${version}";
hash = "sha256-vhI97KheKzr87exCh4xNN7NDefcagdMu1tWSt67vLiU=";
fetchSubmodules = true;
};
patches = [
(fetchpatch {
name = "include-cstdint-to-fix-gcc-compiling.patch";
url = "https://github.com/Plutoberth/SonyHeadphonesClient/commit/4da8a12b22f8a45e79aa53d4cae88ca99b51d41f.patch";
stripLen = 2;
extraPrefix = "";
hash = "sha256-IZR/Znj40pUEC9gmNJDMPWuZOM2ueAgykZFn5DVn6es=";
})
];
nativeBuildInputs = [ cmake pkg-config copyDesktopItems ];
buildInputs = [ bluez dbus glew glfw imgui ];
sourceRoot = "${src.name}/Client";
cmakeFlags = [ "-Wno-dev" ];
postPatch = ''
substituteInPlace Constants.h \
--replace "UNKNOWN = -1" "// UNKNOWN removed since it doesn't fit in char"
'';
installPhase = ''
runHook preInstall
install -Dm755 -t $out/bin SonyHeadphonesClient
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "SonyHeadphonesClient";
exec = "SonyHeadphonesClient";
icon = "SonyHeadphonesClient";
desktopName = "Sony Headphones Client";
comment = "A client recreating the functionality of the Sony Headphones app";
categories = [ "Audio" "Mixer" ];
})
];
meta = with lib; {
description = "Client recreating the functionality of the Sony Headphones app";
homepage = "https://github.com/Plutoberth/SonyHeadphonesClient";
license = licenses.mit;
maintainers = with maintainers; [ stunkymonkey ];
platforms = platforms.linux;
mainProgram = "SonyHeadphonesClient";
};
}