# multimedia/handbrake failing Port compile on -liconv



## MaartenZuidland (Jan 5, 2014)

Hi,

I've understood all steps for searching support, but I've still landed on this forum for help. I've checked the Porter's handbook and the HandBrake documentation extensively, but I'm coming to the conclusion the problem might be in a hard coded piece of code. So far I've tried the HandBrake forums, but not getting any response so far (https://forum.handbrake.fr/viewtopic.php?f=13&t=29133). (The porter seems to be AWOL for a while, he is also not responding to emails sent earlier.)

My code fails during compiling of libblueray, it required liconv (LibIconv), which has been integrated into the main distribution in FreeBSD 10+ (http://www.freebsd.org/doc/en/books/porters-handbook/using-iconv.html)*.*

The error messages I get: (warning: long log file, check the end) http://pastebin.com/tL2AWLNN

Is anyone aware of a patch out here to remove the -liconv for the ld function? As I understand this, it should no longer be added to the line in FreeBSD 10, or (better) it should be replaced with the $ICONV_LIB variable.

I've tried the workaround mentioned in the Handbook, but it did some weird things for me: it keeps changing the following instructions

```
USES=        iconv

post-patch:
    @${REINPLACE_CMD} -e 's/-liconv/${ICONV_LIB}/' ${WRKSRC}/Makefile
```
into this:

```
USES=        iconv

post-patch:
    @${REINPLACE_CMD} -e 's//${ICONV_LIB}/' ${WRKSRC}/Makefile
```

After a few questions in another (Dutch) forum (http://gathering.tweakers.net/forum/list_messages/175207), we concluded it is probably changing the Makefile itself, but I am unsure how to make it change the correct file.

Can someone help me with this one? Thanks!


----------



## wblock@ (Jan 5, 2014)

Which workaround, exactly?  The port Makefile should not be changed, the first form appears to be correct.  The post-patch step changes Makefiles inside the work directory.


----------



## MaartenZuidland (Jan 5, 2014)

I meant the workaround mentioned in the Porter's Handbook, as described in the link to it. The handbook states this as a workaround to remove cases where -liconv is still used. As the port has not been updated since September, and the porter is MIA, I tried to dig into it myself.

The one thing I did notice, after reviewing it, is that I had added ../../ to make the errors go away I got during make. So, it looked like:

```
@${REINPLACE_CMD} -e 's/-liconv/${ICONV_LIB}/' ${WRKSRC}/../../Makefile
```

So, I'm thinking I need to replace ../../Makefile with the correct file with the wrong statement?


----------



## wblock@ (Jan 5, 2014)

It looked like several workarounds, which was why I asked which one, but never mind.

Only files under ${WRKSRC} should be modified.


----------

