Bug 197697

Summary: net-im/ejabberd: Does not build on 9.3 and 8.4: iconv.h: No such file or directory
Product: Ports & Packages Reporter: Victor Sudakov <vas>
Component: Individual Port(s)Assignee: Ashish SHUKLA <ashish>
Status: Closed FIXED    
Severity: Affects Only Me CC: olgeni, vas
Priority: --- Keywords: needs-qa, patch
Version: LatestFlags: bugzilla: maintainer-feedback? (ashish)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Poudriere failed build log
none
Fix none

Description Victor Sudakov 2015-02-16 05:09:13 UTC
Created attachment 153025 [details]
Poudriere failed build log

The compilation of net-im/ejabberd fails with 

Compiled src/iconv.erl
Compiling /wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c
/wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c:3:19: error: iconv.h: No such file or directory
/wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c: In function 'do_convert':
/wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c:21: error: 'iconv_t' undeclared (first use in this function)
/wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c:21: error: (Each undeclared identifier is reported only once
/wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c:21: error: for each function it appears in.)
/wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c:21: error: expected ';' before 'cd'
/wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c:32: error: 'cd' undeclared (first use in this function)
/wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c:32: warning: implicit declaration of function 'iconv_open'
/wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c:44: warning: implicit declaration of function 'iconv'
/wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c:56: warning: implicit declaration of function 'iconv_close'
ERROR: compile failed while processing /wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv: rebar_abort
Makefile:81: recipe for target 'deps/.built' failed
gmake: *** [deps/.built] Error 1
*** [do-build] Error code 1

Stop in /usr/ports/net-im/ejabberd.

Workaround: ICONV=off
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-02-16 05:09:13 UTC
Auto-assigned to maintainer ashish@FreeBSD.org
Comment 2 Victor Sudakov 2015-02-16 09:25:38 UTC
A fix should be pretty trivial. For some reason the build script does not look for includes in the /usr/local/include/ directory. If I modify the source like this:

diff -u /wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c.orig /wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c
--- /wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c.orig   2015-02-16 09:18:00.000000000 +0000
+++ /wrkdirs/usr/ports/net-im/ejabberd/work/deps/p1_iconv/c_src/iconv.c 2015-02-16 09:19:37.000000000 +0000
@@ -1,6 +1,6 @@
 #include <erl_nif.h>
 #include <string.h>
-#include <iconv.h>
+#include </usr/local/include/iconv.h>

 #define OK 0
 #define ERR_MEMORY_FAIL 1

the compilation is successfull.

I wish I knew how to add -I/usr/local/include/ to the erlang build infrastructure.
Comment 3 Ashish SHUKLA freebsd_committer freebsd_triage 2015-02-16 11:03:29 UTC
Created attachment 153033 [details]
Fix

Sigh! sorry about this. I forgot to commit the fix.

Could you please try this, and let me know if it works for you ?

Thanks!
Comment 4 Victor Sudakov 2015-02-16 11:25:35 UTC
(In reply to Ashish SHUKLA from comment #3)
It works, thank you!
Comment 5 commit-hook freebsd_committer freebsd_triage 2015-02-16 13:56:23 UTC
A commit references this bug:

Author: ashish
Date: Mon Feb 16 13:55:50 UTC 2015
New revision: 379092
URL: https://svnweb.freebsd.org/changeset/ports/379092

Log:
  - Fix building with ICONV option on 9.x and 8.x

  PR:		197697

Changes:
  head/net-im/ejabberd/Makefile
Comment 6 Ashish SHUKLA freebsd_committer freebsd_triage 2015-02-16 13:57:04 UTC
Fixed.

Thanks!