ppd / freecad-ppd

5 stars 1 forks source link

Snap for LinkStage3/LinkDaily #5

Closed luzpaz closed 2 years ago

luzpaz commented 2 years ago

Over at @realthunder's Assembly3 repo there are build instructions for building Assembly3 https://github.com/realthunder/FreeCAD_assembly3/wiki/Build-Instruction

I was wondering if we could have LS3 or LD Snap package as well ?

ppd commented 2 years ago

Yes, easily. We could create a snap freecad-realthunder or similar and essentially use the same recipes.

ppd commented 2 years ago

@luzpaz What kind of release scheme would you suggest? Nightly builds from LinkDaily+ current Assembly3 into edge? Does that make sense?

And LinkStage3 would go into stable, just like the upstream releases do. Or does it make more sense to not install Assembly3 and leave that to the user?

Also, what package name do you think fits best? freecad-realthunder, freecad-asm3 or something else?

luzpaz commented 2 years ago

Lets ask the author, @realthunder ? What do you prefer the snap package be called?

realthunder commented 2 years ago

Nightly builds from LinkDaily+ current Assembly3 into edge? Does that make sense?

And LinkStage3 would go into stable, just like the upstream releases do. Or does it make more sense to not install Assembly3 and leave that to the user?

edge and stable sounds fine. Thanks a lot. About assembly3, it needs to be bundled with py_slvs extension. I'd prefer to preinstall both if it won't cause any license issue, because you know, slvs is under GPL, while FreeCAD is LGPL.

luzpaz commented 2 years ago

@realthunder to avoid license issues ppd set it up so that py_slvs can be installed via pip

  There are multiple apps/commands included in the snap:

  - `freecad-ppd.freecad`:  Run FreeCAD
  - `freecad-ppd.cmd`:      Run FreeCAD command line interface
  - `freecad-ppd.pip`:      Install python packages for user (not system-wide). E.g.
  `freecad-ppd.pip install py_slvs` for Assembly3.

-from snap info freecad-ppd

realthunder commented 2 years ago

That's great

ppd commented 2 years ago

@realthunder Do your appimages contain py_slvs? The same licence issues would apply here, too.

realthunder commented 2 years ago

Yes, indeed. I probably should do the same. Do you know any similar way to pip install for some specific appimage?

ppd commented 2 years ago

@realthunder You can ship pip inside the appimage and just call it with --target to some suitable directory. Or set the PIP_TARGET env variable. Then, launch FreeCAD with an additional -p to add this directory as a python path. I do something a little more hack-like and install to a directory in Mod because FreeCAD loads all those by default, and I didn't have to ship a launcher script.

see

environment:
[...]
  FREECAD_USER_HOME: $SNAP_USER_COMMON
[...]
  PIP_TARGET: $SNAP_USER_COMMON/Mod/snap-user-packages

@luzpaz It's possible to add a UI to make installing py_slvs a little more accessible to the average user.

realthunder commented 2 years ago

I'll try that out. Thanks!

luzpaz commented 2 years ago

@ppd A UI was would be awesome and I think users would appreciate that more since it's their choice to make.

ppd commented 2 years ago

@realthunder It's also possible to integrate the packaging with your repo directly. Would you be interested in that? Building on each push etc. would also be possible then.

We could set up a package freecad-realthunder and add you, @luzpaz and me as collaborators for maintaining it (there's not much to do except adding a bit of description).

realthunder commented 2 years ago

That'll be great. Do I need to do anything on my side?

ppd commented 2 years ago

I'll create a PR and include the relevant technical details there. Aside from that, you should create a developer account at https://snapcraft.io/, e.g. "realthunder", and also register a snap name, e.g. "freecad-realthunder".

realthunder commented 2 years ago

you should create a developer account at https://snapcraft.io/, e.g. "realthunder", and also register a snap name, e.g. "freecad-realthunder".

Done.

luzpaz commented 2 years ago

Just checking in on where we're at with the realthunder snap (+ edge) ?

ppd commented 2 years ago

I'm on it. PR maybe (hopefully) tomorrow.

ppd commented 2 years ago

@luzpaz Current draft is here: https://github.com/ppd/FreeCAD/tree/realthunder-snap

It's mostly a straight port of this recipe + Assembly3 (currently just HEAD) + an install prompt that calls pip for you to install py_slvs.

luzpaz commented 2 years ago

@ppd how do I install it?

ppd commented 2 years ago

At the moment, nothing's been published. Because this issue does not really belong to freecad-ppd, and a PR has been created (and is in the finishing stages), I've decided to close this issue.

luzpaz commented 2 years ago

@ppd understood but where can I keep an eye out to know when the snap goes live?

ppd commented 2 years ago

It will be built via GitHub actions in realthunder's FreeCAD repo. So just wait for the PR to be merged there (very soon).

ppd commented 2 years ago

@luzpaz The PR in realthunder's repo is now ready. The improvements from there will be included in this repo here also. If you want to test and have a reasonably fast computer, you can build it yourself (see PR) to try it out.

luzpaz commented 2 years ago

Thanks. I don't have a reasonably fast computer, lol. But I may try it anyway!

ppd commented 2 years ago

Well, I could probably upload a revision on Dropbox and send you a link till realthunder gets his own builds going.