Skip to content

Commit

Permalink
fix: yuki-iptv
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Rabbito <[email protected]>
  • Loading branch information
anthr76 committed Oct 27, 2024
1 parent 11b5b4f commit f32ef1a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 48 deletions.
42 changes: 21 additions & 21 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions home-manager/personalities/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
winetricks
lightworks_2023_02_02
shadps4
yuki-iptv
];
}
2 changes: 1 addition & 1 deletion pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
wayland-push-to-talk-fix = pkgs.callPackage ./wayland-push-to-talk-fix { };
discover-overlay = pkgs.python3Packages.callPackage ./discover-overlay { };
lightworks_2023_02_02 = pkgs.callPackage ./lightworks_2023_02_02 { };
yuki-iptv = pkgs.callPackage ./yuki-iptv { };
yuki-iptv = pkgs.python3Packages.callPackage ./yuki-iptv { };
}
55 changes: 29 additions & 26 deletions pkgs/yuki-iptv/default.nix
Original file line number Diff line number Diff line change
@@ -1,54 +1,64 @@
{
bash,
fetchurl,
python3,
stdenv,
mpv,
ffmpeg,
gettext,
glib,
gobject-introspection,
lib,
gettext
mpv-unwrapped,
python3,
stdenv
}:

stdenv.mkDerivation rec {
pname = "yuki-iptv";
version = "0.0.13";
version = "0.0.15";

src = fetchurl {
url = "https://codeberg.org/liya/yuki-iptv/archive/${version}.tar.gz";
sha256 = "8d1858f8bcd5908f58daab2231ef6d0beb25e0003c6197e86ed39a32670e2308";
sha256 = "sha256-8u8KoabExVqyj8ohGUl28SqIJYGfNLNl/tyHM9gwX88=";
};

buildInputs = [
python3
mpv
ffmpeg
mpv-unwrapped
];

nativeBuildInputs = [
python3.pkgs.wrapPython
gettext
python3.pkgs.wrapPython
];

pythonPath = with python3.pkgs; [
pyqt6
pillow
chardet
pygobject3
unidecode
pyqt6
pyqt6-sip
requests
chardet
setproctitle
unidecode
wand
sip
];

preBuild = ''
# Replace version in About dialog
sed -i "s/__DEB_VERSION__/${version}/g" usr/lib/yuki-iptv/yuki-iptv.py
preFixup = ''
buildPythonPath "$out $pythonPath"
wrapProgram $out/bin/yuki-iptv \
--prefix PYTHONPATH : "$program_PYTHONPATH" \
--set GI_TYPELIB_PATH "${glib.out}/lib/girepository-1.0:${gobject-introspection.out}/lib/girepository-1.0" \
'';

postPatch = ''
substituteInPlace usr/lib/yuki-iptv/yuki-iptv.py \
--replace __DEB_VERSION__ ${version}
substituteInPlace usr/bin/yuki-iptv \
--replace "#!/bin/sh" "#!${bash}/bin/sh" \
--replace "python3" "${python3}/bin/python3"
substituteInPlace usr/lib/yuki-iptv/thirdparty/mpv.py \
--replace "ctypes.util.find_library('mpv')" "'${lib.makeLibraryPath [ mpv-unwrapped ]}/libmpv.so'"
'';

installPhase = ''
Expand All @@ -60,17 +70,10 @@ stdenv.mkDerivation rec {
runHook postInstall
'';

preFixup = ''
buildPythonPath "$out $pythonPath"
wrapProgram $out/bin/yuki-iptv \
--prefix PYTHONPATH : "$program_PYTHONPATH"
'';

meta = with lib; {
description = "IPTV player with EPG support";
license = licenses.gpl3;
platforms = platforms.all;
license = licenses.cc-by-40;
platforms = platforms.linux;
homepage = "https://codeberg.org/liya/yuki-iptv";
};
}

0 comments on commit f32ef1a

Please sign in to comment.