commit:     5970cc0a59385b25c6b08bc50f37d29e4a73756e
Author:     Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail <DOT> com>
AuthorDate: Fri Mar  7 21:33:55 2025 +0000
Commit:     Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me>
CommitDate: Tue Mar 11 17:43:46 2025 +0000
URL:        https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=5970cc0a

net-misc/onedrivegui: use distutil-r1 functions instead

Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail.com>
Closes: https://github.com/gentoo/dlang/pull/136
Signed-off-by: Andrei Horodniceanu <a.horodniceanu <AT> proton.me>

 net-misc/onedrivegui/files/OneDriveGUI.desktop   |  7 ---
 net-misc/onedrivegui/files/setup-onedrivegui.cfg | 40 -------------
 net-misc/onedrivegui/files/setup-onedrivegui.py  |  6 --
 net-misc/onedrivegui/onedrivegui-1.0.3-r2.ebuild | 46 ---------------
 net-misc/onedrivegui/onedrivegui-1.0.3-r3.ebuild | 69 ++++++++++++++++++++++
 net-misc/onedrivegui/onedrivegui-1.1.1-r1.ebuild | 46 ---------------
 net-misc/onedrivegui/onedrivegui-1.1.1-r2.ebuild | 69 ++++++++++++++++++++++
 net-misc/onedrivegui/onedrivegui-9999.ebuild     | 75 ++++++++++++++++--------
 8 files changed, 187 insertions(+), 171 deletions(-)

diff --git a/net-misc/onedrivegui/files/OneDriveGUI.desktop 
b/net-misc/onedrivegui/files/OneDriveGUI.desktop
deleted file mode 100644
index b87b5de..0000000
--- a/net-misc/onedrivegui/files/OneDriveGUI.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Name=OneDriveGUI
-StartupNotify=true
-Exec=OneDriveGUI
-Terminal=false
-Icon=/usr/share/pixmaps/OneDriveGUI.png
-Type=Application
\ No newline at end of file

diff --git a/net-misc/onedrivegui/files/setup-onedrivegui.cfg 
b/net-misc/onedrivegui/files/setup-onedrivegui.cfg
deleted file mode 100644
index eb1af44..0000000
--- a/net-misc/onedrivegui/files/setup-onedrivegui.cfg
+++ /dev/null
@@ -1,40 +0,0 @@
-[metadata]
-name = OneDriveGUI
-version = _VERSION
-author = bpozdena
-author_email = [email protected]
-description = A simple GUI for OneDrive Linux client with multi-account 
support. 
-long_description = file: README.md
-license = GPL-3.0
-license_files = LICENSE
-long_description_content_type = text/markdown
-url = https://github.com/bpozdena/OneDriveGUI
-project_urls =
-    Bug Tracker = https://github.com/bpozdena/OneDriveGUI/-/issues
-    repository = https://github.com/bpozdena/OneDriveGUI
-classifiers =
-    Programming Language :: Python :: 3
-
-[options]
-python_requires = >=3.8
-packages = find:
-install_requires=
-    PySide6_Essentials
-    requests
-
-[options.packages.find]
-exclude =
-    tests
-
-[options.entry_points]
-console_scripts =
-    OneDriveGUI= src.OneDriveGUI:main
-
-[options.data_files]
-lib/OneDriveGUI/resource = src/resources/default_config
-lib/OneDriveGUI/resource/images = src/resources/images/*.*
-lib/OneDriveGUI/ui = src/ui/*.*
-share/pixmaps/ = 
-    src/resources/images/OneDriveGUI.png
-share/applications/ = 
-    src/OneDriveGUI.desktop
\ No newline at end of file

diff --git a/net-misc/onedrivegui/files/setup-onedrivegui.py 
b/net-misc/onedrivegui/files/setup-onedrivegui.py
deleted file mode 100644
index 45f160d..0000000
--- a/net-misc/onedrivegui/files/setup-onedrivegui.py
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env python
-
-import setuptools
-
-if __name__ == "__main__":
-    setuptools.setup()
\ No newline at end of file

diff --git a/net-misc/onedrivegui/onedrivegui-1.0.3-r2.ebuild 
b/net-misc/onedrivegui/onedrivegui-1.0.3-r2.ebuild
deleted file mode 100644
index 71ac84a..0000000
--- a/net-misc/onedrivegui/onedrivegui-1.0.3-r2.ebuild
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-M_PN=OneDriveGUI
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=(python3_{9..13})
-
-inherit desktop distutils-r1
-if [[ ${PV} == "9999" ]]; then
-       EGIT_REPO_URI="https://github.com/bpozdena/${M_PN}.git";
-       inherit git-r3
-else
-       
SRC_URI="https://github.com/bpozdena/${M_PN}/archive/refs/tags/v${PV}.tar.gz -> 
${PN}-${PV}.tar.gz"
-       KEYWORDS="~amd64"
-    S="${WORKDIR}/${M_PN}-${PV}"
-fi
-
-DESCRIPTION="A simple GUI for OneDrive Linux client, with multi-account 
support."
-HOMEPAGE="https://github.com/bpozdena/OneDriveGUI";
-
-RDEPEND="<net-misc/onedrive-2.5
-       dev-python/requests
-       dev-python/pyside6[gui(+),webengine(+),widgets(+)]
-"
-
-LICENSE="GPL-3"
-SLOT="0"
-
-src_prepare() {
-    cp "${FILESDIR}/setup-onedrivegui.py" "${S}/setup.py" || die
-    cp "${FILESDIR}/setup-onedrivegui.cfg" "${S}/setup.cfg" || die
-    cp "${FILESDIR}/OneDriveGUI.desktop" "${S}/src/OneDriveGUI.desktop" || die
-
-    if [[ ${PV} == "9999" ]]; then
-               #fix python package version
-               sed -i "s/version = _VERSION/version = 9999/g" "${S}/setup.cfg" 
|| die
-       else
-               #fix python package version
-               sed -i "s/version = _VERSION/version = ${PV}/g" 
"${S}/setup.cfg" || die
-       fi
-
-    default
-}
\ No newline at end of file

diff --git a/net-misc/onedrivegui/onedrivegui-1.0.3-r3.ebuild 
b/net-misc/onedrivegui/onedrivegui-1.0.3-r3.ebuild
new file mode 100644
index 0000000..b8527b7
--- /dev/null
+++ b/net-misc/onedrivegui/onedrivegui-1.0.3-r3.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+M_PN=OneDriveGUI
+DISTUTILS_USE_PEP517=no
+PYTHON_COMPAT=(python3_{10..13})
+
+DESCRIPTION="A simple GUI for OneDrive Linux client, with multi-account 
support."
+HOMEPAGE="https://github.com/bpozdena/OneDriveGUI";
+LICENSE="GPL-3"
+SLOT="0"
+
+inherit desktop distutils-r1 xdg-utils
+
+if [[ ${PV} == "9999" ]]; then
+       EGIT_REPO_URI="https://github.com/bpozdena/${M_PN}.git";
+       inherit git-r3
+else
+       
SRC_URI="https://github.com/bpozdena/${M_PN}/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64"
+       S="${WORKDIR}/${M_PN}-${PV}"
+fi
+
+RESTRICT=test
+
+RDEPEND="<net-misc/onedrive-2.5
+       dev-python/requests[${PYTHON_USEDEP}]
+       dev-python/pyside[gui(+),webengine(+),widgets(+),${PYTHON_USEDEP}]
+"
+
+python_install() {
+       python_moduleinto "${M_PN}"
+       # Slightly inefficient as it duplicates the resource folder across
+       # python implementations but the project relies on those files being
+       # placed relative to the code.
+       python_domodule src/*
+
+       # The main file has to live alongside the ui module so make a
+       # separate script as the entry point.
+       #
+       # There is no main function and its implementation in the code is
+       # non-trivial so make a shell script.
+       local main_file="$(python_get_sitedir)/${M_PN}/${M_PN}.py"
+       python_newexe - "${M_PN}" <<-EOF
+               #!/bin/sh
+               exec "${EPREFIX}/usr/bin/${EPYTHON}" "${main_file}" "\${@}"
+       EOF
+}
+
+python_install_all() {
+       doicon src/resources/images/"${M_PN}.png"
+       make_desktop_entry "${M_PN}" "${M_PN}" "${M_PN}" \
+                                          "Network;FileTransfer;Monitor" \
+                                          "StartupNotify=true\nTerminal=false"
+
+       distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+       xdg_desktop_database_update
+       xdg_icon_cache_update
+}
+
+pkg_postrm() {
+       xdg_desktop_database_update
+       xdg_icon_cache_update
+}

diff --git a/net-misc/onedrivegui/onedrivegui-1.1.1-r1.ebuild 
b/net-misc/onedrivegui/onedrivegui-1.1.1-r1.ebuild
deleted file mode 100644
index f73ebad..0000000
--- a/net-misc/onedrivegui/onedrivegui-1.1.1-r1.ebuild
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-M_PN=OneDriveGUI
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=(python3_{9..13})
-
-inherit desktop distutils-r1
-if [[ ${PV} == "9999" ]]; then
-       EGIT_REPO_URI="https://github.com/bpozdena/${M_PN}.git";
-       inherit git-r3
-else
-       
SRC_URI="https://github.com/bpozdena/${M_PN}/archive/refs/tags/v${PV}.tar.gz -> 
${PN}-${PV}.tar.gz"
-       KEYWORDS="~amd64"
-    S="${WORKDIR}/${M_PN}-${PV}"
-fi
-
-DESCRIPTION="A simple GUI for OneDrive Linux client, with multi-account 
support."
-HOMEPAGE="https://github.com/bpozdena/OneDriveGUI";
-
-RDEPEND=">=net-misc/onedrive-2.5
-       dev-python/requests
-       dev-python/pyside6[gui(+),webengine(+),widgets(+)]
-"
-
-LICENSE="GPL-3"
-SLOT="0"
-
-src_prepare() {
-    cp "${FILESDIR}/setup-onedrivegui.py" "${S}/setup.py" || die
-    cp "${FILESDIR}/setup-onedrivegui.cfg" "${S}/setup.cfg" || die
-    cp "${FILESDIR}/OneDriveGUI.desktop" "${S}/src/OneDriveGUI.desktop" || die
-
-    if [[ ${PV} == "9999" ]]; then
-               #fix python package version
-               sed -i "s/version = _VERSION/version = 9999/g" "${S}/setup.cfg" 
|| die
-       else
-               #fix python package version
-               sed -i "s/version = _VERSION/version = ${PV}/g" 
"${S}/setup.cfg" || die
-       fi
-
-    default
-}
\ No newline at end of file

diff --git a/net-misc/onedrivegui/onedrivegui-1.1.1-r2.ebuild 
b/net-misc/onedrivegui/onedrivegui-1.1.1-r2.ebuild
new file mode 100644
index 0000000..fadf5a7
--- /dev/null
+++ b/net-misc/onedrivegui/onedrivegui-1.1.1-r2.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+M_PN=OneDriveGUI
+DISTUTILS_USE_PEP517=no
+PYTHON_COMPAT=(python3_{10..13})
+
+DESCRIPTION="A simple GUI for OneDrive Linux client, with multi-account 
support."
+HOMEPAGE="https://github.com/bpozdena/OneDriveGUI";
+LICENSE="GPL-3"
+SLOT="0"
+
+inherit desktop distutils-r1 xdg-utils
+
+if [[ ${PV} == "9999" ]]; then
+       EGIT_REPO_URI="https://github.com/bpozdena/${M_PN}.git";
+       inherit git-r3
+else
+       
SRC_URI="https://github.com/bpozdena/${M_PN}/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64"
+       S="${WORKDIR}/${M_PN}-${PV}"
+fi
+
+RESTRICT=test
+
+RDEPEND=">=net-misc/onedrive-2.5
+       dev-python/requests[${PYTHON_USEDEP}]
+       dev-python/pyside[gui(+),webengine(+),widgets(+),${PYTHON_USEDEP}]
+"
+
+python_install() {
+       python_moduleinto "${M_PN}"
+       # Slightly inefficient as it duplicates the resource folder across
+       # python implementations but the project relies on those files being
+       # placed relative to the code.
+       python_domodule src/*
+
+       # The main file has to live alongside the ui module so make a
+       # separate script as the entry point.
+       #
+       # There is no main function and its implementation in the code is
+       # non-trivial so make a shell script.
+       local main_file="$(python_get_sitedir)/${M_PN}/${M_PN}.py"
+       python_newexe - "${M_PN}" <<-EOF
+               #!/bin/sh
+               exec "${EPREFIX}/usr/bin/${EPYTHON}" "${main_file}" "\${@}"
+       EOF
+}
+
+python_install_all() {
+       doicon src/resources/images/"${M_PN}.png"
+       make_desktop_entry "${M_PN}" "${M_PN}" "${M_PN}" \
+                                          "Network;FileTransfer;Monitor" \
+                                          "StartupNotify=true\nTerminal=false"
+
+       distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+       xdg_desktop_database_update
+       xdg_icon_cache_update
+}
+
+pkg_postrm() {
+       xdg_desktop_database_update
+       xdg_icon_cache_update
+}

diff --git a/net-misc/onedrivegui/onedrivegui-9999.ebuild 
b/net-misc/onedrivegui/onedrivegui-9999.ebuild
index f73ebad..fadf5a7 100644
--- a/net-misc/onedrivegui/onedrivegui-9999.ebuild
+++ b/net-misc/onedrivegui/onedrivegui-9999.ebuild
@@ -4,43 +4,66 @@
 EAPI=8
 
 M_PN=OneDriveGUI
+DISTUTILS_USE_PEP517=no
+PYTHON_COMPAT=(python3_{10..13})
 
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=(python3_{9..13})
+DESCRIPTION="A simple GUI for OneDrive Linux client, with multi-account 
support."
+HOMEPAGE="https://github.com/bpozdena/OneDriveGUI";
+LICENSE="GPL-3"
+SLOT="0"
+
+inherit desktop distutils-r1 xdg-utils
 
-inherit desktop distutils-r1
 if [[ ${PV} == "9999" ]]; then
        EGIT_REPO_URI="https://github.com/bpozdena/${M_PN}.git";
        inherit git-r3
 else
-       
SRC_URI="https://github.com/bpozdena/${M_PN}/archive/refs/tags/v${PV}.tar.gz -> 
${PN}-${PV}.tar.gz"
+       
SRC_URI="https://github.com/bpozdena/${M_PN}/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz"
        KEYWORDS="~amd64"
-    S="${WORKDIR}/${M_PN}-${PV}"
+       S="${WORKDIR}/${M_PN}-${PV}"
 fi
 
-DESCRIPTION="A simple GUI for OneDrive Linux client, with multi-account 
support."
-HOMEPAGE="https://github.com/bpozdena/OneDriveGUI";
+RESTRICT=test
 
 RDEPEND=">=net-misc/onedrive-2.5
-       dev-python/requests
-       dev-python/pyside6[gui(+),webengine(+),widgets(+)]
+       dev-python/requests[${PYTHON_USEDEP}]
+       dev-python/pyside[gui(+),webengine(+),widgets(+),${PYTHON_USEDEP}]
 "
 
-LICENSE="GPL-3"
-SLOT="0"
+python_install() {
+       python_moduleinto "${M_PN}"
+       # Slightly inefficient as it duplicates the resource folder across
+       # python implementations but the project relies on those files being
+       # placed relative to the code.
+       python_domodule src/*
+
+       # The main file has to live alongside the ui module so make a
+       # separate script as the entry point.
+       #
+       # There is no main function and its implementation in the code is
+       # non-trivial so make a shell script.
+       local main_file="$(python_get_sitedir)/${M_PN}/${M_PN}.py"
+       python_newexe - "${M_PN}" <<-EOF
+               #!/bin/sh
+               exec "${EPREFIX}/usr/bin/${EPYTHON}" "${main_file}" "\${@}"
+       EOF
+}
+
+python_install_all() {
+       doicon src/resources/images/"${M_PN}.png"
+       make_desktop_entry "${M_PN}" "${M_PN}" "${M_PN}" \
+                                          "Network;FileTransfer;Monitor" \
+                                          "StartupNotify=true\nTerminal=false"
+
+       distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+       xdg_desktop_database_update
+       xdg_icon_cache_update
+}
 
-src_prepare() {
-    cp "${FILESDIR}/setup-onedrivegui.py" "${S}/setup.py" || die
-    cp "${FILESDIR}/setup-onedrivegui.cfg" "${S}/setup.cfg" || die
-    cp "${FILESDIR}/OneDriveGUI.desktop" "${S}/src/OneDriveGUI.desktop" || die
-
-    if [[ ${PV} == "9999" ]]; then
-               #fix python package version
-               sed -i "s/version = _VERSION/version = 9999/g" "${S}/setup.cfg" 
|| die
-       else
-               #fix python package version
-               sed -i "s/version = _VERSION/version = ${PV}/g" 
"${S}/setup.cfg" || die
-       fi
-
-    default
-}
\ No newline at end of file
+pkg_postrm() {
+       xdg_desktop_database_update
+       xdg_icon_cache_update
+}

Reply via email to