# Monitorix port install fails



## xy16644 (Feb 1, 2014)

I'm trying to install sysutils/monitorix on FreeBSD 10.0-STABLE but I am running into this problem:

```
gmake[11]: Entering directory `/usr/ports/devel/glib20/work/glib-2.36.3/glib'
  CC       libglib_2_0_la-gconvert.lo
  CC       libglib_2_0_la-gregex.lo
  CC       libglib_2_0_la-gscanner.lo
  CC       libglib_2_0_la-gsequence.lo
  CC       libglib_2_0_la-gshell.lo
  CC       libglib_2_0_la-gslice.lo
  CC       libglib_2_0_la-gslist.lo
  CC       libglib_2_0_la-gstdio.lo
gconvert.c:66:2: error: GNU libiconv not in use but included iconv.h is from libiconv
#error GNU libiconv not in use but included iconv.h is from libiconv
 ^
gconvert.c:310:21: warning: passing 'gchar **' (aka 'char **') to parameter of type 'const char **' discards qualifiers
      in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
  return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
                    ^~~~~
/usr/local/include/iconv.h:83:48: note: passing argument to parameter 'inbuf' here
extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
                                               ^
1 warning and 1 error generated.
gmake[11]: *** [libglib_2_0_la-gconvert.lo] Error 1
gmake[11]: *** Waiting for unfinished jobs....
gmake[11]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.36.3/glib'
gmake[10]: *** [all-recursive] Error 1
gmake[10]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.36.3/glib'
gmake[9]: *** [all] Error 2
gmake[9]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.36.3/glib'
gmake[8]: *** [all-recursive] Error 1
gmake[8]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.36.3'
gmake[7]: *** [all] Error 2
gmake[7]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.36.3'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[6]: stopped in /usr/ports/devel/glib20
*** Error code 1

Stop.
make[5]: stopped in /usr/ports/devel/glib20
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/graphics/cairo
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/graphics/cairo
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/databases/rrdtool
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/databases/rrdtool
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/monitorix
```

I tried installing devel/glib20 manually but this also failed.

Is there something I can do to get this port installed?


----------



## xy16644 (Feb 2, 2014)

*Re: Monitorx port install fails*

Would installing converters/libiconv fix this install error?


----------



## protocelt (Feb 2, 2014)

*Re: Monitorx port install fails*



			
				xy16644 said:
			
		

> Would installing converters/libiconv fix this install error?



No. converters/libiconv should not be installed in FreeBSD 10 as it is part of the base system. There are some problem ports being fixed currently that won't work correctly with the base system version but they are few. It looks like from the output above you either have the converters/libiconv port installed  or at some point installed it directly or as a dependency, but did not completely remove it. 

What is the output of 
	
	



```
pkg info | grep iconv
```
and 
	
	



```
ls /usr/local/include/iconv.h
```


----------



## xy16644 (Feb 2, 2014)

Output of `pkg info | grep iconv`


```
libiconv-1.14_1                A character set conversion library
php55-iconv-5.5.8_1            The iconv shared extension for php
```

and `ls /usr/local/include/iconv.h`:


```
-r--r--r--  1 root  wheel   9.1K Feb  1 09:39 /usr/local/include/iconv.h
```


----------



## protocelt (Feb 2, 2014)

xy16644 said:
			
		

> Output of `pkg info | grep iconv`
> 
> 
> ```
> ...



Ok, so you have the converters/libiconv port installed. De-install the port 
	
	



```
pkg delete libiconv
```
 and try re-installing the sysutils/monitorix port. 

BTW, the port configures and installs fine on my FreeBSD 10-Stable box, however not tested.


----------



## xy16644 (Feb 2, 2014)

Ok, I assume this port got installed via ports. Is it still ok to uninstall the way you mentioned? Will I need to recompile any dependent ports?


----------



## protocelt (Feb 2, 2014)

Oops!, I just noticed you have converters/php55-iconv installed. I do believe that is one of the ports that still require the converters/libiconv port at this point. converters/php55-iconv is required by I think lang/php55-extensions. To be honest, I'm not sure how to get around this at this point as I don't use PHP. Someone more knowledgeable may have an answer to that.


----------



## protocelt (Feb 3, 2014)

Ok, I looked into this a little more. When is the last time you updated your ports tree?

Looking through /usr/ports/UPDATING, it mentions this: 


> 2013-09-04
> Affects: 10-CURRENT users with any port depending on converters/libiconv
> Author: madpilot@FreeBSD.org
> Reason:
> ...



Following these instructions would find all ports dependent on the converters/libiconv port, delete converters/libiconv, and then re-install all dependent ports which should now use the base iconv. Since this is from 4 months ago, you may have some other show stoppers unrelated to this when following these instructions if you haven't been updating your ports tree and installed ports. If you have been keeping up to date, I _think_ this should fix your problem without error and allow you to install sysutils/monitorix without further problems. I'm not 100% sure of this however, so you can always wait for a better reply from someone that knows more about this than I do.


----------



## xy16644 (Feb 3, 2014)

My ports tree updates every morning so I am never more than a day behind.

I will try the instructions above and see how I get on. I use ports to install ALL my software. I assume using `pkg delete` will be ok?


----------



## protocelt (Feb 3, 2014)

xy16644 said:
			
		

> My ports tree updates every morning so I am never more than a day behind.
> 
> I will try the instructions above and see how I get on. I use ports to install ALL my software. *I assume using  pkg delete will be ok?*



Yes. pkg(8) is compatible with ports-mgmt/portmaster.


----------



## xy16644 (Feb 3, 2014)

So I ran the following:

`# pkg query %ro libiconv >ports_to_update
# pkg delete -f libiconv
# cat ports_to_update | xargs portmaster`

and it ran fine. The end result was:


```
===>>> The following actions were performed:
        Installation of converters/libiconv (libiconv-1.14_1)
        Re-installation of php55-iconv-5.5.8_1
```

I then tried to install monitorix again but it failed:


```
#error GNU libiconv not in use but included iconv.h is from libiconv
 ^

              ~~~~~~~~ ^ ~
gconvert.c:310:21: warning: passing 'gchar **' (aka 'char **') to parameter of type 'const char **' discards qualifiers
      in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
  return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
                    ^~~~~
/usr/local/include/iconv.h:83:48: note: passing argument to parameter 'inbuf' here
extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
                                               ^
1 warning and 1 error generated.
gmake[11]: *** [libglib_2_0_la-gconvert.lo] Error 1
gmake[11]: *** Waiting for unfinished jobs....
2 warnings generated.
gmake[11]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.36.3/glib'
gmake[10]: *** [all-recursive] Error 1
gmake[10]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.36.3/glib'
gmake[9]: *** [all] Error 2
gmake[9]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.36.3/glib'
gmake[8]: *** [all-recursive] Error 1
gmake[8]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.36.3'
gmake[7]: *** [all] Error 2
gmake[7]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.36.3'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[6]: stopped in /usr/ports/devel/glib20
*** Error code 1

Stop.
make[5]: stopped in /usr/ports/devel/glib20
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/graphics/cairo
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/graphics/cairo
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/databases/rrdtool
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/databases/rrdtool
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/monitorix
```

What now?


----------



## protocelt (Feb 3, 2014)

It looks like this is currently being fixed. http://www.freebsd.org/cgi/query-pr.cgi?pr=186295. You may have to wait until the devel/glib20 port is updated, or you could try the patch attached to the PR and try again.


----------



## xy16644 (Feb 3, 2014)

Aaah, I see. Thanks for the tip! 

After installing the patch I have installed monitorx...thanks so much!


----------



## protocelt (Feb 4, 2014)

xy16644 said:
			
		

> After installing the patch I *have not* installed monitorx...thanks so much!



Am I correct in the assumption that this means you _have_ succeeded in installing sysutils/monitorix?


----------



## xy16644 (Feb 4, 2014)

Typo, sorry, I have updated the post.


----------

