nixpkgs/pkgs/by-name/fr/friture/package.nix
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

75 lines
1.6 KiB
Nix

{
lib,
fetchFromGitHub,
python3Packages,
qt5,
}:
python3Packages.buildPythonApplication rec {
pname = "friture";
version = "0.51";
pyproject = true;
src = fetchFromGitHub {
owner = "tlecomte";
repo = "friture";
rev = "v${version}";
hash = "sha256-1Swkk7bhQTSo17Gj0i1VNiIt+fSXgDIeWfJ9LpoUEHg=";
};
postPatch = ''
sed -i -e 's/==.*"/"/' -e '/packages=\[/a "friture.playback",' pyproject.toml
'';
nativeBuildInputs =
(with python3Packages; [
numpy
cython
scipy
setuptools
])
++ (with qt5; [ wrapQtAppsHook ]);
buildInputs = with qt5; [ qtquickcontrols2 ];
propagatedBuildInputs = with python3Packages; [
sounddevice
pyopengl
pyopengl-accelerate
docutils
numpy
pyqt5
appdirs
pyrr
rtmixer
];
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
postInstall = ''
substituteInPlace $out/share/applications/friture.desktop --replace usr/bin/friture friture
for size in 16 32 128 256 512
do
mkdir -p $out/share/icons/hicolor/$size\x$size
cp $src/resources/images/friture.iconset/icon_$size\x$size.png $out/share/icons/hicolor/$size\x$size/friture.png
done
mkdir -p $out/share/icons/hicolor/scalable/apps/
cp $src/resources/images-src/window-icon.svg $out/share/icons/hicolor/scalable/apps/friture.svg
'';
meta = with lib; {
description = "Real-time audio analyzer";
mainProgram = "friture";
homepage = "https://friture.org/";
license = licenses.gpl3;
platforms = platforms.linux; # fails on Darwin
maintainers = with maintainers; [
laikq
alyaeanyx
];
};
}