Re: [Kicad-developers] How to redefine default system footprint/symbols/packages3d/templates search paths at build time?

2020-05-24 Thread Johannes Maibaum
Am Sonntag, den 24.05.2020, 08:36 -0400 schrieb Wayne Stambaugh:
> If you want the default install path to be something other than
> ${CMAKE_INSTALL_PREFIX}, set ${DEFAULT_INSTALL_PATH} during config to
> the desired path.

Since this doesn't work for me, I have opened an issue: 
https://gitlab.com/kicad/code/kicad/-/issues/4529


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] How to redefine default system footprint/symbols/packages3d/templates search paths at build time?

2020-05-24 Thread Johannes Maibaum
Hi Ian,

see below.

Am Sonntag, den 24.05.2020, 14:40 +0100 schrieb Ian McInerney:
> [...]
> 
> Yes, you should be able to put the 3d models in a directory alongside
> the footprints, not inside them, and as long as you set the
> environment variable correctly I believe it will work (this is how I
> have my copy of the git libraries setup).
> 
> [...]
> 
> The templates get a bit difficult. The symbols, footprints and main
> application all install things into the templates folder -
> specifically the template project, the default symbol library table,
> and the default footprint library table. The easiest packaging split
> would be to just keep the 3d models separate and leave the
> templates/symbols/main application all in one package (that is how
> Fedora does it). If you want to get more complicated, you can look at
> how Debian has structured their packages, since they split everything
> into separate packages.

I decided to only split out the 3d models into an extension and set
KISYS3DMOD accordingly. This works right now, and is easy as this part
of the libraries doesn't want to install anything into the template
directory (at least for now).

So, it seems I'm doing it "the Fedora way" now, but I might need to take
a look at "the Debian way" if 3d packages will also come with their own
library table.


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] How to redefine default system footprint/symbols/packages3d/templates search paths at build time?

2020-05-24 Thread Ian McInerney
(see comments inline).

On Sun, May 24, 2020 at 1:34 PM Johannes Maibaum  wrote:

> Hi Ian and Nick,
>
> Am Sonntag, den 24.05.2020, 10:59 +0200 schrieb Nick Østergaard:
> > Maybe some of thar stuff depends on CMAKE_INSTALL_PREFIX in some
> > unexpected way?
>
> It seems indeed that on Linux, setting DEFAULT_INSTALL_PATH doesn't have
> the effect you would be expecting from reading the comment in
> CMakeLists.txt:
>
> > The value of DEFAULT_INSTALL_PATH is expanded in config.h and used in
> > the source code to define the base path for kicad search paths and
> > environment variables.
> (from:
> https://gitlab.com/kicad/code/kicad/-/blob/5.1/CMakeLists.txt#L179)
>
> Should I open a ticket for this?
>
> > lør. 23. maj 2020 22.38 skrev Ian McInerney 
> > :
> > > Have you tried redefining the environment variables to point to the
> > > correct system libraries? Specifically I believe the 4 you need are:
> > > KICAD_TEMPLATE_DIR (the templates)
> > > KICAD_SYMBOL_DIR (the eeschema symbols)
> > > KISYSMOD (the modules)
> > > KISYS3DMOD (the 3d models)
>
> I have tried that just now. It seems to work on the KiCad side, i.e.
> setting those environment variables makes the paths show up as defined
> in Preferences -> Configure paths.
>
> OTOH, flatpak doesn't seem to like the fact that the packages3d
> directory by default resides inside the modules directory. This doesn't
> seem to work, but it's not primarily KiCad's fault and I think I can
> work around this limitation by simply putting those two libraries to two
> completely separate paths.
>

Yes, you should be able to put the 3d models in a directory alongside the
footprints, not inside them, and as long as you set the environment
variable correctly I believe it will work (this is how I have my copy of
the git libraries setup).


> Yet, there seems to be another issue with the templates path at the
> moment, which does not only get stuff installed from the kicad-templates
> package, but there is also a "kicad.pro" (default?) project file coming
> from the main application.
>
> The templates get a bit difficult. The symbols, footprints and main
application all install things into the templates folder - specifically the
template project, the default symbol library table, and the default
footprint library table. The easiest packaging split would be to just keep
the 3d models separate and leave the templates/symbols/main application all
in one package (that is how Fedora does it). If you want to get more
complicated, you can look at how Debian has structured their packages,
since they split everything into separate packages.


>
> So far, thanks for the hints, guys! I will keep experimenting with the
> different variables and see if I can come up with a solution that works
> for now.
>
> For the not-too-distant future (a.k.a. KiCad 6): Are there plans to
> revamp the default library search paths? In general it seems to be a
> quite thought through system, but then there are some rough edges here
> and there, like the packages3d being inside the modules directory, plus
> the templates coming from two different source packages.
>

The 3d model search system is a known limitation, and it is on the future
roadmap to switch over to using library tables like the footprint/symbol
libraries instead of the current hard-coded paths - but that won't be for
v6.


>
> And it would be great to know if the comment regarding
> DEFAULT_INSTALL_PATH is simply not up to date on Linux, or if it is
> indeed a bug that should be fixed?
>
>
> Johannes
>
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] How to redefine default system footprint/symbols/packages3d/templates search paths at build time?

2020-05-24 Thread Wayne Stambaugh
If you want the default install path to be something other than
${CMAKE_INSTALL_PREFIX}, set ${DEFAULT_INSTALL_PATH} during config to
the desired path.

On 5/24/20 4:59 AM, Nick Østergaard wrote:
> Maybe some of thar stuff depends on CMAKE_INSTALL_PREFIX in some
> unexpected way?
> 
> lør. 23. maj 2020 22.38 skrev Ian McInerney  >:
> 
> Have you tried redefining the environment variables to point to the
> correct system libraries? Specifically I believe the 4 you need are:
> KICAD_TEMPLATE_DIR (the templates)
> KICAD_SYMBOL_DIR (the eeschema symbols)
> KISYSMOD (the modules)
> KISYS3DMOD (the 3d models)
> 
> -Ian
> 
> 
> 
> On Sat, May 23, 2020 at 8:50 PM Johannes Maibaum  > wrote:
> 
> Hello KiCad developers,
> 
> TL;DR:
> How can I redefine the default system
> footprint/symbols/packages3d/templates base search paths at
> build time
> using CMake options, so that KISYSMOD, KISYS3DMOD,
> KICAD_SYMBOL_DIR, and
> KICAD_TEMPLATE_DIR all point to the directories:
> 
> 
> $PREFIX/data/share/kicad/{modules,modules/packages3d,symbols,templates}
> 
> instead of:
> 
> $PREFIX/share/kicad/{modules,modules/packages3d,symbols,templates}?
> 
> 
> Longer version:
> 
> First a quick update from flatpak land:
> 
> This week I merged the update to KiCad 5.1.6, fixed the ngspice
> simulator in Eeschema, activated Python scripting, and added user
> documentation to the KiCad flatpak. This means that flatpak
> users by now
> get a KiCad experience that should support close to all features
> that
> the software package offers.
> 
> But what I would like to do in order to make the installed size
> (currently 6.2GB, mostly due to the 3D packages) a little bit more
> controllable from the user perspective [1] is to move the footprint,
> symbols, 3D models, and templates into separate "flatpak app
> extensions"
> which can then be installed or removed independently of the main
> application.
> 
> The way flatpak extensions work is that you basically define an
> "extension mount point" inside your main flatpak (I chose
> /app/data) for
> whatever files and directories an installed extension wants to
> add into
> the bundle.
> 
> I have set up those library extensions already, and they are being
> mounted correctly inside the flatpak at runtime, but so far I wasn't
> able to configure KiCad correctly to use this mount point as
> base dir
> for the data files.
> 
> So far, I have tried either -DDEFAULT_INSTALL_PATH=/app/data or
> -DCMAKE_INSTALL_DATADIR=/app/data during CMake configuration in two
> different test builds (as those two options were appearing in
> CMakeLists.txt and the surrounding lines seemed to indicate that
> they
> were doing what I was trying to achieve).
> 
> Yet, none of the two did change anything (though I didn't try
> using both
> together yet) regarding to the KiCad system paths. This is what
> I see in
> "Preferences->Configure Paths" with or without redefining the CMake
> options:
> 
> KICAD_SYMBOL_DIR=/app/share/kicad/library
> KICAD_TEMPLATE_DIR=/app/share/kicad/template
> KISY3DSMOD=/app/share/kicad/modules/packages3d
> KISYSMOD=/app/share/kicad/modules
> 
> I saw further CMake options which are all marked as advanced,
> thus I did
> not try them yet.
> 
> Is there a way to achieve what I want to do with the current set of
> CMake switches or would this need deeper plumbing?
> 
> 
> Here's my current CMake setup:
> 
> "config-opts": [
>     "-DBOOST_ROOT=/app",
>     "-DDEFAULT_INSTALL_PATH=/app/data",
>     "-DGLEW_INCLUDE_DIR=/app/include/GL",
>     "-DOPENGL_glu_LIBRARY=/app/lib/libGLU.so",
>     "-DKICAD_BUILD_QA_TESTS=OFF",
>     "-DKICAD_SCRIPTING_PYTHON3=ON",
>     "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
> ]
> 
> (--prefix=/app is the default in flatpak land).
> 
> 
> And version info:
> 
> Application: KiCad
> Version: 5.1.6, release build
> Libraries:
>     wxWidgets 3.0.5
>     libcurl/7.65.3-DEV GnuTLS/3.6.13 (NSS/3.46.1) (OpenSSL/1.1.1d)
> zlib/1.2.11 libidn2/2.2.0
> Platform: Linux 5.6.14-arch1-1 x86_64, 64 bit, Little endian, wxGTK
> Build Info:
>     wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8)
> GTK+
> 3.24
>     Boost: 1.66.0
>     OpenCASCADE Community Edition: 6.9.1
>     Curl: 7.65.3-DEV
>     

Re: [Kicad-developers] How to redefine default system footprint/symbols/packages3d/templates search paths at build time?

2020-05-24 Thread Johannes Maibaum
Hi Ian and Nick,

Am Sonntag, den 24.05.2020, 10:59 +0200 schrieb Nick Østergaard:
> Maybe some of thar stuff depends on CMAKE_INSTALL_PREFIX in some
> unexpected way?

It seems indeed that on Linux, setting DEFAULT_INSTALL_PATH doesn't have
the effect you would be expecting from reading the comment in
CMakeLists.txt:

> The value of DEFAULT_INSTALL_PATH is expanded in config.h and used in
> the source code to define the base path for kicad search paths and
> environment variables.
(from: 
https://gitlab.com/kicad/code/kicad/-/blob/5.1/CMakeLists.txt#L179)

Should I open a ticket for this?

> lør. 23. maj 2020 22.38 skrev Ian McInerney 
> :
> > Have you tried redefining the environment variables to point to the
> > correct system libraries? Specifically I believe the 4 you need are:
> > KICAD_TEMPLATE_DIR (the templates)
> > KICAD_SYMBOL_DIR (the eeschema symbols)
> > KISYSMOD (the modules)
> > KISYS3DMOD (the 3d models)

I have tried that just now. It seems to work on the KiCad side, i.e.
setting those environment variables makes the paths show up as defined
in Preferences -> Configure paths.

OTOH, flatpak doesn't seem to like the fact that the packages3d
directory by default resides inside the modules directory. This doesn't
seem to work, but it's not primarily KiCad's fault and I think I can
work around this limitation by simply putting those two libraries to two
completely separate paths.

Yet, there seems to be another issue with the templates path at the
moment, which does not only get stuff installed from the kicad-templates 
package, but there is also a "kicad.pro" (default?) project file coming
from the main application.


So far, thanks for the hints, guys! I will keep experimenting with the
different variables and see if I can come up with a solution that works
for now.

For the not-too-distant future (a.k.a. KiCad 6): Are there plans to
revamp the default library search paths? In general it seems to be a
quite thought through system, but then there are some rough edges here
and there, like the packages3d being inside the modules directory, plus
the templates coming from two different source packages.

And it would be great to know if the comment regarding
DEFAULT_INSTALL_PATH is simply not up to date on Linux, or if it is
indeed a bug that should be fixed?


Johannes


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] How to redefine default system footprint/symbols/packages3d/templates search paths at build time?

2020-05-24 Thread Nick Østergaard
Maybe some of thar stuff depends on CMAKE_INSTALL_PREFIX in some unexpected
way?

lør. 23. maj 2020 22.38 skrev Ian McInerney :

> Have you tried redefining the environment variables to point to the
> correct system libraries? Specifically I believe the 4 you need are:
> KICAD_TEMPLATE_DIR (the templates)
> KICAD_SYMBOL_DIR (the eeschema symbols)
> KISYSMOD (the modules)
> KISYS3DMOD (the 3d models)
>
> -Ian
>
>
>
> On Sat, May 23, 2020 at 8:50 PM Johannes Maibaum 
> wrote:
>
>> Hello KiCad developers,
>>
>> TL;DR:
>> How can I redefine the default system
>> footprint/symbols/packages3d/templates base search paths at build time
>> using CMake options, so that KISYSMOD, KISYS3DMOD, KICAD_SYMBOL_DIR, and
>> KICAD_TEMPLATE_DIR all point to the directories:
>>
>> $PREFIX/data/share/kicad/{modules,modules/packages3d,symbols,templates}
>>
>> instead of:
>>
>> $PREFIX/share/kicad/{modules,modules/packages3d,symbols,templates}?
>>
>>
>> Longer version:
>>
>> First a quick update from flatpak land:
>>
>> This week I merged the update to KiCad 5.1.6, fixed the ngspice
>> simulator in Eeschema, activated Python scripting, and added user
>> documentation to the KiCad flatpak. This means that flatpak users by now
>> get a KiCad experience that should support close to all features that
>> the software package offers.
>>
>> But what I would like to do in order to make the installed size
>> (currently 6.2GB, mostly due to the 3D packages) a little bit more
>> controllable from the user perspective [1] is to move the footprint,
>> symbols, 3D models, and templates into separate "flatpak app extensions"
>> which can then be installed or removed independently of the main
>> application.
>>
>> The way flatpak extensions work is that you basically define an
>> "extension mount point" inside your main flatpak (I chose /app/data) for
>> whatever files and directories an installed extension wants to add into
>> the bundle.
>>
>> I have set up those library extensions already, and they are being
>> mounted correctly inside the flatpak at runtime, but so far I wasn't
>> able to configure KiCad correctly to use this mount point as base dir
>> for the data files.
>>
>> So far, I have tried either -DDEFAULT_INSTALL_PATH=/app/data or
>> -DCMAKE_INSTALL_DATADIR=/app/data during CMake configuration in two
>> different test builds (as those two options were appearing in
>> CMakeLists.txt and the surrounding lines seemed to indicate that they
>> were doing what I was trying to achieve).
>>
>> Yet, none of the two did change anything (though I didn't try using both
>> together yet) regarding to the KiCad system paths. This is what I see in
>> "Preferences->Configure Paths" with or without redefining the CMake
>> options:
>>
>> KICAD_SYMBOL_DIR=/app/share/kicad/library
>> KICAD_TEMPLATE_DIR=/app/share/kicad/template
>> KISY3DSMOD=/app/share/kicad/modules/packages3d
>> KISYSMOD=/app/share/kicad/modules
>>
>> I saw further CMake options which are all marked as advanced, thus I did
>> not try them yet.
>>
>> Is there a way to achieve what I want to do with the current set of
>> CMake switches or would this need deeper plumbing?
>>
>>
>> Here's my current CMake setup:
>>
>> "config-opts": [
>> "-DBOOST_ROOT=/app",
>> "-DDEFAULT_INSTALL_PATH=/app/data",
>> "-DGLEW_INCLUDE_DIR=/app/include/GL",
>> "-DOPENGL_glu_LIBRARY=/app/lib/libGLU.so",
>> "-DKICAD_BUILD_QA_TESTS=OFF",
>> "-DKICAD_SCRIPTING_PYTHON3=ON",
>> "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
>> ]
>>
>> (--prefix=/app is the default in flatpak land).
>>
>>
>> And version info:
>>
>> Application: KiCad
>> Version: 5.1.6, release build
>> Libraries:
>> wxWidgets 3.0.5
>> libcurl/7.65.3-DEV GnuTLS/3.6.13 (NSS/3.46.1) (OpenSSL/1.1.1d)
>> zlib/1.2.11 libidn2/2.2.0
>> Platform: Linux 5.6.14-arch1-1 x86_64, 64 bit, Little endian, wxGTK
>> Build Info:
>> wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+
>> 3.24
>> Boost: 1.66.0
>> OpenCASCADE Community Edition: 6.9.1
>> Curl: 7.65.3-DEV
>> Compiler: GCC 9.2.0 with C++ ABI 1013
>>
>> Build settings:
>> USE_WX_GRAPHICS_CONTEXT=OFF
>> USE_WX_OVERLAY=ON
>> KICAD_SCRIPTING=ON
>> KICAD_SCRIPTING_MODULES=ON
>> KICAD_SCRIPTING_PYTHON3=ON
>> KICAD_SCRIPTING_WXPYTHON=ON
>> KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
>> KICAD_SCRIPTING_ACTION_MENU=ON
>> BUILD_GITHUB_PLUGIN=ON
>> KICAD_USE_OCE=ON
>> KICAD_USE_OCC=OFF
>> KICAD_SPICE=ON
>>
>>
>>
>> Cheers,
>> Johannes
>>
>>
>> [1] To quote a user: "KiCad is AFAIK the biggest flatpak on Flathub" (
>>
>> https://github.com/flathub/org.kicad_pcb.KiCad/issues/19#issuecomment-632761066
>> )
>>
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
> 

Re: [Kicad-developers] How to redefine default system footprint/symbols/packages3d/templates search paths at build time?

2020-05-23 Thread Ian McInerney
Have you tried redefining the environment variables to point to the correct
system libraries? Specifically I believe the 4 you need are:
KICAD_TEMPLATE_DIR (the templates)
KICAD_SYMBOL_DIR (the eeschema symbols)
KISYSMOD (the modules)
KISYS3DMOD (the 3d models)

-Ian



On Sat, May 23, 2020 at 8:50 PM Johannes Maibaum  wrote:

> Hello KiCad developers,
>
> TL;DR:
> How can I redefine the default system
> footprint/symbols/packages3d/templates base search paths at build time
> using CMake options, so that KISYSMOD, KISYS3DMOD, KICAD_SYMBOL_DIR, and
> KICAD_TEMPLATE_DIR all point to the directories:
>
> $PREFIX/data/share/kicad/{modules,modules/packages3d,symbols,templates}
>
> instead of:
>
> $PREFIX/share/kicad/{modules,modules/packages3d,symbols,templates}?
>
>
> Longer version:
>
> First a quick update from flatpak land:
>
> This week I merged the update to KiCad 5.1.6, fixed the ngspice
> simulator in Eeschema, activated Python scripting, and added user
> documentation to the KiCad flatpak. This means that flatpak users by now
> get a KiCad experience that should support close to all features that
> the software package offers.
>
> But what I would like to do in order to make the installed size
> (currently 6.2GB, mostly due to the 3D packages) a little bit more
> controllable from the user perspective [1] is to move the footprint,
> symbols, 3D models, and templates into separate "flatpak app extensions"
> which can then be installed or removed independently of the main
> application.
>
> The way flatpak extensions work is that you basically define an
> "extension mount point" inside your main flatpak (I chose /app/data) for
> whatever files and directories an installed extension wants to add into
> the bundle.
>
> I have set up those library extensions already, and they are being
> mounted correctly inside the flatpak at runtime, but so far I wasn't
> able to configure KiCad correctly to use this mount point as base dir
> for the data files.
>
> So far, I have tried either -DDEFAULT_INSTALL_PATH=/app/data or
> -DCMAKE_INSTALL_DATADIR=/app/data during CMake configuration in two
> different test builds (as those two options were appearing in
> CMakeLists.txt and the surrounding lines seemed to indicate that they
> were doing what I was trying to achieve).
>
> Yet, none of the two did change anything (though I didn't try using both
> together yet) regarding to the KiCad system paths. This is what I see in
> "Preferences->Configure Paths" with or without redefining the CMake
> options:
>
> KICAD_SYMBOL_DIR=/app/share/kicad/library
> KICAD_TEMPLATE_DIR=/app/share/kicad/template
> KISY3DSMOD=/app/share/kicad/modules/packages3d
> KISYSMOD=/app/share/kicad/modules
>
> I saw further CMake options which are all marked as advanced, thus I did
> not try them yet.
>
> Is there a way to achieve what I want to do with the current set of
> CMake switches or would this need deeper plumbing?
>
>
> Here's my current CMake setup:
>
> "config-opts": [
> "-DBOOST_ROOT=/app",
> "-DDEFAULT_INSTALL_PATH=/app/data",
> "-DGLEW_INCLUDE_DIR=/app/include/GL",
> "-DOPENGL_glu_LIBRARY=/app/lib/libGLU.so",
> "-DKICAD_BUILD_QA_TESTS=OFF",
> "-DKICAD_SCRIPTING_PYTHON3=ON",
> "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
> ]
>
> (--prefix=/app is the default in flatpak land).
>
>
> And version info:
>
> Application: KiCad
> Version: 5.1.6, release build
> Libraries:
> wxWidgets 3.0.5
> libcurl/7.65.3-DEV GnuTLS/3.6.13 (NSS/3.46.1) (OpenSSL/1.1.1d)
> zlib/1.2.11 libidn2/2.2.0
> Platform: Linux 5.6.14-arch1-1 x86_64, 64 bit, Little endian, wxGTK
> Build Info:
> wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+
> 3.24
> Boost: 1.66.0
> OpenCASCADE Community Edition: 6.9.1
> Curl: 7.65.3-DEV
> Compiler: GCC 9.2.0 with C++ ABI 1013
>
> Build settings:
> USE_WX_GRAPHICS_CONTEXT=OFF
> USE_WX_OVERLAY=ON
> KICAD_SCRIPTING=ON
> KICAD_SCRIPTING_MODULES=ON
> KICAD_SCRIPTING_PYTHON3=ON
> KICAD_SCRIPTING_WXPYTHON=ON
> KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
> KICAD_SCRIPTING_ACTION_MENU=ON
> BUILD_GITHUB_PLUGIN=ON
> KICAD_USE_OCE=ON
> KICAD_USE_OCC=OFF
> KICAD_SPICE=ON
>
>
>
> Cheers,
> Johannes
>
>
> [1] To quote a user: "KiCad is AFAIK the biggest flatpak on Flathub" (
>
> https://github.com/flathub/org.kicad_pcb.KiCad/issues/19#issuecomment-632761066
> )
>
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] How to redefine default system footprint/symbols/packages3d/templates search paths at build time?

2020-05-23 Thread Johannes Maibaum
Hello KiCad developers,

TL;DR:
How can I redefine the default system
footprint/symbols/packages3d/templates base search paths at build time
using CMake options, so that KISYSMOD, KISYS3DMOD, KICAD_SYMBOL_DIR, and
KICAD_TEMPLATE_DIR all point to the directories:

$PREFIX/data/share/kicad/{modules,modules/packages3d,symbols,templates}

instead of:

$PREFIX/share/kicad/{modules,modules/packages3d,symbols,templates}?


Longer version:

First a quick update from flatpak land:

This week I merged the update to KiCad 5.1.6, fixed the ngspice
simulator in Eeschema, activated Python scripting, and added user
documentation to the KiCad flatpak. This means that flatpak users by now
get a KiCad experience that should support close to all features that
the software package offers.

But what I would like to do in order to make the installed size
(currently 6.2GB, mostly due to the 3D packages) a little bit more
controllable from the user perspective [1] is to move the footprint,
symbols, 3D models, and templates into separate "flatpak app extensions"
which can then be installed or removed independently of the main
application.

The way flatpak extensions work is that you basically define an
"extension mount point" inside your main flatpak (I chose /app/data) for
whatever files and directories an installed extension wants to add into
the bundle.

I have set up those library extensions already, and they are being
mounted correctly inside the flatpak at runtime, but so far I wasn't
able to configure KiCad correctly to use this mount point as base dir
for the data files.

So far, I have tried either -DDEFAULT_INSTALL_PATH=/app/data or
-DCMAKE_INSTALL_DATADIR=/app/data during CMake configuration in two
different test builds (as those two options were appearing in
CMakeLists.txt and the surrounding lines seemed to indicate that they
were doing what I was trying to achieve).

Yet, none of the two did change anything (though I didn't try using both
together yet) regarding to the KiCad system paths. This is what I see in
"Preferences->Configure Paths" with or without redefining the CMake
options:

KICAD_SYMBOL_DIR=/app/share/kicad/library
KICAD_TEMPLATE_DIR=/app/share/kicad/template
KISY3DSMOD=/app/share/kicad/modules/packages3d
KISYSMOD=/app/share/kicad/modules

I saw further CMake options which are all marked as advanced, thus I did
not try them yet.

Is there a way to achieve what I want to do with the current set of
CMake switches or would this need deeper plumbing?


Here's my current CMake setup:

"config-opts": [
"-DBOOST_ROOT=/app",
"-DDEFAULT_INSTALL_PATH=/app/data",
"-DGLEW_INCLUDE_DIR=/app/include/GL",
"-DOPENGL_glu_LIBRARY=/app/lib/libGLU.so",
"-DKICAD_BUILD_QA_TESTS=OFF",
"-DKICAD_SCRIPTING_PYTHON3=ON",
"-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
]

(--prefix=/app is the default in flatpak land).


And version info:

Application: KiCad
Version: 5.1.6, release build
Libraries:
wxWidgets 3.0.5
libcurl/7.65.3-DEV GnuTLS/3.6.13 (NSS/3.46.1) (OpenSSL/1.1.1d)
zlib/1.2.11 libidn2/2.2.0
Platform: Linux 5.6.14-arch1-1 x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+
3.24
Boost: 1.66.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.65.3-DEV
Compiler: GCC 9.2.0 with C++ ABI 1013

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON



Cheers,
Johannes


[1] To quote a user: "KiCad is AFAIK the biggest flatpak on Flathub" (
https://github.com/flathub/org.kicad_pcb.KiCad/issues/19#issuecomment-632761066
)


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp