hypnotix: 3.7 -> 4.0

https://github.com/linuxmint/hypnotix/compare/3.7...4.0

Since `~/.cache/hypnotix/favorites` is created by `usr/bin/hypnotix` the
shell script, we need to actually install it. As a consequence, we also
need to fix shebang for `usr/lib/hypnotix/hypnotix.py`, adding python3 as
buildInputs should do the work.
This commit is contained in:
Bobby Rong 2023-12-02 20:38:15 +08:00
parent e92039b55b
commit 96012ae105
No known key found for this signature in database

View file

@ -9,17 +9,18 @@
, mpv
, python3
, wrapGAppsHook
, yt-dlp
}:
stdenv.mkDerivation rec {
pname = "hypnotix";
version = "3.7";
version = "4.0";
src = fetchFromGitHub {
owner = "linuxmint";
repo = "hypnotix";
rev = version;
hash = "sha256-H8+KJ9+HLAorGIeljw8H3N8W3E2yYhAno1xy+jI54zM=";
hash = "sha256-0iJzlj5FRDXJdh+vWVvZaBJVNru7CfkvJtZUZYKoqPw=";
};
patches = [
@ -32,8 +33,12 @@ stdenv.mkDerivation rec {
postPatch = ''
substituteInPlace usr/lib/hypnotix/hypnotix.py \
--replace __DEB_VERSION__ ${version} \
--replace /usr/bin/yt-dlp ${yt-dlp}/bin/yt-dlp \
--replace /usr/share/circle-flags-svg ${circle-flags}/share/circle-flags-svg \
--replace /usr/share/hypnotix $out/share/hypnotix
substituteInPlace usr/bin/hypnotix \
--replace /usr/lib/hypnotix/hypnotix.py $out/lib/hypnotix/hypnotix.py
'';
nativeBuildInputs = [
@ -47,6 +52,7 @@ stdenv.mkDerivation rec {
buildInputs = [
cinnamon.xapp
python3 # for patchShebangs
];
pythonPath = with python3.pkgs; [
@ -62,8 +68,7 @@ stdenv.mkDerivation rec {
runHook preInstall
mkdir -p $out
cp -r usr/lib $out
cp -r usr/share $out
cp -r usr/* $out
glib-compile-schemas $out/share/glib-2.0/schemas
@ -72,8 +77,10 @@ stdenv.mkDerivation rec {
preFixup = ''
buildPythonPath "$out $pythonPath"
makeWrapper ${python3.interpreter} $out/bin/hypnotix \
--add-flags $out/lib/hypnotix/hypnotix.py \
# yt-dlp is needed for mpv to play YouTube channels.
wrapProgram $out/bin/hypnotix \
--prefix PATH : "${lib.makeBinPath [ yt-dlp ]}" \
--prefix PYTHONPATH : "$program_PYTHONPATH" \
''${gappsWrapperArgs[@]}
'';