Bug 259256 - [NEW PORT] devel/kconfig-frontends
Summary: [NEW PORT] devel/kconfig-frontends
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Yasuhiro Kimura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-19 05:05 UTC by Tomasz "CeDeROM" CEDRO
Modified: 2022-10-03 12:01 UTC (History)
5 users (show)

See Also:


Attachments
new port shar (3.68 KB, application/x-shellscript)
2021-10-19 05:05 UTC, Tomasz "CeDeROM" CEDRO
no flags Details
new port shar (v2) (3.68 KB, application/x-shellscript)
2021-10-19 05:33 UTC, Tomasz "CeDeROM" CEDRO
no flags Details
new port shar (v3) (3.69 KB, application/x-shellscript)
2021-10-19 05:59 UTC, Tomasz "CeDeROM" CEDRO
no flags Details
new port shar (v4) (3.70 KB, application/x-shellscript)
2021-10-19 06:28 UTC, Tomasz "CeDeROM" CEDRO
no flags Details
version 20220116 with Yasu remarks implemented (4.35 KB, text/plain)
2022-01-16 15:03 UTC, Tomasz "CeDeROM" CEDRO
no flags Details
make.conf:DEVELOPER=yes Q/A hints applied (4.43 KB, text/plain)
2022-01-18 03:56 UTC, Tomasz "CeDeROM" CEDRO
no flags Details
processed by portclippy and portfmt (4.45 KB, text/plain)
2022-01-18 04:09 UTC, Tomasz "CeDeROM" CEDRO
no flags Details
fixed docs in package problem (4.47 KB, text/plain)
2022-01-23 22:44 UTC, Tomasz "CeDeROM" CEDRO
no flags Details
New port with only terminal interface. (3.33 KB, application/x-shellscript)
2022-09-13 23:52 UTC, Tomasz "CeDeROM" CEDRO
no flags Details
Only ncurses frontend as default, no options. (3.03 KB, application/x-shellscript)
2022-09-17 00:17 UTC, Tomasz "CeDeROM" CEDRO
no flags Details
Only ncurses frontend, no options, no cd in post-install. (3.02 KB, application/x-shellscript)
2022-09-17 00:29 UTC, Tomasz "CeDeROM" CEDRO
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz "CeDeROM" CEDRO 2021-10-19 05:05:42 UTC
Created attachment 228817 [details]
new port shar

Hello world :-)

Here goes the new port for devel/kconfig-frontends, a Kconfig file parser, created for NuttX RTOS (core dependency) development on FreeBSD.

Please verify if all is fine :-)

Tomek
Comment 1 Tomasz "CeDeROM" CEDRO 2021-10-19 05:33:17 UTC
Created attachment 228820 [details]
new port shar (v2)

1. Added missing gperf dependency.
2. Simplified GTK and QT dependencies.
Comment 2 Tomasz "CeDeROM" CEDRO 2021-10-19 05:59:00 UTC
Created attachment 228821 [details]
new port shar (v3)

* Needs verification on a clean system.
* Updated GTK dependencies.
Comment 3 Tomasz "CeDeROM" CEDRO 2021-10-19 06:28:45 UTC
Created attachment 228823 [details]
new port shar (v4)

Also verified Qt build on a clean system + dependencies update.

Ready for testing :-)
Comment 4 Tomasz "CeDeROM" CEDRO 2022-01-11 23:24:38 UTC
Hey Yasu could you please also take a look at this one? :-)
Comment 5 Yasuhiro Kimura freebsd_committer freebsd_triage 2022-01-13 10:33:20 UTC
(In reply to Tomasz "CeDeROM" CEDRO from comment #4)

Some comments about attachment 228823 [details].

1. Use DISTVERSION rather than PORTVERSION when the version only contains numbers separated by dots, dashes or underscores (ref. section 5.2.2 of Porter's Handbook).
2. 'Created by' header in Makefile is obsolete.
3. There is an empty line at the end of pkg-plist.
4. Before submitting new port or patch to update existing port, please check it with portlint, portclippy and portfmt as is explained in section 10.2 and 10.3 of Porter's Handbook. For example, my 3rd comment is detected by portlint.
Comment 6 Tomasz "CeDeROM" CEDRO 2022-01-16 15:02:23 UTC
Thank you Yasu :-)

Portlint did not report any issues. I have applied your remarks. Portlint does not show issues too:

root@hexagon:/usr/ports/devel/kconfig-frontends # portlint
looks fine.
Comment 7 Tomasz "CeDeROM" CEDRO 2022-01-16 15:03:04 UTC
Created attachment 231042 [details]
version 20220116 with Yasu remarks implemented
Comment 8 Yasuhiro Kimura freebsd_committer freebsd_triage 2022-01-18 02:24:08 UTC
(In reply to Tomasz "CeDeROM" CEDRO from comment #6)

As is written in section 10.3 of Porter's Handbook, use `portlint -A` for a new port and `portlint -C` for for an existing one.
Comment 9 Tomasz "CeDeROM" CEDRO 2022-01-18 02:35:00 UTC
root@hexagon:/usr/ports/devel/kconfig-frontends # portlint -A
WARN: Consider to set DEVELOPER=yes in /etc/make.conf
0 fatal errors and 1 warning found.

root@hexagon:/usr/ports/devel/kconfig-frontends # portlint -C
WARN: Consider to set DEVELOPER=yes in /etc/make.conf
0 fatal errors and 1 warning found.

root@hexagon:/usr/ports/devel/kconfig-frontends # echo DEVELOPER=yes >> /etc/make.conf

root@hexagon:/usr/ports/devel/kconfig-frontends # portlint -C
looks fine.

root@hexagon:/usr/ports/devel/kconfig-frontends # portlint -A
looks fine.
Comment 10 Tomasz "CeDeROM" CEDRO 2022-01-18 02:36:24 UTC
root@hexagon:/usr/ports/devel/kconfig-frontends # make
/!\ kconfig-frontends-4.11.0.1: Makefile errors /!\

PORTDOCS does not do anything unless the DOCS option is present.

*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/kconfig-frontends
*** Error code 1

Stop.

:-)
Comment 11 Yasuhiro Kimura freebsd_committer freebsd_triage 2022-01-18 02:49:45 UTC
Comments about attachment 231042 [details]

* 'USES=tar.bz2' sets EXTRACT_SUFFIX to '.tar.bz2'. So 'EXTRACT_SUFFIX=.tar.bz2' in Makefile is unnecessary.
* Add DOCS option as you wrote in comment #10.
* Check Makefile with portclippy and portfmt.
Comment 12 Tomasz "CeDeROM" CEDRO 2022-01-18 03:56:43 UTC
Created attachment 231105 [details]
make.conf:DEVELOPER=yes Q/A hints applied

root@hexagon:/usr/ports/devel/kconfig-frontends # portlint -A
looks fine.

root@hexagon:/usr/ports/devel/kconfig-frontends # portlint -C
looks fine.

I have applied all hints from Q/A after make with DEVELOPER=yes enabled in /etc/make.conf. This new DEVELOPER feature is really nice and helpful! :-)

The only thing I cannot guess is DOCS part for some reason auto pkg-static wants to take files from ${DOCSDIR}/docs/ not from the ${DOCSDIR} because some of the documentation is placed in the source tree under docs/. Please help :-)

root@hexagon:/usr/ports/devel/kconfig-frontends # make
(..)
====> Compressing man pages (compress-man)
====> Running Q/A tests (stage-qa)
root@hexagon:/usr/ports/devel/kconfig-frontends # make package
===>  Building package for kconfig-frontends-4.11.0.1
pkg-static: Unable to access file /usr/ports/devel/kconfig-frontends/work/stage/usr/local/share/doc/kconfig-frontends/docs/kconfig.txt:No such file or directory
pkg-static: Unable to access file /usr/ports/devel/kconfig-frontends/work/stage/usr/local/share/doc/kconfig-frontends/docs/kconfig-language.txt:No such file or directory
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/kconfig-frontends
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/kconfig-frontends
Comment 13 Tomasz "CeDeROM" CEDRO 2022-01-18 04:09:53 UTC
Created attachment 231106 [details]
processed by portclippy and portfmt


The only thing left seems to be PORTDOCS? Please help :-)
Comment 14 Yasuhiro Kimura freebsd_committer freebsd_triage 2022-01-18 09:46:30 UTC
(In reply to Tomasz "CeDeROM" CEDRO from comment #13)

If you set 'PORTDOCS=docs/kconfig-language.txt', it means '%%DOCSDIR%%/docs/kconfig-language.txt'. However, post-install target installs kconfig-language.txt under ${STAGEDIR}${DOCSDIR}. Then check-plist error happens. You should set PORTDOCS as following.

PORTDOCS=       AUTHORS COPYING README kconfig-language.txt kconfig.txt

In addition to it, there are 2 points.

* Use 'post-install-DOCS-on' instead of 'post-install' to install files listed in PORTDOCS as they should be installed only when DOCS option is enabled.
* In general, targets should be placed after variable assignments in Makefile.
Comment 15 Tomasz "CeDeROM" CEDRO 2022-01-23 22:44:06 UTC
Created attachment 231254 [details]
fixed docs in package problem

1. The solution to various docs is to define DOCS and then using them as PORTDOCS=${DOCS:T}, as well as using the `do-install-DOCS-on` target, as described in [1]. This solution really should be presented in Porter's Handbook.
2. portfmt and clippy done.
4. portlint -A all looks fine.
Comment 16 Yasuhiro Kimura freebsd_committer freebsd_triage 2022-01-24 16:15:50 UTC
Take.
Comment 17 Yasuhiro Kimura freebsd_committer freebsd_triage 2022-01-24 16:46:13 UTC
Let me check one point. Does this port works fine even if all frontend options are disabled?
Comment 19 Tomasz "CeDeROM" CEDRO 2022-01-24 20:09:39 UTC
Thank you Yasu for your time and patience :-) Builds fine for me with all options selected.. QA and portlint does not complain.. probably some dependencies missing? Will try to build on a fresh VM to verify.. also none options selected as requested :-) Any additional hints welcome :-)
Comment 20 Tomasz "CeDeROM" CEDRO 2022-01-24 20:12:27 UTC
When no option selected these binaries are built:
kconfig         kconfig-conf    kconfig-diff    kconfig-merge   kconfig-tweak
Comment 21 Luc Hondareyte 2022-04-30 10:46:30 UTC
Hi,
For your convenience, I have a working port for kconfig-frontends here:

https://github.com/lhondareyte/ports/tree/master/kconfig-frontends

I never dared to submit it since it's Linux centric :). But like CeDeRom, I use it to build NuttX.
Comment 22 Tomasz "CeDeROM" CEDRO 2022-04-30 13:24:17 UTC
Hey Luc :-) 

It also works for me with no problem. We just need to tune some stuff to make it fully ports compliant and safe to install on FreeBSD. Then we could just install it with `pkg install kconfig-frontends`. If you have some spare time and could help here that would be great! :-)

Yes, the kconfig-package project is abandoned, but it is also critical dependency for NuttX. There was a long discussion on this subject on the dev list. When NuttX becomes fully Apache compliant (it is in Incubation mode now) we will host new official repo for the kconfig-frontends project as part of NuttX. Note there is a fork for Debian, and Espressif has its own fork but it has diverged a lot from the origin towards IDF. Original author does not respond so putting it as part of NuttX seems most reasonable, then probably include patches from Debian and Espressif IDF. There is also a version of kconfig using Python but that was considered unwanted additional dependency in NuttX so decision is to stay with kconfig-frontends.

My board configuration patches are in NuttX upstream, 10.3 is just coming out, it will configure out-of-the box on FreeBSD! Please take a looks and verify, if that works please give +1 on the dev list in the release voting process :-)

Thanks! :-)
Tomek

ps/2: Some RISC-V compiler stuff still needs to be adjusted for NuttX in order to work with FreeBSD packages. Do you play with these cores (i.e. ESP32-C3) and would like to play?
Comment 23 Tomasz "CeDeROM" CEDRO 2022-09-13 23:52:36 UTC
Created attachment 236546 [details]
New port with only terminal interface.

I have removed the GCONF and QCONF options as they cause build problems, pulls lots of dependencies, while mostly only ncurses interface is used anyway.

In a free moment we may add GTK/QT interface if necessary.

Mostly important is to have this port as mandatory dependency for NuttX RTOS development on FreeBSD.

Updated SHAR is attached.

I have also testes GitHub pull request:
https://github.com/freebsd/freebsd-ports/pull/131
Comment 24 Yasuhiro Kimura freebsd_committer freebsd_triage 2022-09-15 10:22:58 UTC
(In reply to Tomasz "CeDeROM" CEDRO from comment #23)

Two feedbacks for attachment 236546 [details].

* `portfmt Makefile| diff -u Makefile -` gets following result.

--------------------------------------------------------------------
--- Makefile    2022-09-15 18:17:53.481485000 +0900
+++ -   2022-09-15 19:20:12.595552000 +0900
@@ -12,7 +12,8 @@
 USES=          gmake gperf libtool python shebangfix tar:bz2
 SHEBANG_FILES= utils/kconfig-diff utils/kconfig-tweak.in
 GNU_CONFIGURE= yes
-CONFIGURE_ARGS=        --disable-gconf --disable-qconf
+CONFIGURE_ARGS=        --disable-gconf \
+               --disable-qconf
 INSTALL_TARGET=        install-strip
 DOCS=          AUTHORS COPYING README docs/kconfig-language.txt \
                docs/kconfig.txt
--------------------------------------------------------------------

* Isn't "https://bitbucket.org/nuttx/tools/src/master/kconfig-frontends/" better than "https://bitbucket.org/nuttx/tools/downloads/" as the value of WWW?
Comment 25 Daniel Engberg freebsd_committer freebsd_triage 2022-09-16 07:20:43 UTC
There's no point making new and traditional interfaces an option if you can have both using the same dependency. Remove options and depend on ncurses from the start.

I think in general that we should avoid doing cd and use direct paths instead.
See https://bugs.freebsd.org/bugzilla/attachment.cgi?id=236575 at the end.

Best regards,
Daniel
Comment 26 Tomasz "CeDeROM" CEDRO 2022-09-17 00:17:57 UTC
Created attachment 236615 [details]
Only ncurses frontend as default, no options.

Only ncurses frontend is enabled by default, no options.

Also updated https://github.com/freebsd/freebsd-ports/pull/131
Comment 27 Tomasz "CeDeROM" CEDRO 2022-09-17 00:29:00 UTC
Created attachment 236616 [details]
Only ncurses frontend, no options, no cd in post-install.

Also updated https://github.com/freebsd/freebsd-ports/pull/131.
Comment 28 commit-hook freebsd_committer freebsd_triage 2022-10-03 07:21:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8c1a20b75018df72c4a5bd36c5eef2466ccf268e

commit 8c1a20b75018df72c4a5bd36c5eef2466ccf268e
Author:     Tomek CEDRO <tomek@cedro.info>
AuthorDate: 2022-10-03 07:19:29 +0000
Commit:     Kurt Jaeger <pi@FreeBSD.org>
CommitDate: 2022-10-03 07:19:29 +0000

    devel/kconfig-frontends: Kconfig files parser and frontend

    Kconfig frontends and parser. Port created for NuttX RTOS development.
    Kconfig is the configuration language used by the Linux kernel. This package
    is a simple copy of the frontends and the parser found in the Linux kernel
    source tree, with very minor changes to adapt them to being built out of
    the kernel build infrastructure. Kconfig is also used in embedded development.
    This program has currently no upstream maintainer. NuttX copy is used.
    There are two forks: Debian based on 4.11, Espressif based on version 4.6.

    PR:             259256

 devel/Makefile                                     |  1 +
 devel/kconfig-frontends/Makefile (new)             | 27 ++++++++++++++++++++++
 devel/kconfig-frontends/distinfo (new)             |  3 +++
 .../files/patch-libs_parser_hconf.c (new)          | 11 +++++++++
 devel/kconfig-frontends/pkg-descr (new)            |  7 ++++++
 devel/kconfig-frontends/pkg-plist (new)            | 19 +++++++++++++++
 6 files changed, 68 insertions(+)
Comment 29 Kurt Jaeger freebsd_committer freebsd_triage 2022-10-03 07:22:23 UTC
Committed, thanks.
Comment 30 Tomasz "CeDeROM" CEDRO 2022-10-03 12:01:10 UTC
TANK U PI !! :-)