Warning: there may be occasional oddness due to css and blog edits. **KNOWN ISSUE: possible hidden text**

Sunday, March 10, 2024

Portclippy minetest finesse

I recently discovered another option that I left out of the exposed config for my unofficial minetest-dev port.  It is not much of a task to add another option but in the process of doing it I re-read some porter's handbook documentation (https://docs.freebsd.org/en/books/porters-handbook/testing/).  I was wondering how to test for correctness and whether all my dependencies were included.  I haven't had issues with building from my Makefile, although it warns that I may be including too many dependencies, things that it might not link to anyway.  These are only warnings, they could remain as is, though why not fix them, and I noticed mention of portclippy.

I've used portlint frequently and its direction has helped me correct flaws, including the most annoying "wrong linetype" issue when I copy-paste something and it converts from tabs to spaces.  This tool, portclippy is much more visual and makes the needed adjustments much more obvious.  Below is the output I had when I ran it on the minetest-dev Makefile.  The manpage describes "The output of portclippy is inspired by unified diff(1) output.  Here RUN_DEPENDS is in the wrong position (marked with -) and should be moved to before USES (marked with +)." which means there are a lot of line moves to do.

/usr/home/tigersharke/Ported_Software/games/minetest-dev # portclippy Makefile
# PORTNAME block
PORTNAME
DISTVERSION
CATEGORIES
PKGNAMESUFFIX
DISTNAME
DIST_SUBDIR

# Maintainer block
MAINTAINER
COMMENT
WWW

# License block
LICENSE

# Dependencies
LIB_DEPENDS

# USES block
USES

-CONFLICTS

USE_GITHUB
GH_ACCOUNT
GH_PROJECT
GH_TAGNAME
+USE_SDL

# USES=cmake related variables
CMAKE_ARGS

-USE_SDL
# Conflicts
+CONFLICTS

# WRKSRC block
WRKSRC

# Packaging list block
PORTDATA
PORTDOCS

# Options definitions
OPTIONS_DEFAULT
OPTIONS_GROUP
-OPTIONS_SINGLE
-OPTIONS_MULTI

-MISC_DESC

+OPTIONS_GROUP_BUILD
+OPTIONS_GROUP_DATABASE
OPTIONS_GROUP_MISC

-NEEDS_DESC

OPTIONS_GROUP_NEEDS

-SYSTEM_DESC

OPTIONS_GROUP_SYSTEM

-SOFTWARE_DESC

+OPTIONS_MULTI
OPTIONS_MULTI_SOFTWARE
+OPTIONS_SINGLE
+OPTIONS_SINGLE_GRAPHICS
+OPTIONS_SUB

# Options descriptions
+BUILD_DESC
+CLIENT_DESC
+CURL_DESC
+DATABASE_DESC
+DEVTEST_DESC
+DOCS_DESC
+EXAMPLES_DESC
+FREETYPE_DESC
+GLVND_DESC
+GRAPHICS_DESC
+LEGACY_DESC
+LEVELDB_DESC
+LTO_DESC
+MISC_DESC
+NCURSES_DESC
+NEEDS_DESC
+NLS_DESC
+PGSQL_DESC
+PROFILING_DESC
+PROMETHEUS_DESC
+REDIS_DESC
+SERVER_DESC
+SOFTWARE_DESC
+SOUND_DESC
+SPATIAL_DESC
+SYSTEM_DESC
+SYSTEM_FONTS_DESC
SYSTEM_GMP_DESC

-SYSTEM_GMP_CMAKE_BOOL
-SYSTEM_GMP_CMAKE_ON
-SYSTEM_GMP_LIB_DEPENDS

SYSTEM_JSONCPP_DESC

-SYSTEM_JSONCPP_CMAKE_BOOL
-SYSTEM_JSONCPP_CMAKE_ON
-SYSTEM_JSONCPP_LIB_DEPENDS

SYSTEM_LUAJIT_DESC

-SYSTEM_LUAJIT_USES

-SYSTEM_FONTS_DESC

-SYSTEM_FONTS_RUN_DEPENDS

-BUILD_DESC

-OPTIONS_GROUP_BUILD

-EXAMPLES_DESC

-EXAMPLES_CMAKE_BOOL

-DEVTEST_DESC

-DEVTEST_CMAKE_BOOL

+TOUCH_DESC
UNITTESTS_DESC

# Options helpers
-UNITTESTS_CMAKE_BOOL

-OPTIONS_SINGLE_GRAPHICS

-GRAPHICS_DESC
-GLVND_DESC

-GLVND_CMAKE_BOOL
-GLVND_CMAKE_ON
-GLVND_USE
-GLVND_LIB_DEPENDS

-LEGACY_DESC

-LEGACY_CMAKE_BOOL
-LEGACY_CMAKE_ON
-LEGACY_USE

-DATABASE_DESC

-OPTIONS_GROUP_DATABASE
-OPTIONS_SUB

-CLIENT_DESC

-CLIENT_CMAKE_BOOL_ON

CLIENT_LIB_DEPENDS
CLIENT_USES
CLIENT_USE

-SERVER_DESC

-SERVER_CMAKE_BOOL

-CURL_DESC

-CURL_CMAKE_BOOL
CURL_LIB_DEPENDS

-SOUND_DESC

-SOUND_CMAKE_BOOL

-DOCS_DESC

+CURL_CMAKE_BOOL
+DEVTEST_CMAKE_BOOL
DOCS_CMAKE_BOOL

-FREETYPE_DESC

-FREETYPE_CMAKE_BOOL
+EXAMPLES_CMAKE_BOOL
FREETYPE_LIB_DEPENDS

-NCURSES_DESC

-NCURSES_CMAKE_BOOL
-NCURSES_USES

-LEVELDB_DESC

-LEVELDB_CMAKE_BOOL
+FREETYPE_CMAKE_BOOL
+GLVND_LIB_DEPENDS
+GLVND_USE
+GLVND_CMAKE_BOOL
+GLVND_CMAKE_ON
+LEGACY_USE
+LEGACY_CMAKE_BOOL
+LEGACY_CMAKE_ON
LEVELDB_LIB_DEPENDS

-PGSQL_DESC

+LEVELDB_CMAKE_BOOL
+LTO_CMAKE_BOOL
+NCURSES_USES
+NCURSES_CMAKE_BOOL
+NLS_USES
+NLS_CMAKE_BOOL
+NLS_LDFLAGS
PGSQL_USES
PGSQL_CMAKE_BOOL

-REDIS_DESC

-REDIS_CMAKE_BOOL
+PROFILING_CMAKE_BOOL
+PROMETHEUS_CMAKE_BOOL
REDIS_LIB_DEPENDS

-SPATIAL_DESC

+REDIS_CMAKE_BOOL
+SERVER_CMAKE_BOOL
+SOUND_CMAKE_BOOL
SPATIAL_LIB_DEPENDS
SPATIAL_CMAKE_BOOL

-NLS_DESC

-NLS_CMAKE_BOOL
-NLS_USES
-NLS_LDFLAGS

-TOUCH_DESC

+SYSTEM_FONTS_RUN_DEPENDS
+SYSTEM_GMP_LIB_DEPENDS
+SYSTEM_GMP_CMAKE_BOOL
+SYSTEM_GMP_CMAKE_ON
+SYSTEM_JSONCPP_LIB_DEPENDS
+SYSTEM_JSONCPP_CMAKE_BOOL
+SYSTEM_JSONCPP_CMAKE_ON
+SYSTEM_LUAJIT_USES
TOUCH_CMAKE_BOOL
+UNITTESTS_CMAKE_BOOL

-PROMETHEUS_DESC

-PROMETHEUS_CMAKE_BOOL

-PROFILING_DESC

-PROFILING_CMAKE_BOOL

-LTO_DESC

-LTO_CMAKE_BOOL
# Unknown variables
# WARNING:
# The following variables were not recognized.
# They could just be typos or Portclippy needs to be made aware of them.
# Please double check them.
#
# Prefix them with an _ or wrap in '.ifnmake portclippy' to tell
# Portclippy to ignore them.
#
# If in doubt please report this on portfmt's bug tracker:
# https://codeberg.org/tobik/portfmt/issues
+CLIENT_CMAKE_BOOL_ON
/usr/home/tigersharke/Ported_Software/games/minetest-dev #

So it looks like I will need to scroll down to the first group of lines with the "-" prefix, and move them where the matching lines with the "+" prefix are in the file.  After quite a bit of cut and paste using vi, I have re-run portclippy for the results below.

/usr/home/tigersharke/Ported_Software/games/minetest-dev # portclippy Makefile
# PORTNAME block
PORTNAME
DISTVERSION
CATEGORIES
PKGNAMESUFFIX
DISTNAME
DIST_SUBDIR

# Maintainer block
MAINTAINER
COMMENT
WWW

# License block
LICENSE

# Dependencies
LIB_DEPENDS

# USES block
USES
USE_GITHUB
GH_ACCOUNT
GH_PROJECT
GH_TAGNAME
USE_SDL

# USES=cmake related variables
CMAKE_ARGS

# Conflicts
CONFLICTS

# WRKSRC block
WRKSRC

# Packaging list block
PORTDATA
PORTDOCS

# Options definitions
OPTIONS_DEFAULT
OPTIONS_GROUP
OPTIONS_GROUP_BUILD
OPTIONS_GROUP_DATABASE
OPTIONS_GROUP_MISC
OPTIONS_GROUP_NEEDS
OPTIONS_GROUP_SYSTEM
OPTIONS_MULTI
OPTIONS_MULTI_SOFTWARE
+OPTIONS_SINGLE
+OPTIONS_SINGLE_GRAPHICS
+OPTIONS_SUB

# Options descriptions
BUILD_DESC
CLIENT_DESC
CURL_DESC
DATABASE_DESC
DEVTEST_DESC
DOCS_DESC
EXAMPLES_DESC
FREETYPE_DESC
GLVND_DESC
GRAPHICS_DESC
LEGACY_DESC
LEVELDB_DESC
LTO_DESC
MISC_DESC
NCURSES_DESC
NEEDS_DESC
NLS_DESC
PGSQL_DESC
PROFILING_DESC
PROMETHEUS_DESC
REDIS_DESC
SERVER_DESC
SOFTWARE_DESC
SOUND_DESC
SPATIAL_DESC
SYSTEM_DESC
SYSTEM_FONTS_DESC
SYSTEM_GMP_DESC
SYSTEM_JSONCPP_DESC
SYSTEM_LUAJIT_DESC
TOUCH_DESC
UNITTESTS_DESC

# Options helpers
CLIENT_LIB_DEPENDS
CLIENT_USES
CLIENT_USE
CLIENT_CMAKE_ON
CURL_LIB_DEPENDS
CURL_CMAKE_BOOL
DEVTEST_CMAKE_BOOL
DOCS_CMAKE_BOOL
EXAMPLES_CMAKE_BOOL
FREETYPE_LIB_DEPENDS
FREETYPE_CMAKE_BOOL
GLVND_LIB_DEPENDS
GLVND_USE
GLVND_CMAKE_BOOL
GLVND_CMAKE_ON
LEGACY_USE
LEGACY_CMAKE_BOOL
LEGACY_CMAKE_ON
LEVELDB_LIB_DEPENDS
LEVELDB_CMAKE_BOOL
LTO_CMAKE_BOOL
NCURSES_USES
NCURSES_CMAKE_BOOL
NLS_USES
NLS_CMAKE_BOOL
NLS_LDFLAGS
PGSQL_USES
PGSQL_CMAKE_BOOL
PROFILING_CMAKE_ON
PROMETHEUS_CMAKE_BOOL
REDIS_LIB_DEPENDS
REDIS_CMAKE_BOOL
SERVER_CMAKE_BOOL
SOUND_CMAKE_BOOL
SPATIAL_LIB_DEPENDS
SPATIAL_CMAKE_BOOL
SYSTEM_FONTS_RUN_DEPENDS
SYSTEM_GMP_LIB_DEPENDS
SYSTEM_GMP_CMAKE_BOOL
SYSTEM_GMP_CMAKE_ON
SYSTEM_JSONCPP_LIB_DEPENDS
SYSTEM_JSONCPP_CMAKE_BOOL
SYSTEM_JSONCPP_CMAKE_ON
SYSTEM_LUAJIT_USES
TOUCH_CMAKE_BOOL
UNITTESTS_CMAKE_BOOL

-OPTIONS_SINGLE
-OPTIONS_SINGLE_GRAPHICS
-OPTIONS_SUB
/usr/home/tigersharke/Ported_Software/games/minetest-dev #

I have small personal objection to how the options are ordered, since I like to group them together with all parts for any config option.  This way I am more sure not to miss something and for me its easier to read.  Above is the portclippy output after I complied with all but three lines of its instruction, the comments are generated by the tool, any comments actually in the Makefile are ignored.  I added similar comments as this is my first time doing this and it may help me with other ports I attempt.  If I complied 100% with what portclippy wanted changed, it would not provide any output, no feedback needed.

This is a nice tool, it very visually helps get the Makefile organized for official ports, so it will help those new to the process perfect their skills with this part of the job.  I am not sure whether I would revert the options order to what I prefer.  I could pre-add incompletely filled lines (leave out the assigned values part) of any new option for all of the different sections even if some remain unused (or might not be filled) as a way to avoid missing any.

No comments:

Post a Comment

Thank you for your interest!

Frequently viewed this week