Bug 197697 - net-im/ejabberd: Does not build on 9.3 and 8.4: iconv.h: No such file or directory
Summary: net-im/ejabberd: Does not build on 9.3 and 8.4: iconv.h: No such file or dire...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ashish SHUKLA
URL:
Keywords: needs-qa, patch
Depends on:
Blocks:
 
Reported: 2015-02-16 05:09 UTC by Victor Sudakov
Modified: 2015-02-16 13:57 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (ashish)


Attachments
Poudriere failed build log (34.00 KB, text/plain)
2015-02-16 05:09 UTC, Victor Sudakov
no flags Details
Fix (440 bytes, patch)
2015-02-16 11:03 UTC, Ashish SHUKLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 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 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 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 2015-02-16 13:57:04 UTC
Fixed.

Thanks!