Created attachment 162400 [details] [patch] fix --with-libedit/readline* configuration arg spellings and enable them for libedit in the readline module's extconf.rb The --with-readline-prefix and --with-libedit-prefix configure arguments are spelled wrong. They should be --with-readline-dir and --with-libedit-dir. See dir_config() inlib/mkmf.rb It's just luck in the normal default case that the ports do the right thing now. You could spell them --with-libedit-flibberjam=${LOCALBASE} and it would still work (in the default case). Because -I/usr/local/include is added for other reasons and normally /usr/local (LOCALBASE) is where the readline and libedit ports are installed. For instance, if you select the LIBEDIT option and have devel/libedit installed to a different prefix than LOCALBASE, then setting --with-libedit-prefix=<that_prefix> (you have to change the current port Makefile to test that since it's hard-coded to ${LOCALBASE} instead of the results from 'pkgconf --variable prefix libedit') will fail to find the right libedit and you'll get issues like this because the ruby build finds and uses the libedit from base: compiling readline.c readline.c: In function 'history_get_offset_history_base': readline.c:1573: error: 'history_base' undeclared (first use in this function) readline.c:1573: error: (Each undeclared identifier is reported only once readline.c:1573: error: for each function it appears in.) readline.c: In function 'hist_get': readline.c:1585: error: 'HIST_ENTRY' undeclared (first use in this function) readline.c:1585: error: 'entry' undeclared (first use in this function) readline.c:1590: error: 'history_length' undeclared (first use in this function) readline.c: In function 'hist_set': readline.c:1605: error: 'HIST_ENTRY' undeclared (first use in this function) . . Furthermore, I believe there's a bug in ext/readline/extconf.rb in the libedit case where the --with-libedit* feature is not turned on - it needs 'dir_config("libedit")'. That part of the attached patch can be submitted upstream. I'll try to do that if no one else beats me to it. This bug is something of a nitpick since everything works in the default everything-in-/usr/local case now. But the configure option is definitely spelled wrong. And those --with-libedit* knobs need to be enabled in readline/extconf.rb for libedit.
A commit references this bug: Author: mmoll Date: Sun Oct 25 00:21:24 UTC 2015 New revision: 400142 URL: https://svnweb.freebsd.org/changeset/ports/400142 Log: lang/ruby2*: fix readline & libedit configure options The fixed error(s) were only visible with LOCALBASE not set to /usr/local. PR: 203988 Submitted by: John Hein <z7dr6ut7gs@snkmail.com> Changes: head/lang/ruby20/Makefile head/lang/ruby20/files/patch-ext_readline_extconf.rb head/lang/ruby21/Makefile head/lang/ruby21/files/patch-ext_readline_extconf.rb head/lang/ruby22/Makefile head/lang/ruby22/files/patch-ext_readline_extconf.rb
Commited, thank you very much! If you could try to bring your fix into upstream, that would be great as all operating systems would benefit from it (although most will have the same situation covering the problem).
I will try to get the extconf.rb part upstreamed. In the meantime, can you do a partial revert to use LOCALBASE rather than LIBEDITPREFIX and READLINEPREFIX? Those second names I used when testing this problem - I didn't mean for them to sneak into the published version of the Makefile patch (it was just supposed to be the change to the right spelling --with-*-dir rather than --with-*-prefix). The current freebsd ports tree isn't yet equipped to handle finding dependencies that aren't in LOCALBASE for the most part (unless the port's configure scripts uses pkg-config to find the alternate location). Re-opening because of this.
take
Created attachment 162749 [details] proposed patch
like the patch I just attached?
Yep, attachment 162749 [details] is exactly it. Thanks.
A commit references this bug: Author: mmoll Date: Thu Nov 5 10:14:49 UTC 2015 New revision: 400831 URL: https://svnweb.freebsd.org/changeset/ports/400831 Log: lang/ruby2*: correct configure options Fix readline & libedit configure options after a slight error slipped in with the patches done in r400142. PR: 203988 Submitted by: John Hein <z7dr6ut7gs@snkmail.com> Changes: head/lang/ruby20/Makefile head/lang/ruby21/Makefile head/lang/ruby22/Makefile
commited, thanks for following up!
upstream bug for the extconf.rb part is https://bugs.ruby-lang.org/issues/11751