Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easy to install and package on multiple distros #150

Open
ofenerci opened this issue Oct 4, 2019 · 9 comments
Open

Make it easy to install and package on multiple distros #150

ofenerci opened this issue Oct 4, 2019 · 9 comments

Comments

@ofenerci
Copy link

ofenerci commented Oct 4, 2019

I wonder It is possible to make "optimus-manager" to be available for Debian.

@Mario156090
Copy link

@Askannz anything about this?
I believe this can be very interesting.

@Askannz
Copy link
Owner

Askannz commented Oct 20, 2019

Yes it would possible, since there is no fundamental difference between Debian and Archlinux that would prevent it from working.

However it would be an extra platform to support on my end, and I'll also have to find a way to ship an equivalent to the gdm-prime package for Debian. Not to mention making sure that there is no conflict in version requirements (Debian tends to use older packages). There was already an issue the other day about optimus-manager being broken on Gentoo due to an outdated Python interpreter.

TLDR: possible: yes, one the TODO list: yes, but I can't make any promise due to the additional work required.

@Talkless
Copy link

Talkless commented Nov 6, 2019

Yeah having this on Debian would be very nice, as we don't have even prime-select that Ubuntu has: https://bugs.debian.org/875959 .

@eminfedar
Copy link

Please have support for debian.

@toddwyl
Copy link

toddwyl commented Mar 8, 2020

I successfully install this on Deepin OS which is Debian, just setup from source code and move the conf files from builld floder to the system.
I use like below:

python3 setup.py build
python3 setup.py install
#!/usr/bin/bash
mkdir -p $pkgdir/etc/sddm.conf.d/
mkdir -p $pkgdir/usr/lib/systemd/logind.conf.d/
mkdir -p $pkgdir/etc/lightdm/lightdm.conf.d/
mkdir -p $pkgdir/etc/optimus-manager/
cp modules/optimus-manager.conf "$pkgdir/usr/lib/modprobe.d/optimus-manager.conf"
cp systemd/optimus-manager.service "$pkgdir/usr/lib/systemd/system/optimus-manager.service"
cp optimus-manager.conf "$pkgdir/usr/share/optimus-manager.conf"
cp systemd/logind/10-optimus-manager.conf "$pkgdir/usr/lib/systemd/logind.conf.d/10-optimus-manager.conf"
cp var/startup_mode "$pkgdir/var/lib/optimus-manager/startup_mode"
cp var/requested_mode "$pkgdir/var/lib/optimus-manager/requested_mode"
cp scripts/prime-switch-boot "$pkgdir/usr/bin/prime-switch-boot"
cp scripts/prime-switch "$pkgdir/usr/bin/prime-switch"
cp scripts/prime-offload "$pkgdir/usr/bin/prime-offload"
cp login_managers/sddm/20-optimus-manager.conf "$pkgdir/etc/sddm.conf.d/20-optimus-manager.conf"
cp login_managers/lightdm/20-optimus-manager.conf  "$pkgdir/etc/lightdm/lightdm.conf.d/20-optimus-manager.conf"
cp config/xorg-intel.conf "$pkgdir/etc/optimus-manager/xorg-intel.conf"
cp config/xorg-nvidia.conf "$pkgdir/etc/optimus-manager/xorg-nvidia.conf"
cp config/xsetup-intel.sh "$pkgdir/etc/optimus-manager/xsetup-intel.sh"
cp config/xsetup-nvidia.sh "$pkgdir/etc/optimus-manager/xsetup-nvidia.sh"
cp config/nvidia-enable.sh "$pkgdir/etc/optimus-manager/nvidia-enable.sh"
cp config/nvidia-disable.sh "$pkgdir/etc/optimus-manager/nvidia-disable.sh"

image

At last, I install the optimus-manager-qt from src.
image

But it maynot turn down the nvidia at all, I feel that my battery lost too fast.

@ofenerci
Copy link
Author

Any solution not turning down nvidia?

@alex-noname
Copy link

https://github.com/Askannz/optimus-manager may explain why: "Note : Do not install this program by cloning this repository and running setup.py, or by using pip directly. Doing so will only install the Python package but leave out important files that optimus-manager needs"

@miklosakos
Copy link

I'm trying to build optimus-manager for a different distro, detailed build instructions would be nice or at least an explanation what is required how to make the software work.

@es20490446e es20490446e changed the title To make it work for Debian distributions? Make it easy to install and package on multiple distros Jul 15, 2024
@nwildner
Copy link
Collaborator

Maybe something for the future but, would setup.py be improved if it got split into a the script and a setup.cfg file like how it is documented into setuptools? - https://setuptools.pypa.io/en/latest/userguide/declarative_config.html

I've had this idea because Debian-likes can benefit from stdeb - https://pypi.org/project/stdeb/, which is able to read the install_requires=['mesa-utils-bin', 'x11-xserver-utils', 'python3', 'python3-dbus'] from a setup.py or the equivalent configuration on lets say setup_debian.cfg and directly build debian packages from a python setuptools script

This could be the starting point for creating an infrastructure to build debian packages, having a setup.py and one config file per distro family maybe?

Or, someone could make a debian package specification that will just manually copy files like it was done by @toddwyl , and add the following packages on the "required" specification: mesa-utils-bin, x11-xserver-utils, python3, python3-dbus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants