Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions net-misc/onedrivegui/files/OneDriveGUI-fix1.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Name=OneDriveGUI
StartupNotify=true
Exec=OneDriveGUI
Terminal=false
Icon=OneDriveGUI
Type=Application
40 changes: 40 additions & 0 deletions net-misc/onedrivegui/files/setup-onedrivegui-fix1.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[metadata]
name = OneDriveGUI
version = _VERSION
author = bpozdena
author_email = bpozdena@example.org
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
package_dir =
OneDriveGUI = src
install_requires=
PySide6_Essentials
requests

[options.entry_points]
console_scripts =
OneDriveGUI = OneDriveGUI:OneDriveGUI.main

[options.package_data]
OneDriveGUI =
resources/default_config
resources/images/*.png
resources/images/*.ico

[options.data_files]
share/applications/ =
src/OneDriveGUI.desktop
share/icons/hicolor/48x48/apps/ =
src/resources/images/OneDriveGUI.png
6 changes: 6 additions & 0 deletions net-misc/onedrivegui/files/wrapper-module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Wrapper to allow starting by python -m OneDriveGUI"""

from .OneDriveGUI import main

if __name__ == "__main__":
main()
64 changes: 64 additions & 0 deletions net-misc/onedrivegui/onedrivegui-1.1.1-r2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

M_PN=OneDriveGUI

DISTUTILS_SINGLE_IMPL=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=(python3_{9..13})

inherit desktop distutils-r1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From pkgcheck --scan:

  UnusedInherits: version 1.1.1-r2: unused eclass: desktop

A little bit hard to read through everything though ;)

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
!net-misc/onedrivegui-bin
dev-python/requests
dev-python/pyside[gui(+),webengine(+),widgets(+)]
Comment on lines +27 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"

LICENSE="GPL-3"
SLOT="0"

src_prepare() {
cp "${FILESDIR}/setup-onedrivegui.py" "${S}/setup.py" || die
cp "${FILESDIR}/setup-onedrivegui-fix1.cfg" "${S}/setup.cfg" || die
cp "${FILESDIR}/OneDriveGUI-fix1.desktop" "${S}/src/OneDriveGUI.desktop" || die
cp "${FILESDIR}/wrapper-module.py" "${S}/src/__main__.py" || die

#fix python package version
sed -i "s/^version = _VERSION$/version = ${PV}/g" "${S}/setup.cfg" || die

# Remove unused leftovers
rm -f "${S}/src/ui/"*_ui.py || die

# Fix broken image references
sed -i \
-e 's|\.\./\.\./\.\./OneDriveGUI_POC_recovered-multi/|../resources/images/|g' \
"${S}/src/ui/"*.py || die

# Patch file to make it work as a module
sed -i \
-e 's/^from version\b/from .version/' \
-e 's/^from ui\./from .ui./' \
-e '/^GUI_SETTINGS_FILE =/a\'$'\n''gui_settings = None\nglobal_config = None\ntemp_global_config = None\main_window = None' \
-e '/^if __name__ == "__main__":/a\'$'\n'' global gui_settings, global_config, temp_global_config, main_window' \
-e 's/if __name__ == "__main__":/def main():/' \
-e '$a\'$'\n''\nif __name__ == "__main__":\n main()' \
"${S}/src/OneDriveGUI.py" || die
Comment on lines +52 to +59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incredibly ugly and unreadable, perhaps a .patch would be better?


python_fix_shebang "${S}/src/OneDriveGUI.py"

default
}