Working on cad/pcb-rnd and having some challenges

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Working on cad/pcb-rnd and having some challenges

Hannu Vuolasaho
Hello!

I'm working on cad/pcb-rnd port and It is my second port I try to make
so I still have some things to consider. I'm trying to fit OpenBSD and
pcb-rnd packaging model together.

First I'd like to split the package to many parts like it is done
every other platform so that there would be pcb-rnd meta package and
20 plugin packages. Those would provide features from OpenGL gui to
weird file format support. After all pcb-rnd is modular printed
circuit board editor.

In technical view these would be few files and some dependencies.
Everything could be compiled on single run but packed to different
packages. Is there some prior art to study this kind of package? I
tried to make MULTI_PACKAGE but failed spectacularly.

Another problem is that there are hard coded config file paths.
For example: /usr/local/share/pcb-rnd/export_xy.conf
One bad idea is to copy config files to /etc/pcb-rnd if those doesn't
exist and then symlink them there. This works until upstream changes
the default configs and the copied and symlinked files don't match
resulting breaking the software without user interaction.

So am I trying to do something stupid or am I missing some small info?

Home page for pcb-rnd: http://repo.hu/projects/pcb-rnd/index.html
Packaging summary:
http://repo.hu/projects/pcb-rnd/developer/packaging/packages.html

Best regards,
Hannu Vuolasaho

Reply | Threaded
Open this post in threaded view
|

Re: Working on cad/pcb-rnd and having some challenges

Stuart Henderson
On 2019/02/17 14:36, Hannu Vuolasaho wrote:

> Hello!
>
> I'm working on cad/pcb-rnd port and It is my second port I try to make
> so I still have some things to consider. I'm trying to fit OpenBSD and
> pcb-rnd packaging model together.
>
> First I'd like to split the package to many parts like it is done
> every other platform so that there would be pcb-rnd meta package and
> 20 plugin packages. Those would provide features from OpenGL gui to
> weird file format support. After all pcb-rnd is modular printed
> circuit board editor.
>
> In technical view these would be few files and some dependencies.
> Everything could be compiled on single run but packed to different
> packages. Is there some prior art to study this kind of package? I
> tried to make MULTI_PACKAGE but failed spectacularly.

"compiled on single run but packed to different packages" is exactly
what MULTI_PACKAGES is for. There are a number of examples in the tree
but the easily found ones (php, etc) are a bit complicated - for a
simpler example try databases/libdbi-drivers or mail/courier-authlib.

> Another problem is that there are hard coded config file paths.
> For example: /usr/local/share/pcb-rnd/export_xy.conf
> One bad idea is to copy config files to /etc/pcb-rnd if those doesn't
> exist and then symlink them there. This works until upstream changes
> the default configs and the copied and symlinked files don't match
> resulting breaking the software without user interaction.

Normally we would have the program look directly in ${SYSCONFDIR}/pcb-rnd
(aka /etc/pcb-rnd) for the files at runtime. Have the package install the
default files to ${PREFIX}/share/examples/pcb-rnd and use @sample lines
to copy them into ${SYSCONFDIR}. For example in the PLIST file,

share/examples/pcb-rnd/
${SYSCONFDIR}/pcb-rnd/
share/examples/pcb-rnd/somefile
${SYSCONFDIR}/pcb-rnd/somefile

etc. When a package is updated, any files in ${SYSCONFDIR} which have
not been edited by the user are automatically updated. If the user has
edited a file *and* the upstream file has changed, they will have to
merge changes themselves if needed (pkg_add will show a warning).

If it would be very invasive to patch to use ${SYSCONFDIR}/pcb-rnd at
runtime, you could alternatively symlink share/pcb-rnd -> ${SYSCONFDIR}/pcb-rnd
(and as above, install default files to share/examples and use the @sample
mechanism to copy into place), but it would be better to avoid that if
at all possible (it will be hard to change the symlink to a real directory
later due to pkg_add limitations).

Hope this helps.

> So am I trying to do something stupid or am I missing some small info?
>
> Home page for pcb-rnd: http://repo.hu/projects/pcb-rnd/index.html
> Packaging summary:
> http://repo.hu/projects/pcb-rnd/developer/packaging/packages.html
>
> Best regards,
> Hannu Vuolasaho
>