Merge pull request #271665 from bobby285271/upd/hypnotix

hypnotix: 3.7 -> 4.0
This commit is contained in:
Bobby Rong 2023-12-04 21:41:21 +08:00 committed by GitHub
commit 90e4744741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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