2019-06-16 21:59:06 +02:00
|
|
|
{ stdenv, 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 ]}"
|
|
|
|
''''${qtWrapperArgs[@]}''
|
|
|
|
];
|
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;
|
|
|
|
maintainers = [ maintainers.linarcx ];
|
|
|
|
};
|
|
|
|
}
|