Page MenuHomeFreeBSD

cad/qcad: Stop setting MAKE_JOBS_UNSAFE by only building release or debug
ClosedPublic

Authored by rakuco on Feb 16 2019, 11:30 PM.

Details

Summary

MAKE_JOBS_UNSAFE is currently needed because we ALL_TARGET is set to the default value "all". This means we will build most of the code twice, in release and debug mode, and only install one of the versions. The parallel build seems to fail when e.g. a library is built in release mode and the debug build assumes it is present as well.

If we choose the right target to pass to make, we can make sure only the code we will use is actually built, and parallel builds work as expected. Some plugins have different names depending on the build type, so add some PLIST_SUB trickery to handle that.

While here, remove the .desktop file from the plist, as the install-desktop-entries target already adds an entry to the plist (make check-plist actually fails right now because the file does not even exist at the time it is run).

Test Plan

I've built the port with and without WITH_DEBUG, with MAKE_JOBS_NUMBER=56 and MAKE_JOBS_NUMBER=2, and all builds worked correctly. The debug package also seems to work even though some plugins have different names (I was able to import a DXF file in it).

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

cad/qcad/Makefile
35–44 ↗(On Diff #54000)

Note that in order to support WITH_DEBUG_PORTS, WITH_DEBUG should never be tested for before including bsd.port.options.mk.

cad/qcad/pkg-plist
483–484 ↗(On Diff #54000)

These could be simplified by having a:

%%DATADIR%%/plugins/designer/libqcadcustomwidgets%DEBUG%%.so

And having DEBUG set to "" or "_debug".

Side note, I doubt this built because you don't have DEBUG in PLIST_SUB in the Makefile.

Include bsd.port.options.mk, simplify plist substitutions

Thanks, I think I've addressed both of your points in this update.

cad/qcad/Makefile
35–44 ↗(On Diff #54000)

This could be solved independently since my change doesn't introduce that check, but I've addressed it here in patch v2.

cad/qcad/pkg-plist
483–484 ↗(On Diff #54000)

I've added DEBUG_LIB_SUFFIX to PLIST_SUB.

Side note, I doubt this built because you don't have DEBUG in PLIST_SUB in the Makefile.

As I said in the description, I did build the port with and without WITH_DEBUG to verify the change. The DEBUG substitution comes from Uses/qmake.mk (it's no longer being used though).

Sorry for the long delay.
I've adapted your changes for the current qcad version.
It's being commited shortly.
Thanks for your work!

This revision is now accepted and ready to land.Mar 28 2021, 8:05 PM