From owner-freebsd-doc@FreeBSD.ORG Thu Oct 10 10:00:00 2013 Return-Path: Delivered-To: freebsd-doc@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C6DD5E9B for ; Thu, 10 Oct 2013 10:00:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A67672E5D for ; Thu, 10 Oct 2013 10:00:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AA00bn025317 for ; Thu, 10 Oct 2013 10:00:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r9AA00lq025316; Thu, 10 Oct 2013 10:00:00 GMT (envelope-from gnats) Resent-Date: Thu, 10 Oct 2013 10:00:00 GMT Resent-Message-Id: <201310101000.r9AA00lq025316@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Guido Falsi Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E5136C0B for ; Thu, 10 Oct 2013 09:53:02 +0000 (UTC) (envelope-from mad@micro.madpilot.net) Received: from micro.madpilot.net (micro.madpilot.net [88.149.173.206]) by mx1.freebsd.org (Postfix) with ESMTP id 8787B2DF1 for ; Thu, 10 Oct 2013 09:53:02 +0000 (UTC) Received: from micro.madpilot.net (localhost [127.0.0.1]) by micro.madpilot.net (Postfix) with ESMTP id 3cwSK33vYcz6K for ; Thu, 10 Oct 2013 11:52:55 +0200 (CEST) Received: from micro.madpilot.net ([127.0.0.1]) by micro.madpilot.net (micro.madpilot.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3Smicz2pofPI for ; Thu, 10 Oct 2013 11:52:52 +0200 (CEST) Received: by micro.madpilot.net (Postfix, from userid 1000) id 3cwSK03qZBz6J; Thu, 10 Oct 2013 11:52:52 +0200 (CEST) Message-Id: <3cwSK03qZBz6J@micro.madpilot.net> Date: Thu, 10 Oct 2013 11:52:52 +0200 (CEST) From: Guido Falsi To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.114 Subject: docs/182872: [patch] add updated iconv information to the porter's handbook. X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Guido Falsi List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Oct 2013 10:00:00 -0000 >Number: 182872 >Category: docs >Synopsis: [patch] add updated iconv information to the porter's handbook. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 10 10:00:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Guido Falsi >Release: FreeBSD 9.2-STABLE amd64 >Organization: none >Environment: System: FreeBSD micro.madpilot.net 9.2-STABLE FreeBSD 9.2-STABLE #22 r255995: Wed Oct 2 22:15:55 CEST 2013 root@micro.madpilot.net:/usr/obj/usr/src/sys/MICRO amd64 >Description: After r254273 in head the port's system has been modified to use the native iconv implementation. The iconv USES was modified to allow this and new variables have been created. This patch adds information about this to the handbook. >How-To-Repeat: >Fix: Index: en_US.ISO8859-1/books/porters-handbook/book.xml =================================================================== --- en_US.ISO8859-1/books/porters-handbook/book.xml (revision 42923) +++ en_US.ISO8859-1/books/porters-handbook/book.xml (working copy) @@ -9356,6 +9356,134 @@ + + Using <command>iconv</command> + + After r254273 FreeBSD 10-CURRENT and newer have a native + iconv implmentation. On previous versions the converters/libiconv port was used + as the default implementation. + + If your software uses the iconv functionality, define + USES=iconv. On OS versions before + r254273, without a native iconv implementation, a dependency + on converters/libiconv + will be added. + + The iconv.mk USES file defines the + following variables you can use in your port: + + + + + + Variable name + Purpose + Value with base before r254273 + Value with base after r254273 + + + + + + ICONV_CMD + Where the iconv binary + resides + ${LOCALBASE}/bin/iconv + /usr/bin/iconv + + + + ICONV_LIB + ld argument to link to libiconv (if needed) + -liconv + (empty) + + + + ICONV_PREFIX + Where the iconv implementation resides (useful + for configure scripts) + ${LOCALBASE} + /usr + + + + ICONV_CONFIGURE_ARG + Preconstructed configure argument for + configure scripts + --with-libiconv-prefix=${LOCALBASE} + (empty) + + + + ICONV_CONFIGURE_BASE + Preconstructed configure argument for + configure scripts + --with-libiconv=${LOCALBASE} + (empty) + + + + + + The following two examples will automatically populate + the variables with the correct value or empty for systems + using iconv or native iconv respectively: + + + Simple iconv Usage + + USES= iconv +LDFLAGS+= -L${LOCALBASE}/lib ${ICONV_LIB} + + + + iconv Usage With configure + + USES= iconv +CONFIGURE_ARGS+=${ICONV_CONFIGURE_ARG} + + + Sometimes a software has some ld argument or search + path hardcoded in it's Makefile or configure script, such an + approach can be used to fix these: + + + Fixing Hardcoded -liconv + + USES= iconv + +post-patch: + @${REINPLACE_CMD} -e 's/-liconv/${ICONV_LIB}/' ${WRKSRC}/Makefile + + + + In some cases it is necessary to conditionally set some + other values or performing operations depending on the presence + or absence of the native iconv implementations. in such cases + you can do this by checking if the ICONV_LIB is empty; doing + this requires bsd.port.pre.mk to be + included: + + + Setting Port make Variables Depending on Native iconv + Availability + + USES= iconv + +.include <bsd.port.pre.mk> + +post-patch: +.if empty(ICONV_LIB) + @${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.sh +.endif + +.include <bsd.port.post.mk> + + + + Using Xfce Index: en_US.ISO8859-1/books/porters-handbook/uses.xml =================================================================== --- en_US.ISO8859-1/books/porters-handbook/uses.xml (revision 42923) +++ en_US.ISO8859-1/books/porters-handbook/uses.xml (working copy) @@ -106,10 +106,18 @@ iconv - (none) - Implies that the port uses converters/libiconv as build-time and - run-time dependency. + (none), lib, build, + patch + Implies that the port uses iconv functions, from port + converters/libiconv as + build-time and run-time dependency or from base system on + 10-CURRENT after native iconv implementation has been committed + in r254273. By default, with no arguments or with the + lib argument, implies iconv + with build-time and run-time dependencies, build + implies a build-time dependency, and patch + implies a patch-time dependency. For more information see + . >Release-Note: >Audit-Trail: >Unformatted: