← Back to team overview

kicad-developers team mailing list archive

Re: Github plugin.

 

On 09/21/2013 09:23 PM, Dick Hollenbeck wrote:
> I will fix it if it does not work on linux....


Did that, it works now, and brilliantly.


We had a namespace collision on FPL_CACHE, my destructor was going into LEGACY_PLUGIN's
FPL_CACHE destructor.  Linker did not catch that, because geez, it was thinking it was the
same class.   Have given each FPL_CACHE class a unique name, could have used a namespace
but did not.


Then, I removed PCAD from FP_LIB_TABLE dialog, which does not support Footprint*()
functions.  *In its place I added "Github" plugin.*   This was me pulling the trigger.


It works now.  And it is really exciting.


*I am all for getting our stock footprints on github ASAP!*

Whoever is in charge of those now, please lets rock the footprints!

Please talk to your platform sponsor about getting the PLUGIN to run on the Windows and
OSX platforms.  I don't have those, and will not be helping more than I have.  I wrote
CMakeModules/download_openssl.cmake and it might work with minor edits if you have perl on
your windows system because the damn openssl Configure program uses perl.  Otherwise if
you have access to precompiled openssl libs and headers another way, you can force the
issue at or around line 31 of pcbnew/github/CMakeLists.txt by defining
OPENSSL_INCLUDE_DIR and OPENSSL_LIBRARIES cmake symbols.

Sort of like this:

set( OPENSSL_INCLUDE_DIR
    ${PREFIX}/include
    CACHE FILEPATH "OPENSSL include directory"
    )

set( OPENSSL_LIBRARIES
    ${PREFIX}/lib/libssl.a
    ${PREFIX}/lib/libcrypto.a
    CACHE STRING "OPENSSL libraries"
    )

Using the plugin:

Simply add a row to your fp lib table, either global or project, for each github repo that
has pretty footprints in it.  Any file in that repo, regardless of directory level, that
ends in "kicad_mod" will be interpreted as a footprint in that abstract library.

If there is a name collision because you have more than one directory level, the last guy
wins.  (So don't do that.)

If you run scripts/libconvert.py to generate some pretty footprints from existing ones,
you can push them to a github repo and you are ready to go.  You can also simply export
footprints into a common directory, since the pretty format is the same as the *.kicad_mod
format.  Then make it into a repo and push it to github.com with help from their website.


The fp lib table editor can copy rows to and from a spreadsheet, so if you want to load
this CSV row into a spreadsheet and then copy from there into your table, you have a valid
github library record:

github,Github,https://github.com/liftoff-sr/pretty_footprints

Or use this table as your project table for instance, already in s-expression form:

(name github)(type Github)(uri https://github.com/liftoff-sr/pretty_footprints)(options
"")(descr ""))

I think a project table is stored in your project directory.  The global table is in your
home directory.  Project trumps global on conflict.

The choice of "github" as the library nickname (name) was short sighted.

The plugin uses https, so probably will work from behind most firewalls.
The plugin is READONLY.  I expect some repo manager to maintain a local *.pretty (aka
Kicad) library type locally on his/her disk, and simply push to github from there.  There
will also be the whole fork, then pull request thing going on the github works.

I started something here.  I will not be in a position to add a lot of new features to it.
 There will be others that step in and can do that.  The thing is only about 200 lines of
C++ code, and that is its brilliance.

I don't see where this plugin is any slower than any other plugin, and in fact it may be
faster in most situations  (due to the trick I used), especially after we start caching
plugin instances.

You will be quite surprized and you will feel a greater sense of KiCad community because
there will be a lot more footprint sharing I hope.

The success of this technology will be determined by leadership.

		"Footprint leadership!"    :)

We need someone (else) to take up documentation and recommendations on how to make this
easy and how to best maximize sharing.


Enjoy,

Dick



Follow ups