2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildPythonApplication, fetchFromGitHub, makeWrapper
|
2019-04-13 11:22:12 +00:00
|
|
|
, aria
|
|
|
|
, libnotify
|
|
|
|
, pulseaudio
|
|
|
|
, psutil
|
|
|
|
, pyqt5
|
|
|
|
, requests
|
|
|
|
, setproctitle
|
2020-06-26 22:21:00 +00:00
|
|
|
, setuptools
|
2019-04-13 11:22:12 +00:00
|
|
|
, sound-theme-freedesktop
|
2020-07-01 17:58:36 +00:00
|
|
|
, wrapQtAppsHook
|
2019-04-13 11:22:12 +00:00
|
|
|
, youtube-dl
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "persepolis";
|
2019-09-28 02:51:43 +00:00
|
|
|
version = "3.2.0";
|
2019-04-13 11:22:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "persepolisdm";
|
|
|
|
repo = "persepolis";
|
2019-09-08 23:38:31 +00:00
|
|
|
rev = version;
|
2019-09-28 02:51:43 +00:00
|
|
|
sha256 = "1rh7q432ynbysapsd075nif975ync71icpb71x2mb4j8jx1vzs45";
|
2019-04-13 11:22:12 +00:00
|
|
|
};
|
|
|
|
|
2019-09-28 02:51:43 +00:00
|
|
|
# see: https://github.com/persepolisdm/persepolis/blob/3.2.0/setup.py#L130
|
2019-04-13 11:22:12 +00: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 17:58:36 +00:00
|
|
|
# prevent double wrapping
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
nativeBuildInputs = [ wrapQtAppsHook ];
|
|
|
|
|
|
|
|
# feed args to wrapPythonApp
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"--prefix PATH : ${lib.makeBinPath [aria libnotify ]}"
|
2021-01-24 09:19:10 +00:00
|
|
|
"\${qtWrapperArgs[@]}"
|
2020-07-01 17:58:36 +00:00
|
|
|
];
|
2019-04-13 11:22:12 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pulseaudio
|
|
|
|
psutil
|
|
|
|
pyqt5
|
|
|
|
requests
|
|
|
|
setproctitle
|
2020-06-26 22:21:00 +00:00
|
|
|
setuptools
|
2019-04-13 11:22:12 +00:00
|
|
|
sound-theme-freedesktop
|
|
|
|
youtube-dl
|
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-10-11 05:55:05 +00:00
|
|
|
description = "Persepolis Download Manager is a GUI for aria2";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://persepolisdm.github.io/";
|
2019-04-13 11:22:12 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = [ maintainers.linarcx ];
|
|
|
|
};
|
|
|
|
}
|