unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Plugins for Kicad and other programs
@ 2021-10-03 11:31 phodina via
  2021-10-03 17:37 ` Efraim Flashner
  0 siblings, 1 reply; 3+ messages in thread
From: phodina via @ 2021-10-03 11:31 UTC (permalink / raw)
  To: help-guix

Hi Guix,

Lots of programs now allow users to extend their features through plugins.
On non Guix distros where the user does not have the root priviledges they place
the the content of their plugin in the configuration directory in home directory.

Here's example for Kicad:
~/.kicad_plugins/
~/.kicad/scripting/
~/.kicad/scripting/plugins/

To further complicate things they can have their own plugin manager (e.g. Freecad).

In some cases they contain just some raw data or configs. However, large amount has
some code embedded like shell scripts, python which needs special handling on Guix.

Therefore my question is how to integrate them?

What I propose is with the merge of home services [2], there is now possibility to:

- create package defintion of the plugin
- create home service that will link the plugin into the correct location
within the home dir

There is also an alternative.
I searched the Kicad forum for plugin installation and installation into system dirs
(under /usr) is not recommended [2]. The plugin could be linked into the plugin
location under the /gnu/store/xxx-package. This could be done by inheriting kicad
package and adding the plugins to the input. That approach wouldn't be very flexible,
as it would create to many package combinations.

Also I never installed plugins into system directories on distibutions used before
Guix system so I don't know if it would work.

[1] commit 6ae4644984608b7eff7ab54d3a5787c661d85b2e
[2] https://forum.kicad.info/t/plugin-location-ubuntu-refresh-solved/24396

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Plugins for Kicad and other programs
  2021-10-03 11:31 Plugins for Kicad and other programs phodina via
@ 2021-10-03 17:37 ` Efraim Flashner
  2021-10-04 17:42   ` phodina
  0 siblings, 1 reply; 3+ messages in thread
From: Efraim Flashner @ 2021-10-03 17:37 UTC (permalink / raw)
  To: phodina; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2668 bytes --]

On Sun, Oct 03, 2021 at 11:31:40AM +0000, phodina via wrote:
> Hi Guix,
> 
> Lots of programs now allow users to extend their features through plugins.
> On non Guix distros where the user does not have the root priviledges they place
> the the content of their plugin in the configuration directory in home directory.
> 
> Here's example for Kicad:
> ~/.kicad_plugins/
> ~/.kicad/scripting/
> ~/.kicad/scripting/plugins/
> 
> To further complicate things they can have their own plugin manager (e.g. Freecad).
> 
> In some cases they contain just some raw data or configs. However, large amount has
> some code embedded like shell scripts, python which needs special handling on Guix.
> 
> Therefore my question is how to integrate them?
> 
> What I propose is with the merge of home services [2], there is now possibility to:
> 
> - create package defintion of the plugin
> - create home service that will link the plugin into the correct location
> within the home dir
> 
> There is also an alternative.
> I searched the Kicad forum for plugin installation and installation into system dirs
> (under /usr) is not recommended [2]. The plugin could be linked into the plugin
> location under the /gnu/store/xxx-package. This could be done by inheriting kicad
> package and adding the plugins to the input. That approach wouldn't be very flexible,
> as it would create to many package combinations.
> 
> Also I never installed plugins into system directories on distibutions used before
> Guix system so I don't know if it would work.
> 
> [1] commit 6ae4644984608b7eff7ab54d3a5787c661d85b2e
> [2] https://forum.kicad.info/t/plugin-location-ubuntu-refresh-solved/24396

Following down that thread, I came across this other bit too:

Can you follow the instruction in the document you linked to:

    Open Tools -> Scripting Console in pcbnew
    type import pcbnew; print pcbnew.PLUGIN_DIRECTORIES_SEARCH

What does it tell?
v3xX
Aug 2020

    /usr/share/kicad/scripting
    /usr/share/kicad/scripting/plugins
    /home//.config/kicad/scripting
    /home//.config/kicad/scripting/plugins
    /home//.kicad_plugins
    /home//.kicad/scripting
    /home//.kicad/scripting/plugins

it looks like it should search in this folders.

so it looks like kicad could have a search-path of 'share/kicad' or
'share/kicad/scripting' and the plugins installed to
%out/share/kicad/scripting for each plugin.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Plugins for Kicad and other programs
  2021-10-03 17:37 ` Efraim Flashner
@ 2021-10-04 17:42   ` phodina
  0 siblings, 0 replies; 3+ messages in thread
From: phodina @ 2021-10-04 17:42 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: help-guix

On Sunday, October 3rd, 2021 at 7:37 PM, Efraim Flashner <efraim@flashner.co.il> wrote:

> On Sun, Oct 03, 2021 at 11:31:40AM +0000, phodina via wrote:
>
> > Hi Guix,
> >
> > Lots of programs now allow users to extend their features through plugins.
> >
> > On non Guix distros where the user does not have the root priviledges they place
> >
> > the the content of their plugin in the configuration directory in home directory.
> >
> > Here's example for Kicad:
> >
> > ~/.kicad_plugins/
> >
> > ~/.kicad/scripting/
> >
> > ~/.kicad/scripting/plugins/
> >
> > To further complicate things they can have their own plugin manager (e.g. Freecad).
> >
> > In some cases they contain just some raw data or configs. However, large amount has
> >
> > some code embedded like shell scripts, python which needs special handling on Guix.
> >
> > Therefore my question is how to integrate them?
> >
> > What I propose is with the merge of home services [2], there is now possibility to:
> >
> > -   create package defintion of the plugin
> > -   create home service that will link the plugin into the correct location
> >
> >     within the home dir
> >
> > There is also an alternative.
> >
> > I searched the Kicad forum for plugin installation and installation into system dirs
> >
> > (under /usr) is not recommended [2]. The plugin could be linked into the plugin
> >
> > location under the /gnu/store/xxx-package. This could be done by inheriting kicad
> >
> > package and adding the plugins to the input. That approach wouldn't be very flexible,
> >
> > as it would create to many package combinations.
> >
> > Also I never installed plugins into system directories on distibutions used before
> >
> > Guix system so I don't know if it would work.
> >
> > [1] commit 6ae4644984608b7eff7ab54d3a5787c661d85b2e
> >
> > [2] https://forum.kicad.info/t/plugin-location-ubuntu-refresh-solved/24396
>
> Following down that thread, I came across this other bit too:
>
> Can you follow the instruction in the document you linked to:
>
> Open Tools -> Scripting Console in pcbnew
>
>     type import pcbnew; print pcbnew.PLUGIN_DIRECTORIES_SEARCH
>
>
> What does it tell?
>
> v3xX
>
> Aug 2020
>
> /usr/share/kicad/scripting
>
> /usr/share/kicad/scripting/plugins
>
> /home//.config/kicad/scripting
>
> /home//.config/kicad/scripting/plugins
>
> /home//.kicad_plugins
>
> /home//.kicad/scripting
>
> /home//.kicad/scripting/plugins
>
> it looks like it should search in this folders.
>
> so it looks like kicad could have a search-path of 'share/kicad' or
>
> 'share/kicad/scripting' and the plugins installed to
>
> %out/share/kicad/scripting for each plugin.
>

I checked the output in the scripting console as you suggested and got similar output:

>>> import pcbnew
>>> print pcbnew.PLUGIN_DIRECTORIES_SEARCH
/gnu/store/nvjsh0xdg6r1kkz9n8a3kx4lrg0s1dc3-kicad-5.1.6/share/kicad/scripting
/gnu/store/nvjsh0xdg6r1kkz9n8a3kx4lrg0s1dc3-kicad-5.1.6/share/kicad/scripting/plugins
/home/user/.config/kicad/scripting
/home/user/.config/kicad/scripting/plugins
/home/user/.kicad_plugins
/home/user/.kicad/scripting
/home/user/.kicad/scripting/plugins

So that means the plugins can be installed into the /gnu/store, right?

The question now is how do you symlink the plugin into the kicad plugin directory?

Does it mean the definition of the kicad package has to be modified? By that I mean create a new package definition, inherit kicad and add the plugin to the inputs? Don't think this approach will scale nicely.

It would be better to let the plugins create the symlinks themselves but this creates the problem that the outputs in /gnu/store are read-only. Therefore plugin package won't create a symlink into the directory inside kicad package.

Or create symlink in the user home directory?

>
> Efraim Flashner efraim@flashner.co.il רנשלפ םירפא
>
> GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
>
> Confidentiality cannot be guaranteed on emails sent or received unencrypted


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-04 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-03 11:31 Plugins for Kicad and other programs phodina via
2021-10-03 17:37 ` Efraim Flashner
2021-10-04 17:42   ` phodina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).