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