Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
2025-04-08 02:57:25 -04:00

90 lines
1.9 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";
};
}