LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.76k stars 1.14k forks source link

Provide an ebuild for Gentoo #1679

Open allistar opened 2 years ago

allistar commented 2 years ago

Here are the steps I follow to reproduce the issue:

There is currently no easy install process for the Gentoo Linux distribution. It can be built on Gentoo manually by following a set of instructions. It would be useful for Gentoo users if there was an ebuild that automated this so we can "emerge linuxcnc".

Another issue showing steps on how to install on Gentoo is here.

This is what I expected to happen:

To be able to run the command: emerge linuxcnc on Gentoo Linux and have LinuxCNC build and install.

This is what happened instead:

There is no ebuild.

Information about my hardware and software:

allistar commented 2 years ago

An ebuild would live on the main Gentoo repository servers and be mirrored through their network, though I expect that some changes will be necessary to the LinuxCNC code base too. I think the steps for this task are:

Most of that is straight forward apart from the yapps issue. I had to install it using "pip" and I don't think a ebuild should depend on pip and then call pip to install a package. Also, I then needed to modify the installed yapps package. Is one approach to ship yapps with the gentoo ebuild? I expect that'll be python version dependant so not straight forward. The best approach is to also provide a yapps ebuild for Gentoo. Sigh.

jack9603301 commented 2 years ago

I agree. In this way, users can choose which distribution to use Linux CNC. This will enable Gentoo users to build linux CNC on Gentoo. I will continue to track this issue and hope that the community can consider implementing it.

silopolis commented 2 years ago

Hi,

AFAIC, an ebuild would be surely welcome :) Portability is good(c)

Plus, with its optimization bias, Gentoo feels in line with machine control system building...

The only issue I see there is on the community side... Resources and support may be even scarser on a new platform and newcomers may need to have a supplement of motivation to seed this new group of users.

TY

Gahia123 commented 2 years ago

I'll love to experiment with LinuxCNC using gentoo, would feel more comfortable developing some ideas in the future. I've no experience making ebuilds yet, nevertheless with patience and the help of others surely we can succeed; please tell me if there is someone who want to divide the work, wich strategy can we use and make it possible.

allistar commented 2 years ago

I've been using LinuxCNC on Gentoo successfully for a few years. The biggest issue I see with an ebuild is that there's no ebuild for yapps and the LinuxCNC build process requires it. I think we'd need to make a yapps ebuild first.

Gahia123 commented 2 years ago

Which version of yapps do we require? 1 or 2?

allistar commented 2 years ago

When I run "pip show yapps" it returns this:

Name: yapps
Version: 14.4.0
Summary: Yet Another Python Parser System
Home-page: https://github.com/mk-fg/yapps

I had to made one modification of yapps to make it work in Python 3 after installing it.

Gahia123 commented 2 years ago

Reading your Yapps version github and the original author guide, I found that this version is not compatible with python 3. There are two ways to solve it:

  1. Patching your yapps version.
  2. Using this yapps branch.

Which approach do you think is better for the ebuild? Should we upload those ebuilds to gentoo main tree or Guru repository?

allistar commented 2 years ago

I installed yapps on Gentoo using pip. This didn't work on Python 3 but it was a single change to a single file to get it to work. It seems strange that LinuxCNC runs on Python 3 and requires yapps, but yapps doesn't officially work on Python 3.

I think a better approach is to make a yapps ebuild and add a python3 use flag, and if that flag is set them apply a patch that makes it Python3 compatible.

Gahia123 commented 2 years ago

I'll study how to make yapps ebuild, meaby it'll take some time.

andypugh commented 2 years ago

https://forum.linuxcnc.org/9-installing-linuxcnc/46439-linuxcnc-2-9-master-on-gentoo#247908

openlunchbox commented 2 years ago

2.9/Master is now working on Gentoo. Ebuild will be available shortly.

openlunchbox commented 2 years ago

https://sourceforge.net/p/emc/mailman/message/37683768/ if you want to follow on the dev ML

NTULINUX commented 2 years ago

Hello,

I have an ebuild that works, I need to fix docs, implement USE flags, make the CNC menu and do some basic kernel config sanity checks. I might add RTAI ebuilds and modify the LinuxCNC ebuild accordingly to account for both PREEMPT_RT and RTAI but that is down the road, if ever.

It's not perfect:

https://github.com/NTULINUX/ntu_overlay/blob/main/sci-electronics/linuxcnc/linuxcnc-9999.ebuild

edit: The LinuxCNC configs are all missing, so there is no sim axis and stuff.. Only a few of the sample configurations show up. LinuxCNC installs a boat load of .ini files to /usr/share/doc/linuxcnc and these need to be forced in the installation because the Gentoo package manager is not preserving these. The ebuild is going to have a lot of QA notices, but these should be ignored because LinuxCNC actually uses the "doc" directory for the config files, and it's been that way for many years. Changing it now may break a lot of things.

silopolis commented 2 years ago

Le jeu. 28 juil. 2022 à 08:22, NTU @.***> a écrit :

Hello,

I have an ebuild that works,

Great!

I need to fix docs, implement USE flags, make the CNC menu and do some

basic kernel config sanity checks. I might add RTAI ebuilds and modify the LinuxCNC ebuild accordingly to account for both PREEMPT_RT and RTAI but that is down the road, if ever.

More goodness to come 👍🙂

It's not perfect

Even my son isn't 😉

https://github.com/NTULINUX/ntu_overlay/blob/main/sci-electronics/linuxcnc/linuxcnc-9999.ebuild

Could this be put in a gentoo directory in linuxcnc repository? Or is it better in a separate one?

Thanks and congrats again, keep it coming

TY J

NTULINUX commented 2 years ago

The ebuild actually didn't work before because TCLLIBPATH wasn't set, this commit handles that error:

https://github.com/NTULINUX/ntu_overlay/commit/a396ce3b87d5dcb9c67d56a53cfac17a0941a85e

Now it's just basic checks, some QA fixes (doc and USE flag stuff) and better graphical menu support but it's good enough to start with. Cheers!

Oh, as for adding that overlay to your system, this is what my repo config looks like:

$ cat /etc/portage/repos.conf/gentoo.conf

[DEFAULT]
main-repo = gentoo

[gentoo]
location = /var/db/repos/gentoo
sync-type = git
auto-sync = yes
sync-uri = https://anongit.gentoo.org/git/repo/gentoo.git

[ntu_overlay]
location = /var/db/repos/ntu_overlay
sync-type = git
auto-sync = yes
sync-uri = https://github.com/NTULINUX/ntu_overlay.git

More info:

https://wiki.gentoo.org/wiki//etc/portage/repos.conf

My entire Gentoo root filesystem portage config repo is here:

https://github.com/NTULINUX/gentoo_backup

NTULINUX commented 1 month ago

I haven't tested them in awhile but I actually have 2 ebuilds for LinuxCNC on Gentoo:

https://github.com/NTULINUX/ntu_overlay/tree/main/sci-electronics/linuxcnc

One for master, another for 2.9 :)