2021-01-25 09:26:54 +01:00
|
|
|
{ lib, buildPythonApplication, fetchFromGitHub, makeWrapper
|
2019-04-13 13:22:12 +02:00
|
|
|
, aria
|
|
|
|
, libnotify
|
|
|
|
, pulseaudio
|
|
|
|
, psutil
|
|
|
|
, pyqt5
|
|
|
|
, requests
|
|
|
|
, setproctitle
|
2020-06-27 00:21:00 +02:00
|
|
|
, setuptools
|
2019-04-13 13:22:12 +02:00
|
|
|
, sound-theme-freedesktop
|
2020-07-01 19:58:36 +02:00
|
|
|
, wrapQtAppsHook
|
2019-04-13 13:22:12 +02:00
|
|
|
, youtube-dl
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "persepolis";
|
2019-09-28 04:51:43 +02:00
|
|
|
version = "3.2.0";
|
2019-04-13 13:22:12 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "persepolisdm";
|
|
|
|
repo = "persepolis";
|
2019-09-09 01:38:31 +02:00
|
|
|
rev = version;
|
2019-09-28 04:51:43 +02:00
|
|
|
sha256 = "1rh7q432ynbysapsd075nif975ync71icpb71x2mb4j8jx1vzs45";
|
2019-04-13 13:22:12 +02:00
|
|
|
};
|
|
|
|
|
2019-09-28 04:51:43 +02:00
|
|
|
# see: https://github.com/persepolisdm/persepolis/blob/3.2.0/setup.py#L130
|
2019-04-13 13:22:12 +02:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
preBuild=''
|
|
|
|
substituteInPlace setup.py --replace "answer = input(" "answer = 'y'#"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's|/usr/share/sounds/freedesktop/stereo/|${sound-theme-freedesktop}/share/sounds/freedesktop/stereo/|' setup.py
|
|
|
|
sed -i "s|'persepolis = persepolis.__main__'|'persepolis = persepolis.scripts.persepolis:main'|" setup.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp $src/xdg/com.github.persepolisdm.persepolis.desktop $out/share/applications
|
|
|
|
'';
|
|
|
|
|
2020-07-01 19:58:36 +02:00
|
|
|
# prevent double wrapping
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
nativeBuildInputs = [ wrapQtAppsHook ];
|
|
|
|
|
|
|
|
# feed args to wrapPythonApp
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"--prefix PATH : ${lib.makeBinPath [aria libnotify ]}"
|
2021-01-24 10:19:10 +01:00
|
|
|
"\${qtWrapperArgs[@]}"
|
2020-07-01 19:58:36 +02:00
|
|
|
];
|
2019-04-13 13:22:12 +02:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pulseaudio
|
|
|
|
psutil
|
|
|
|
pyqt5
|
|
|
|
requests
|
|
|
|
setproctitle
|
2020-06-27 00:21:00 +02:00
|
|
|
setuptools
|
2019-04-13 13:22:12 +02:00
|
|
|
sound-theme-freedesktop
|
|
|
|
youtube-dl
|
|
|
|
];
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-10-11 07:55:05 +02:00
|
|
|
description = "Persepolis Download Manager is a GUI for aria2";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://persepolisdm.github.io/";
|
2019-04-13 13:22:12 +02:00
|
|
|
license = licenses.gpl3;
|
2022-02-20 05:20:00 +01:00
|
|
|
maintainers = [ ];
|
2019-04-13 13:22:12 +02:00
|
|
|
};
|
|
|
|
}
|