Page MenuHomeFreeBSD

Fix pkg-plist by using PLIST_SUB instead of PLIST_FILES
ClosedPublic

Authored by dumbbell on Jun 5 2014, 7:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 7, 12:41 PM
Unknown Object (File)
Sat, Sep 27, 5:13 AM
Unknown Object (File)
Wed, Sep 24, 12:03 AM
Unknown Object (File)
Sat, Sep 20, 2:11 AM
Unknown Object (File)
Mon, Sep 15, 8:03 PM
Unknown Object (File)
Sat, Sep 13, 3:06 PM
Unknown Object (File)
Sep 11 2025, 7:08 AM
Unknown Object (File)
Sep 9 2025, 11:41 PM
Subscribers

Details

Reviewers
bapt
Summary

Before this change, the final plist was made of a basic pkg-plist, plus files added through the PLIST_FILES variable in the Makefile, depending on the selected options. This didn't work for the LUA option, which require @dirrm entries.

Now, the Makefile uses PLIST_SUB, which allows to have a complete pkg-plist where some entries are commentted out when the associated option is disabled.

PR: 190516.
Tested by: Matthieu Volat <mazhe@alkumuna.eu>

Test Plan
  • make stage check-orphans -- passed with all options checked, then all unchecked
  • portlint -Aabt -- 1 warning about PORTDOCS (false positive)

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

dumbbell retitled this revision from to Fix pkg-plist by using PLIST_SUB instead of PLIST_FILES.
dumbbell updated this object.
dumbbell edited the test plan for this revision. (Show Details)
bapt requested changes to this revision.Jun 5 2014, 7:18 AM
bapt added a reviewer: bapt.
bapt added a subscriber: bapt.

Just remove all the PLIST_SUB line and add a single OPTIONS_SUB=yes earlier

This revision now requires changes to proceed.Jun 5 2014, 7:18 AM
dumbbell edited edge metadata.

Thank you Baptiste, I made that change.

While here, I added USES=gettext. It was missing and portlint started to report it. The list of USES is now sorted alphabetically.

Using options helpers allows you to remove all those .if ${PORT*
and to remove the .include <bsd.port.pre.mk>

I added a couple of examples in inline comments, see: http://www.freebsd.org/doc/en/books/porters-handbook/makefile-options.html §5.2.3

graphics/darktable/Makefile
53

The above can become:

GPHOTO_LIB_DEPENDS= libgphoto2.so:${PORTSDIR}/graphics/libgphoto2
GPHOTO_CMAKE_OFF= -DUSE_CAMERA_SUPPORT:BOOL=OFF
65–66

RAWSPEED_CMAKE_ON= -DDONT_USE_RAWSPEED:BOOL=ON

85–86

SLIDESHOW_USE= GL=gl SDL=sdl

91–92

NLS_USES= gettext

If I remove the ".include <bsd.port.pre.mk>" line, ${OSVERSION} isn't defined (used to check if USE_GCC is required or not).

Should I keep ".include <bsd.port.pre.mk>", or should I use another include?

Remove bsd.port.pre.mk and replace bsd.port.post.mk by bsd.port.mk

That's what I tried, but make(1) complains because:

  • ${OSVERSION} is undefined (needed to check if USE_GCC is mandatory)
  • ${PORT_OPTIONS:MDOCS} is undefined too (used in post-install)
dumbbell edited edge metadata.

Here's a new patch with the following changes:

  • Use MYOPTION_* option-dependent variables
  • Sort MYOPTION_* variables alphabetically
  • Remove post-patch target, it's already integrated upstream
  • Remove part of post-install reinplace, it's already upstream
  • Use %%NLS%% in pkgp-list
  • Add missing doc files in pkg-plist and post-install's rm

Two changes in this new revision:

  • Include bsd.port.options.mk/bsd.port.mk instead of bsd.port.pre.mk/bsd.port.post.mk.
  • If WITH_DEBUG is set, set CMAKE_BUILD_TYPE to RelWithDebInfo, because Debug triggers a fatal error in darktable's CMakeLists.txt. Furthermore, clear the STRIP variable, otherwise binaries are stripped.
bapt edited edge metadata.

Approved :)

This revision is now accepted and ready to land.Jun 12 2014, 6:29 AM