nixpkgs/pkgs/applications/video/hypnotix/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

98 lines
2.1 KiB
Nix
Raw Normal View History

2022-05-23 08:27:25 +02:00
{ lib
, stdenv
, fetchFromGitHub
, substituteAll
, cinnamon
, circle-flags
2022-05-23 08:27:25 +02:00
, gettext
, gobject-introspection
, mpv
, python3
, wrapGAppsHook
, yt-dlp
2022-05-23 08:27:25 +02:00
}:
stdenv.mkDerivation rec {
pname = "hypnotix";
version = "4.3";
2022-05-23 08:27:25 +02:00
src = fetchFromGitHub {
owner = "linuxmint";
repo = "hypnotix";
rev = version;
hash = "sha256-nmldOziye+bSi8CA9TL0f3EKEKTeXRk3HFzf4ksE9oE=";
2022-05-23 08:27:25 +02:00
};
patches = [
(substituteAll {
src = ./libmpv-path.patch;
libmpv = "${lib.getLib mpv}/lib/libmpv${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];
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 \
2022-05-23 08:27:25 +02:00
--replace /usr/share/hypnotix $out/share/hypnotix
substituteInPlace usr/bin/hypnotix \
--replace /usr/lib/hypnotix/hypnotix.py $out/lib/hypnotix/hypnotix.py
2022-05-23 08:27:25 +02:00
'';
nativeBuildInputs = [
gettext
gobject-introspection
python3.pkgs.wrapPython
wrapGAppsHook
];
dontWrapGApps = true;
buildInputs = [
cinnamon.xapp
python3 # for patchShebangs
2022-05-23 08:27:25 +02:00
];
pythonPath = with python3.pkgs; [
2022-08-08 22:02:01 +02:00
cinemagoer
2022-05-23 08:27:25 +02:00
pygobject3
requests
setproctitle
unidecode
xapp
];
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r usr/* $out
2022-05-23 08:27:25 +02:00
glib-compile-schemas $out/share/glib-2.0/schemas
runHook postInstall
'';
preFixup = ''
buildPythonPath "$out $pythonPath"
# yt-dlp is needed for mpv to play YouTube channels.
wrapProgram $out/bin/hypnotix \
--prefix PATH : "${lib.makeBinPath [ yt-dlp ]}" \
2022-05-23 08:27:25 +02:00
--prefix PYTHONPATH : "$program_PYTHONPATH" \
''${gappsWrapperArgs[@]}
'';
meta = {
description = "IPTV streaming application";
homepage = "https://github.com/linuxmint/hypnotix";
changelog = "https://github.com/linuxmint/hypnotix/blob/${src.rev}/debian/changelog";
2022-05-23 08:27:25 +02:00
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ dotlambda bobby285271 ];
2022-05-23 08:27:25 +02:00
platforms = lib.platforms.linux;
2023-11-27 02:17:53 +01:00
mainProgram = "hypnotix";
2022-05-23 08:27:25 +02:00
};
}