Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 665500 - sci-electronics/kicad-5.0.0: add opencascade and USE=openmp support
Summary: sci-electronics/kicad-5.0.0: add opencascade and USE=openmp support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Zoltan Puskas
URL:
Whiteboard:
Keywords:
: 666172 (view as bug list)
Depends on: 665432
Blocks: 666172
  Show dependency tree
 
Reported: 2018-09-08 14:00 UTC by Fabio Rossi
Modified: 2018-09-27 13:37 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kicad-5.0.0.ebuild (kicad-5.0.0.ebuild,3.07 KB, text/plain)
2018-09-08 14:00 UTC, Fabio Rossi
Details
metadata.xml (metadata.xml,1.15 KB, text/xml)
2018-09-08 14:01 UTC, Fabio Rossi
Details
kicad-5.0.0.ebuild (kicad-5.0.0.ebuild,2.96 KB, text/plain)
2018-09-09 07:45 UTC, Fabio Rossi
Details
kicad-5.0.0.ebuild (kicad-5.0.0.ebuild,3.18 KB, text/plain)
2018-09-09 12:53 UTC, Fabio Rossi
Details
kicad-5.0.0.ebuild (kicad-5.0.0.ebuild,3.42 KB, text/plain)
2018-09-14 08:14 UTC, Fabio Rossi
Details
kicad-5.0.0-curl.patch (kicad-5.0.0-curl.patch,556 bytes, patch)
2018-09-14 08:15 UTC, Fabio Rossi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Rossi 2018-09-08 14:00:06 UTC
I have improved the latest kicad-5.0.0 ebuild with the following changes:

* Added support for the openmp useflag, the CMakeLists.txt checks for openmp support (but cannot be disabled) so I have only added the tc-check-openmp() function to check the compiler and warn the user in pkg_setup()

* The support to 3d STEP and IGES models is provided also by opencascade. Ideally it would be nice to use the 3d useflag already used by other packages without the need to have oce. But in that way the priority is defined by the ebuild developer and not by the user. As sci-libs/oce and sci-libs/opencascade can be installed in parallel, the user must be able to choose what package to depend on. For this reason I am proposing to add another useflag (occ) to cover both packages. I prefer opencascade because OCE is lagging behind and its latest version is older than opencascade (OCE 0.18.3 is equivalent to opencascade 6.9.0 but latest is 7.3.0) but upstream kicad developers prefer oce so I set IUSE="+oce occ". 

* The current ebuild in portage has a bug, if USE=-oce the configuration fails because OCE is by default enabled in CmakeLists.txt.

* Currently there is a limitation to amd64 profiles to have oce, I guess that limitation is only related to the keywording of oce ebuild (bug #665432), I have also removed that and added a dependency here to that bug.
Comment 1 Fabio Rossi 2018-09-08 14:00:50 UTC
Created attachment 546278 [details]
kicad-5.0.0.ebuild
Comment 2 Fabio Rossi 2018-09-08 14:01:06 UTC
Created attachment 546280 [details]
metadata.xml
Comment 3 Virgil Dupras (RETIRED) gentoo-dev 2018-09-08 14:18:37 UTC
Oh, that amd64 condition slipped past my net at commit time! I wanted to remove it but I forgot. The profile masks in place already take care of arch-based masking.
Comment 4 Virgil Dupras (RETIRED) gentoo-dev 2018-09-09 00:21:56 UTC
I'm not familiar with OCE and OCC, so I can't comment on the soundness of the idea. On the forms of it, I have three remarks:

1. Isn't it possible to install kicad without OCE or OCC? Your required use is telling us that at least one of them must be set, but not both. That seems wrong to me. I could want "-occ -oce".

2. Where does $CASROOT come from? I see in the opencascade ebuild that a complex setup involves this variable, but it's not clear at all how the variable will end up being defined in portage's build process. A comment explaining it would be appropriate I think.

3. I don't think we need a "elif" chain of the "oce/occ" use flag checks. REQUIRED_USE already made sure that we don't have both. Also, we can use "usex" for oce.

I think I'll fix the "amd64" leftover right now while Zoltan reviews this. It's a glaring mistake that shouldn't have been there.
Comment 5 Larry the Git Cow gentoo-dev 2018-09-09 01:26:41 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1490b92a58144421914e945f326e400074bf2cf2

commit 1490b92a58144421914e945f326e400074bf2cf2
Author:     Virgil Dupras <vdupras@gentoo.org>
AuthorDate: 2018-09-09 01:25:58 +0000
Commit:     Virgil Dupras <vdupras@gentoo.org>
CommitDate: 2018-09-09 01:25:58 +0000

    sci-electronics/kicad: fix oce USE flag
    
    OCE build flag, being ON by default, was not disabled on "-oce". Also,
    it was behind an irrelevant "amd64" condition.
    
    Bug: https://bugs.gentoo.org/665500
    Package-Manager: Portage-2.3.49, Repoman-2.3.10

 sci-electronics/kicad/kicad-5.0.0.ebuild | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Comment 6 Fabio Rossi 2018-09-09 07:44:41 UTC
(In reply to Virgil Dupras from comment #4)

> I'm not familiar with OCE and OCC, so I can't comment on the soundness of
> the idea. On the forms of it, I have three remarks:
> 
> 1. Isn't it possible to install kicad without OCE or OCC? Your required use
> is telling us that at least one of them must be set, but not both. That
> seems wrong to me. I could want "-occ -oce".

Ooops, you are right. I have fixed the ebuild using ?? instead of ^^
 
> 2. Where does $CASROOT come from? I see in the opencascade ebuild that a
> complex setup involves this variable, but it's not clear at all how the
> variable will end up being defined in portage's build process. A comment
> explaining it would be appropriate I think.

The envvar CASROOT is coming from /etc/env.d/50opencascade installed by opencascade ebuild, I don't like that solution but that's it for now.

I have a doubt. If opencascade is going to be built the first time together with kicad, is the new CASROOT envvar propagated in the emerge environment during kicad building?

> 3. I don't think we need a "elif" chain of the "oce/occ" use flag checks.
> REQUIRED_USE already made sure that we don't have both. Also, we can use
> "usex" for oce.

I have seen your latest commit, I have further improved the ebuild simplifying its logic using usex(), attaching a new version

> I think I'll fix the "amd64" leftover right now while Zoltan reviews this.
> It's a glaring mistake that shouldn't have been there.

thanks
Comment 7 Fabio Rossi 2018-09-09 07:45:14 UTC
Created attachment 546338 [details]
kicad-5.0.0.ebuild
Comment 8 Zoltan Puskas 2018-09-09 11:02:44 UTC
The updates to the ebuild seem reasonable, but I have the same concern as Fabio, that a `source /etc/profile` might be needed between emerging opencascade and kicad for the first time, unless portage does that internally.

So while the ebuild looks good, before committing we need to test:
- installing opencascade + kicad works on a system that has not the CASROOT set
- running kicad with opencascade and see that it works
Comment 9 Fabio Rossi 2018-09-09 12:53:34 UTC
further improved the ebuild, new version attached:

* added eclass for tc-check-openmp
* added dep on pixman
* added minimum versions for cairo, pixman and swig dependencies
* curl is always required even with USE="-github" (see my upstream bug https://bugs.launchpad.net/kicad/+bug/1791500)
* curl is only part of DEPEND because upstream builds a static library ("common" defined in common/CMakeLists.txt) which is later linked to all the other modules/libraries
* added -DKICAD_SCRIPTING_ACTION_MENU option
* improved USE=doc support by using targets generated by cmake and added missing documentation files

I have tested kicad with opencascade and I was able to load a .step file as 3d model for a footprint. The test probably is not exhaustive but we should support building of the feature, if something doesn't work as expected probably the user should be redirected upstream (unless it is a problem of building/installation done by Gentoo of course).
Comment 10 Fabio Rossi 2018-09-09 12:53:58 UTC
Created attachment 546400 [details]
kicad-5.0.0.ebuild
Comment 11 Fabio Rossi 2018-09-11 08:52:57 UTC
(In reply to Zoltan Puskas from comment #8)
 
> So while the ebuild looks good, before committing we need to test:
> - installing opencascade + kicad works on a system that has not the CASROOT
> set
> - running kicad with opencascade and see that it works

I have also completed the first task on my system reinstalling opencascade + kicad  in a clean environment. Portage does all the magic behind the scenes so we are safe using CASROOT :-)
Comment 12 Fabio Rossi 2018-09-14 08:14:51 UTC
Created attachment 546898 [details]
kicad-5.0.0.ebuild

* reverted back conditional dependency on curl, upstream confirmed that curl is only needed by github plugin; there is then a configuration bug that requires unconditionally curl, added here the patch proposed also in the upstream bug

* fixed .desktop files categories, the rationale is https://bugs.launchpad.net/kicad/+bug/1791511, upstream prefers to leave kicad in Development category besides Electronics, what do you think?
Comment 13 Fabio Rossi 2018-09-14 08:15:18 UTC
Created attachment 546900 [details, diff]
kicad-5.0.0-curl.patch
Comment 14 Robert Schultz 2018-09-14 12:19:44 UTC
*** Bug 666172 has been marked as a duplicate of this bug. ***
Comment 15 Virgil Dupras (RETIRED) gentoo-dev 2018-09-15 19:13:36 UTC
Thanks Fabio, this looks good to me. I haven't tried it yet, but after Zoltan's thumbs up, I'll be glad to try and then merge this.
Comment 16 Zoltan Puskas 2018-09-23 15:35:45 UTC
Apologies for the late review, was out on vacation.

I've looked at the proposed changes and they look good. I did some minor clean up and the mandatory compile and run tests. PR submitted.
Comment 17 Virgil Dupras (RETIRED) gentoo-dev 2018-09-24 18:39:56 UTC
Ok, great. Waiting for compliance with the new copyright policy and then I'll merge.
Comment 18 Virgil Dupras (RETIRED) gentoo-dev 2018-09-27 13:26:20 UTC
Alright, thanks. I haven't tried to build it (too long) but I trust that you tested it sufficiently Zoltan. I see that the changes in the PR are purely cosmetic, so my prior review still stand.

I see that opencascade isn't keyworded for ~arm64, so I'll have to add a mask in the arm64 profile.
Comment 19 Larry the Git Cow gentoo-dev 2018-09-27 13:37:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e9d688fa4b08833f3c130a41d3e1369cfaf4edc

commit 2e9d688fa4b08833f3c130a41d3e1369cfaf4edc
Author:     Zoltan Puskas <zoltan@sinustrom.info>
AuthorDate: 2018-09-23 12:59:45 +0000
Commit:     Virgil Dupras <vdupras@gentoo.org>
CommitDate: 2018-09-27 13:37:32 +0000

    sci-electronics/kicad: Add USE=occ,openmp, fix curl dependency
    
    Thanks to Fabio Rossi for the authorship of the patch.
    
    Closes: https://bugs.gentoo.org/665500
    Package-Manager: Portage-2.3.48, Repoman-2.3.10
    Signed-off-by: Zoltan Puskas <zoltan@sinustrom.info>
    Closes: https://github.com/gentoo/gentoo/pull/9955
    Signed-off-by: Virgil Dupras <vdupras@gentoo.org>

 sci-electronics/kicad/files/kicad-5.0.0-curl.patch | 23 +++++++++++++
 .../{kicad-5.0.0.ebuild => kicad-5.0.0-r1.ebuild}  | 38 ++++++++++++++--------
 sci-electronics/kicad/metadata.xml                 |  1 +
 3 files changed, 49 insertions(+), 13 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a06a1f5f204423a61aa6d747218685696554d01

commit 5a06a1f5f204423a61aa6d747218685696554d01
Author:     Virgil Dupras <vdupras@gentoo.org>
AuthorDate: 2018-09-27 13:31:03 +0000
Commit:     Virgil Dupras <vdupras@gentoo.org>
CommitDate: 2018-09-27 13:37:32 +0000

    profiles: Mask "occ" on sci-electronics/kicad on arm64
    
    Bug: https://bugs.gentoo.org/665500
    Signed-off-by: Virgil Dupras <vdupras@gentoo.org>

 profiles/arch/arm64/package.use.mask | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)