commit:     2428d9f34aa80f14fd0399a1a88c9e3218f29d03
Author:     Bryce Copeland (truffle) <truffle074 <AT> gmail <DOT> com>
AuthorDate: Mon Sep 29 09:28:39 2025 +0000
Commit:     Bryce <truffle074 <AT> gmail <DOT> com>
CommitDate: Mon Sep 29 09:28:39 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2428d9f3

net-p2p/persepolis: new package, add 5.2.0

Signed-off-by: Bryce Copeland (truffle) <truffle074 <AT> gmail.com>

 net-p2p/persepolis/Manifest                        |  1 +
 .../files/persepolis-5.2.0-fix-executable.patch    | 32 +++++++++++
 net-p2p/persepolis/metadata.xml                    | 12 ++++
 net-p2p/persepolis/persepolis-5.2.0.ebuild         | 65 ++++++++++++++++++++++
 4 files changed, 110 insertions(+)

diff --git a/net-p2p/persepolis/Manifest b/net-p2p/persepolis/Manifest
new file mode 100644
index 0000000000..33b674746f
--- /dev/null
+++ b/net-p2p/persepolis/Manifest
@@ -0,0 +1 @@
+DIST persepolis-5.2.0.tar.gz 1924515 BLAKE2B 
bc40d07f6aa90465a70354a39ea92ceed1fae61575c03106bdb5427f57e20a09a12c9c849a64796abedcf30bd78a8b6be4dd42a087085c2d0bd5b673df24bd7b
 SHA512 
a4f5ca809031bfc7a0cdfe39ad62059b1a33f8bf233480216df99e34fbec9f968a137b33b085ceae529838a265d67fdd988c40785d1c333ec00269fa672cfcc2

diff --git a/net-p2p/persepolis/files/persepolis-5.2.0-fix-executable.patch 
b/net-p2p/persepolis/files/persepolis-5.2.0-fix-executable.patch
new file mode 100644
index 0000000000..ca4d1b0f77
--- /dev/null
+++ b/net-p2p/persepolis/files/persepolis-5.2.0-fix-executable.patch
@@ -0,0 +1,32 @@
+tweaks the executable that comes with persepolis to work better with
+gentoo's python-exec.
+
+by default meson will detect the python executable used to run it, then
+replace @PYTHON@ with that path to be used at runtime. this doesn't work
+with portage's path abstraction. instead this replaces with a generic path
+then relies on 'python_newscript', run in the ebuild, to resolve the
+correct path.
+
+also remove's the hard-coded 'pythonsitepackagedir', python-exec will set
+the system path correctly at runtime.
+
+diff --git a/persepolis/persepolis.py b/persepolis/persepolis.py
+index d5e5b25..67bc72b 100644
+--- a/persepolis/persepolis.py
++++ b/persepolis/persepolis.py
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/python
+ 
+ 
+ # -*- coding: utf-8 -*-
+@@ -19,9 +19,6 @@
+ # this file is created for running persepolis from /usr/bin/ or 
/usr/local/bin/.
+ import sys
+ 
+-pythonsitepackagedir = '@pythonsitepackagedir@'
+-
+ if __name__ == '__main__':
+-    sys.path.append(pythonsitepackagedir)
+     from persepolis.scripts import persepolis
+     persepolis.main()

diff --git a/net-p2p/persepolis/metadata.xml b/net-p2p/persepolis/metadata.xml
new file mode 100644
index 0000000000..c40ac0eaf9
--- /dev/null
+++ b/net-p2p/persepolis/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Bryce Copeland (truffle)</name>
+       </maintainer>
+       <upstream>
+               
<bugs-to>https://github.com/persepolisdm/persepolis/issues</bugs-to>
+               <remote-id type="github">persepolisdm/persepolis</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/net-p2p/persepolis/persepolis-5.2.0.ebuild 
b/net-p2p/persepolis/persepolis-5.2.0.ebuild
new file mode 100644
index 0000000000..1229ab1807
--- /dev/null
+++ b/net-p2p/persepolis/persepolis-5.2.0.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..14} )
+inherit meson python-single-r1 optfeature xdg
+
+DESCRIPTION="Persepolis is a download manager written in Python."
+HOMEPAGE="https://github.com/persepolisdm/persepolis";
+
+if [[ ${PV} == "9999" ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/persepolisdm/persepolis.git";
+else
+       
SRC_URI="https://github.com/persepolisdm/${PN}/archive/refs/tags/${PV}.tar.gz 
-> ${P}.tar.gz"
+       KEYWORDS="~amd64"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+
+DEPEND="
+       dev-python/pyside:6
+       dev-python/requests
+       dev-python/setuptools
+       dev-python/lxml
+       dev-python/pysocks
+       dev-python/beautifulsoup4
+       dev-python/pyopenssl
+       dev-python/certifi
+       dev-python/sip
+       dev-python/urllib3
+       dev-python/setproctitle
+       net-misc/aria2
+       dev-python/dasbus
+"
+RDEPEND="${PYTHON_DEPS} ${DEPEND}"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-5.2.0-fix-executable.patch"
+)
+
+src_configure() {
+       python_setup
+       meson_src_configure
+}
+
+src_install() {
+       meson_src_install
+
+       # removes packaged executable, and replaces with a python-exec version
+       rm "${D}/usr/bin/persepolis" || die
+       python_newscript "persepolis/${PN}.py" "${PN}"
+
+       python_optimize
+}
+
+pkg_postinst() {
+       optfeature "supporting youtube video downloads" net-misc/yt-dlp 
media-video/ffmpeg
+       optfeature "uniform styling between persepolis and other applications" 
X11-themes/adwaita-qt
+
+       xdg_pkg_postinst
+}

Reply via email to