Bug 252928

Summary: emulators/mtools: need more direct libiconv dependency
Product: Ports & Packages Reporter: John Kennedy <warlock>
Component: Individual Port(s)Assignee: Steven Kreuzer <skreuzer>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (skreuzer)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to add libiconv dependency
none
my original (unpatched) poudriere build log for mtools
none
patch to add libiconv dependency, make mtools.conf usable without editing none

Description John Kennedy 2021-01-23 04:28:54 UTC
Created attachment 221825 [details]
patch to add libiconv dependency

Noticed compiling net/ipxe-g20201129,1 on 13.0-ALPHA2 1300136

ipxe needs mtools (for mformat), which in turn requires libiconv.  The emulators/mtools port pulls in libiconv-1.16 indirectly, so mtools builds just fine but ipxe doesn't know to pull it in.

I'm not sure that this is exactly what should be done, but it seems like this is the place to do something.  Like I said, it pulled it in indirectly (via texinfo).  I also am a newbie for how to patch ports, so excuse me if I've done something wrong.


I also see that ipxe is barfing on the mtools.conf file that gets installed by default:

bash util/genefidsk -o bin-x86_64-efi/ipxe.usb -b bootx64.efi bin-x86_64-efi/ipxe.efi
Syntax error at line 19 column 0 in file /usr/local/etc/mtools.conf: unrecognized keyword

IE, right where "SAMPLE FILE" is.  Of course, this is a clean poudriere build so there is no chance for a user to customize that file.
Comment 1 John Kennedy 2021-01-23 04:44:44 UTC
Created attachment 221826 [details]
my original (unpatched) poudriere build log for mtools
Comment 2 John Kennedy 2021-01-23 18:40:26 UTC
This morning, I'm really-really questioning my patch since, again, new to trying to submit patch ports.

It seems like Freebsd > 10 has iconv built in, so not strictly necessary to use external library.  I'm guessing the configuration file finds the one present because of other packages and says "oh, well, I should probably be using that" and sets itself up that way.  I'm guessing the port maintainer wasn't necessarily expecting that possibility (or it's changed), thus the lack of dependency.

The options the maintainer make sense to me (per porters handbook using-iconv), but my use of empty(ICONV_LIB) working doesn't.  On my system, mformat is clearly linked to /usr/local/lib/libiconv.so.2, so that is what I should be triggering on but I'm not sure how to do that there.

It seems like you'd want to be ignoring the detect presence of libiconv but still using the functions (not sure if configure --without-iconv will do that).

Its also clear that I'm not totally savvy with options in BSD port Makefiles.

My pseudocode interpretation of the ICONV (default on) options is:

if portion option of ICONV is on
USES+= iconv is set
CPPFLAGS is set (but unnecessary > FreeBSD10, semi ICONV_CONFIGURE_*?)
LDFLAGS is set (but ICONV_LIB should be empty > FreeBSD10, but per handbook)
My possible kludge kicks in since ICONV_LIB is empty, setting LD_DEPENDS)
else ...
Comment 3 John Kennedy 2021-02-06 02:53:17 UTC
Created attachment 222194 [details]
patch to add libiconv dependency, make mtools.conf usable without editing

I beat on this a while more.  Without more patches inside the port, it seems like it really prefers to use libiconv from ports (vs FreeBSD builtin).  So I just make it depend on libiconv properly so it gets dragged in.

I also had the port comment-out the SAMPLE FILE line in mtools.conf so it doesn't break other ports (like net/ipxe) during it's cleanroom poudriere build.
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-02-23 16:09:56 UTC
A commit references this bug:

Author: skreuzer
Date: Tue Feb 23 16:09:20 UTC 2021
New revision: 566407
URL: https://svnweb.freebsd.org/changeset/ports/566407

Log:
  Add libiconv as a dependancy

  * Prefer to use libiconv from ports
  * Comment out the SAMPLE FILE line in mtools.conf to avoid breakng other ports

  PR:		252928
  Submitted by:	John Kennedy <warlock@phouka.net>

Changes:
  head/emulators/mtools/Makefile
Comment 5 Steven Kreuzer freebsd_committer freebsd_triage 2021-02-23 16:10:31 UTC
Committed! Thanks