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.
Created attachment 221826 [details]
my original (unpatched) poudriere build log for mtools
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)
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.
A commit references this bug:
Date: Tue Feb 23 16:09:20 UTC 2021
New revision: 566407
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
Submitted by: John Kennedy <firstname.lastname@example.org>