From owner-svn-doc-head@freebsd.org Tue Jun 30 11:10:39 2015 Return-Path: Delivered-To: svn-doc-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8E4D98EAF5; Tue, 30 Jun 2015 11:10:39 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 980F11488; Tue, 30 Jun 2015 11:10:39 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5UBAdlp007841; Tue, 30 Jun 2015 11:10:39 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5UBAdM2007840; Tue, 30 Jun 2015 11:10:39 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201506301110.t5UBAdM2007840@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Tue, 30 Jun 2015 11:10:39 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r46900 - head/en_US.ISO8859-1/books/porters-handbook/makefiles X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 11:10:39 -0000 Author: mat Date: Tue Jun 30 11:10:38 2015 New Revision: 46900 URL: https://svnweb.freebsd.org/changeset/doc/46900 Log: Document the new multiple-USE_GITHUB. Approved by: wblock (mentor) Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D2781 Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml Tue Jun 30 09:03:55 2015 (r46899) +++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml Tue Jun 30 11:10:38 2015 (r46900) @@ -1930,8 +1930,9 @@ MASTER_SITE_SUBDIR= stardict/WyabdcRealP + - + <varname>USE_GITHUB</varname> If the distribution file comes from a specific commit or @@ -2009,8 +2010,8 @@ GH_ACCOUNT= freebsd While trying to make a port for the bleeding edge version of pkg from the &os; user on github, at , The - Makefile would end up looking like + xlink:href="https://github.com/freebsd/pkg"/>, the + Makefile ends up looking like this (slightly stripped for the example): PORTNAME= pkg-devel @@ -2051,6 +2052,87 @@ USE_GITHUB= yes ${WRKDIR}/foo-1.0.2. + + Fetching Multiple Files From GitHub + + The USE_GITHUB framework also + supports fetching multiple distribution files from + different places in GitHub. It works in a way very + similar to . + + Multiple values are added to + GH_ACCOUNT, + GH_PROJECT, and + GH_TAGNAME. Each different value is + assigned a tag. The main value can either have no tag, or + the :DEFAULT tag. A value can be + omitted if it is the same as the default as listed in + . + + For each tag, a + ${WRKSRC_tag} + helper variable is created, containing the directory into + which the file has been extracted. The + ${WRKSRC_tag} + variables can be used to move directories around during + post-extract, or add to + CONFIGURE_ARGS, or whatever is needed + so that the software builds correctly. + + + Use of <varname>USE_GITHUB</varname> with Multiple + Distribution Files + + From time to time, there is a need to fetch more + than one distribution file. For example, when the + upstream git repository uses submodules. This can be + done easily using tags in the + GH_* + variables: + + PORTNAME= foo +PORTVERSION= 1.0.2 + +USE_GITHUB= yes +GH_ACCOUNT= bar:icons,contrib +GH_PROJECT= foo-icons:icons foo-contrib:contrib +GH_TAGNAME= 1.0:icons fa579bc:contrib + +CONFIGURE_ARGS= --with-contrib=${WRKSRC_contrib} + +post-extract: + @${MV} ${WRKSRC_icons} ${WRKSRC}/icons + + This will fetch three distribution files from + github. The default one comes from + foo/foo and is version + 1.0.2. The second one, tagged + icons, comes from + bar/foo-icons and is in version + 1.0. The third one comes from + bar/foo-contrib and uses the + Git commit + fa579bc. The distribution files are + named foo-foo-1.0.2_GH0.tar.gz, + bar-foo-icons-1.0_GH0.tar.gz, and + bar-foo-contrib-fa579bc_GH0.tar.gz. + + All the distribution files are extracted in + ${WRKDIR} in their respective + subdirectories. The default file is still extracted in + ${WRKSRC}, in this case, + ${WRKDIR}/foo-1.0.2. Each + additional distribution file is extracted in + ${WRKSRC_tag}. + Here, for the icons tag, it is called + ${WRKSRC_icons} and it contains + ${WRKDIR}/foo-icons-1.0. The file + with the contrib tag is called + ${WRKSRC_contrib} and contains + ${WRKDIR}/foo-contrib-fa579bc. + @@ -2185,9 +2267,8 @@ EXTRACT_ONLY= source.tar.gz - Multiple Distribution Files or Patches from Different - Sites and Subdirectories - (<literal>MASTER_SITES:n</literal>) + Multiple Distribution or Patches Files from Multiple + Locations (Consider this to be a somewhat advanced topic; those new to this document