public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-04-17 19:41 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-04-17 19:41 UTC (permalink / raw
  To: gentoo-commits

commit:     8eebcbc64168a88c4a4ebd0281f7bbcef3874901
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 17 19:41:01 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Apr 17 19:41:01 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=8eebcbc6

systemd.eclass: initial version of the helper eclass.

---
 eclass/systemd.eclass |   55 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
new file mode 100644
index 0000000..d5d90ee
--- /dev/null
+++ b/eclass/systemd.eclass
@@ -0,0 +1,55 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# @ECLASS: systemd.eclass
+# @MAINTAINER:
+# mgorny@gentoo.org
+# @BLURB: helper functions to install systemd units
+# @DESCRIPTION:
+# This eclass provides a set of functions to install unit files for
+# sys-apps/systemd within ebuilds.
+
+inherit multilib
+
+case ${EAPI:-0} in
+	0|1|2|3|4) ;;
+	*) die "EAPI ${EAPI} unsupported."
+esac
+
+# @FUNCTION: systemd_get_unitdir
+# @DESCRIPTION:
+# Output the path for the systemd unit directory (not including ${D}).
+systemd_get_unitdir() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	echo /$(get_libdir)/systemd/system
+}
+
+# @FUNCTION: systemd_dounit
+# @USAGE: unit1 [...]
+# @DESCRIPTION:
+# Install systemd unit(s).
+systemd_dounit() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	(
+		insinto "$(systemd_get_unitdir)"
+		doins "${@}"
+	)
+}
+
+# @FUNCTION: systemd_enable_service
+# @USAGE: target service
+# @DESCRIPTION:
+# Enable service in desired target, e.g. install a symlink for it.
+systemd_enable_service() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local target=${1}
+	local service=${2}
+	local ud=$(systemd_get_unitdir)
+
+	dodir "${ud}"/"${target}".wants && \
+	dosym ../"${service}" "${ud}"/"${target}".wants
+}



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-04-28 14:02 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-04-28 14:02 UTC (permalink / raw
  To: gentoo-commits

commit:     23d068c81ea7e71d480a60d202d5e750c366927e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 28 14:02:18 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Apr 28 14:02:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=23d068c8

[systemd.eclass] Add a function to output --with-...

---
 eclass/systemd.eclass |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index d5d90ee..e227829 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Header: $
 
@@ -53,3 +53,13 @@ systemd_enable_service() {
 	dodir "${ud}"/"${target}".wants && \
 	dosym ../"${service}" "${ud}"/"${target}".wants
 }
+
+# @FUNCTION: systemd_with_unitdir
+# @DESCRIPTION:
+# Output '--with-systemdsystemunitdir' as expected by systemd-aware configure
+# scripts.
+systemd_dounit() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	echo -n --with-systemdsystemunitdir="$(systemd_get_unitdir)"
+}



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-04-28 14:33 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-04-28 14:33 UTC (permalink / raw
  To: gentoo-commits

commit:     c50d3eb2e0277e0f4eafbc179f26c67cb4a02759
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 28 14:04:17 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Apr 28 14:04:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=c50d3eb2

Rename systemd.eclass -> systemd-units.eclass.

---
 eclass/{systemd.eclass => systemd-units.eclass} |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd-units.eclass
similarity index 97%
rename from eclass/systemd.eclass
rename to eclass/systemd-units.eclass
index e227829..fde896f 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd-units.eclass
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: $
 
-# @ECLASS: systemd.eclass
+# @ECLASS: systemd-units.eclass
 # @MAINTAINER:
 # mgorny@gentoo.org
 # @BLURB: helper functions to install systemd units



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-04-28 14:33 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-04-28 14:33 UTC (permalink / raw
  To: gentoo-commits

commit:     ceed6d35d2b2277a4e8963f13de8140461200b2b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 28 14:30:37 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Apr 28 14:30:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=ceed6d35

[eclass] Fix function name.

---
 eclass/systemd-units.eclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/eclass/systemd-units.eclass b/eclass/systemd-units.eclass
index fde896f..0289fdc 100644
--- a/eclass/systemd-units.eclass
+++ b/eclass/systemd-units.eclass
@@ -58,7 +58,7 @@ systemd_enable_service() {
 # @DESCRIPTION:
 # Output '--with-systemdsystemunitdir' as expected by systemd-aware configure
 # scripts.
-systemd_dounit() {
+systemd_with_unitdir() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	echo -n --with-systemdsystemunitdir="$(systemd_get_unitdir)"



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-04-28 16:33 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-04-28 16:33 UTC (permalink / raw
  To: gentoo-commits

commit:     8fb642340a7c3ee3f7573ea39619e4f5ddde3af2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 28 16:33:47 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Apr 28 16:33:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=8fb64234

Revert "Rename systemd.eclass -> systemd-units.eclass."

This reverts commit c50d3eb2e0277e0f4eafbc179f26c67cb4a02759.

---
 eclass/{systemd-units.eclass => systemd.eclass} |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/eclass/systemd-units.eclass b/eclass/systemd.eclass
similarity index 97%
rename from eclass/systemd-units.eclass
rename to eclass/systemd.eclass
index 0289fdc..4234427 100644
--- a/eclass/systemd-units.eclass
+++ b/eclass/systemd.eclass
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: $
 
-# @ECLASS: systemd-units.eclass
+# @ECLASS: systemd.eclass
 # @MAINTAINER:
 # mgorny@gentoo.org
 # @BLURB: helper functions to install systemd units



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-04-30  6:45 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-04-30  6:45 UTC (permalink / raw
  To: gentoo-commits

commit:     aeb3f59f2bfa985d75f54764735849e377edafa5
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 30 06:28:26 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 06:28:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=aeb3f59f

[eclass] Clarify EAPI support message.

---
 eclass/systemd.eclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index fa18447..5325e68 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -14,7 +14,7 @@ inherit multilib
 
 case ${EAPI:-0} in
 	0|1|2|3|4) ;;
-	*) die "EAPI ${EAPI} unsupported."
+	*) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
 esac
 
 # @FUNCTION: systemd_get_unitdir



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-04-30  6:45 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-04-30  6:45 UTC (permalink / raw
  To: gentoo-commits

commit:     6321148ad3c045fc63e9b9e8b53f26a1a1abbc6f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 30 06:33:28 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 06:33:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=6321148a

[eclass] Docs.

---
 eclass/systemd.eclass |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index 5325e68..517026a 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -20,6 +20,7 @@ esac
 # @FUNCTION: systemd_get_unitdir
 # @DESCRIPTION:
 # Output the path for the systemd unit directory (not including ${D}).
+# This function always succeeds, even if systemd is not installed.
 systemd_get_unitdir() {
 	debug-print-function ${FUNCNAME} "${@}"
 
@@ -29,7 +30,8 @@ systemd_get_unitdir() {
 # @FUNCTION: systemd_dounit
 # @USAGE: unit1 [...]
 # @DESCRIPTION:
-# Install systemd unit(s).
+# Install systemd unit(s). Uses doins, thus it is fatal in EAPI 4
+# and non-fatal in earlier EAPIs.
 systemd_dounit() {
 	debug-print-function ${FUNCNAME} "${@}"
 
@@ -43,9 +45,13 @@ systemd_dounit() {
 # @USAGE: target service
 # @DESCRIPTION:
 # Enable service in desired target, e.g. install a symlink for it.
+# Uses dosym, thus it is fatal in EAPI 4 and non-fatal in earlier
+# EAPIs.
 systemd_enable_service() {
 	debug-print-function ${FUNCNAME} "${@}"
 
+	[[ ${#} -eq 2 ]] || die "Synopsis: systemd_enable_service target service"
+
 	local target=${1}
 	local service=${2}
 	local ud=$(systemd_get_unitdir)
@@ -57,7 +63,8 @@ systemd_enable_service() {
 # @FUNCTION: systemd_with_unitdir
 # @DESCRIPTION:
 # Output '--with-systemdsystemunitdir' as expected by systemd-aware configure
-# scripts.
+# scripts. This function always succeeds. Its output may be quoted in order
+# to preserve whitespace in paths.
 systemd_with_unitdir() {
 	debug-print-function ${FUNCNAME} "${@}"
 



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-04-30  6:45 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-04-30  6:45 UTC (permalink / raw
  To: gentoo-commits

commit:     332e64d0413a0ef8bec096c2f6c1a04829e4752c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 30 06:36:22 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 06:45:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=332e64d0

[eclass] Introduce systemd_to_myeconfargs().

---
 eclass/systemd.eclass |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index 517026a..d392fc3 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -64,9 +64,24 @@ systemd_enable_service() {
 # @DESCRIPTION:
 # Output '--with-systemdsystemunitdir' as expected by systemd-aware configure
 # scripts. This function always succeeds. Its output may be quoted in order
-# to preserve whitespace in paths.
+# to preserve whitespace in paths. systemd_to_myeconfargs() is preferred over
+# this function.
 systemd_with_unitdir() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	echo -n --with-systemdsystemunitdir="$(systemd_get_unitdir)"
 }
+
+# @FUNCTION: systemd_to_myeconfargs
+# @DESCRIPTION:
+# Add '--with-systemdsystemunitdir' as expected by systemd-aware configure
+# scripts to the myeconfargs variable used by autotools-utils eclass. Handles
+# quoting automatically.
+systemd_to_myeconfargs() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	myeconfargs=(
+		"${myeconfargs[@]}"
+		--with-systemdsystemunitdir="$(systemd_get_unitdir)"
+	)
+}



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-04-30  6:45 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-04-30  6:45 UTC (permalink / raw
  To: gentoo-commits

commit:     0f71b6f37afdc9f72a020a1734893fab87d0fe83
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 30 06:26:13 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 06:26:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=0f71b6f3

[eclass] Use /lib like upstream does.

---
 eclass/systemd.eclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index 4234427..fa18447 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -23,7 +23,7 @@ esac
 systemd_get_unitdir() {
 	debug-print-function ${FUNCNAME} "${@}"
 
-	echo /$(get_libdir)/systemd/system
+	echo -n /lib/systemd/system
 }
 
 # @FUNCTION: systemd_dounit



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-04-30 21:14 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-04-30 21:14 UTC (permalink / raw
  To: gentoo-commits

commit:     8ffd8c6ce46c847ccac7f3d69def762dc42fde9e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 30 21:14:35 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 21:14:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=8ffd8c6c

[eclass] Add an example.

---
 eclass/systemd.eclass |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index d392fc3..a14aa2c 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -9,6 +9,21 @@
 # @DESCRIPTION:
 # This eclass provides a set of functions to install unit files for
 # sys-apps/systemd within ebuilds.
+# @EXAMPLE:
+#
+# @CODE
+# inherit autotools-utils systemd
+# 
+# src_configure() {
+#	local myeconfargs=(
+#		--enable-foo
+#		--disable-bar
+#	)
+#
+#	systemd_to_myeconfargs
+#	autotools-utils_src_configure
+# }
+# @CODE
 
 inherit multilib
 



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-09-18  9:42 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-09-18  9:42 UTC (permalink / raw
  To: gentoo-commits

commit:     40f5a7b28646ea742bdd2abc5dc4d6c91314ccd6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 18 08:02:53 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Sep 18 08:02:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=40f5a7b2

Remove old eclass.

---
 eclass/systemd.eclass |  102 -------------------------------------------------
 1 files changed, 0 insertions(+), 102 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
deleted file mode 100644
index a14aa2c..0000000
--- a/eclass/systemd.eclass
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-# @ECLASS: systemd.eclass
-# @MAINTAINER:
-# mgorny@gentoo.org
-# @BLURB: helper functions to install systemd units
-# @DESCRIPTION:
-# This eclass provides a set of functions to install unit files for
-# sys-apps/systemd within ebuilds.
-# @EXAMPLE:
-#
-# @CODE
-# inherit autotools-utils systemd
-# 
-# src_configure() {
-#	local myeconfargs=(
-#		--enable-foo
-#		--disable-bar
-#	)
-#
-#	systemd_to_myeconfargs
-#	autotools-utils_src_configure
-# }
-# @CODE
-
-inherit multilib
-
-case ${EAPI:-0} in
-	0|1|2|3|4) ;;
-	*) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
-esac
-
-# @FUNCTION: systemd_get_unitdir
-# @DESCRIPTION:
-# Output the path for the systemd unit directory (not including ${D}).
-# This function always succeeds, even if systemd is not installed.
-systemd_get_unitdir() {
-	debug-print-function ${FUNCNAME} "${@}"
-
-	echo -n /lib/systemd/system
-}
-
-# @FUNCTION: systemd_dounit
-# @USAGE: unit1 [...]
-# @DESCRIPTION:
-# Install systemd unit(s). Uses doins, thus it is fatal in EAPI 4
-# and non-fatal in earlier EAPIs.
-systemd_dounit() {
-	debug-print-function ${FUNCNAME} "${@}"
-
-	(
-		insinto "$(systemd_get_unitdir)"
-		doins "${@}"
-	)
-}
-
-# @FUNCTION: systemd_enable_service
-# @USAGE: target service
-# @DESCRIPTION:
-# Enable service in desired target, e.g. install a symlink for it.
-# Uses dosym, thus it is fatal in EAPI 4 and non-fatal in earlier
-# EAPIs.
-systemd_enable_service() {
-	debug-print-function ${FUNCNAME} "${@}"
-
-	[[ ${#} -eq 2 ]] || die "Synopsis: systemd_enable_service target service"
-
-	local target=${1}
-	local service=${2}
-	local ud=$(systemd_get_unitdir)
-
-	dodir "${ud}"/"${target}".wants && \
-	dosym ../"${service}" "${ud}"/"${target}".wants
-}
-
-# @FUNCTION: systemd_with_unitdir
-# @DESCRIPTION:
-# Output '--with-systemdsystemunitdir' as expected by systemd-aware configure
-# scripts. This function always succeeds. Its output may be quoted in order
-# to preserve whitespace in paths. systemd_to_myeconfargs() is preferred over
-# this function.
-systemd_with_unitdir() {
-	debug-print-function ${FUNCNAME} "${@}"
-
-	echo -n --with-systemdsystemunitdir="$(systemd_get_unitdir)"
-}
-
-# @FUNCTION: systemd_to_myeconfargs
-# @DESCRIPTION:
-# Add '--with-systemdsystemunitdir' as expected by systemd-aware configure
-# scripts to the myeconfargs variable used by autotools-utils eclass. Handles
-# quoting automatically.
-systemd_to_myeconfargs() {
-	debug-print-function ${FUNCNAME} "${@}"
-
-	myeconfargs=(
-		"${myeconfargs[@]}"
-		--with-systemdsystemunitdir="$(systemd_get_unitdir)"
-	)
-}



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-11-29 21:41 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-11-29 21:41 UTC (permalink / raw
  To: gentoo-commits

commit:     036914971ecdc867fde5874cd57f6eda084a1423
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 29 21:04:41 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Nov 29 21:04:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=03691497

Import autotools-utils from gx86

---
 eclass/autotools-utils.eclass |  310 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 310 insertions(+), 0 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
new file mode 100644
index 0000000..0aa1679
--- /dev/null
+++ b/eclass/autotools-utils.eclass
@@ -0,0 +1,310 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.29 2011/11/27 09:57:20 mgorny Exp $
+
+# @ECLASS: autotools-utils.eclass
+# @MAINTAINER:
+# Maciej Mrozowski <reavertm@gentoo.org>
+# Michał Górny <mgorny@gentoo.org>
+# @BLURB: common ebuild functions for autotools-based packages
+# @DESCRIPTION:
+# autotools-utils.eclass is autotools.eclass(5) and base.eclass(5) wrapper
+# providing all inherited features along with econf arguments as Bash array,
+# out of source build with overridable build dir location, static archives
+# handling, libtool files removal.
+#
+# Please note note that autotools-utils does not support mixing of its phase
+# functions with regular econf/emake calls. If necessary, please call
+# autotools-utils_src_compile instead of the latter.
+#
+# @EXAMPLE:
+# Typical ebuild using autotools-utils.eclass:
+#
+# @CODE
+# EAPI="2"
+#
+# inherit autotools-utils
+#
+# DESCRIPTION="Foo bar application"
+# HOMEPAGE="http://example.org/foo/"
+# SRC_URI="mirror://sourceforge/foo/${P}.tar.bz2"
+#
+# LICENSE="LGPL-2.1"
+# KEYWORDS=""
+# SLOT="0"
+# IUSE="debug doc examples qt4 static-libs tiff"
+#
+# CDEPEND="
+# 	media-libs/libpng:0
+# 	qt4? (
+# 		x11-libs/qt-core:4
+# 		x11-libs/qt-gui:4
+# 	)
+# 	tiff? ( media-libs/tiff:0 )
+# "
+# RDEPEND="${CDEPEND}
+# 	!media-gfx/bar
+# "
+# DEPEND="${CDEPEND}
+# 	doc? ( app-doc/doxygen )
+# "
+#
+# # bug 123456
+# AUTOTOOLS_IN_SOURCE_BUILD=1
+#
+# DOCS=(AUTHORS ChangeLog README "Read me.txt" TODO)
+#
+# PATCHES=(
+# 	"${FILESDIR}/${P}-gcc44.patch" # bug 123458
+# 	"${FILESDIR}/${P}-as-needed.patch"
+# 	"${FILESDIR}/${P}-unbundle_libpng.patch"
+# )
+#
+# src_configure() {
+# 	local myeconfargs=(
+# 		$(use_enable debug)
+# 		$(use_with qt4)
+# 		$(use_enable threads multithreading)
+# 		$(use_with tiff)
+# 	)
+# 	autotools-utils_src_configure
+# }
+#
+# src_compile() {
+# 	autotools-utils_src_compile
+# 	use doc && autotools-utils_src_compile docs
+# }
+#
+# src_install() {
+# 	use doc && HTML_DOCS=("${AUTOTOOLS_BUILD_DIR}/apidocs/html/")
+# 	autotools-utils_src_install
+# 	if use examples; then
+# 		dobin "${AUTOTOOLS_BUILD_DIR}"/foo_example{1,2,3} \\
+# 			|| die 'dobin examples failed'
+# 	fi
+# }
+#
+# @CODE
+
+# Keep variable names synced with cmake-utils and the other way around!
+
+case ${EAPI:-0} in
+	2|3|4) ;;
+	*) die "EAPI=${EAPI} is not supported" ;;
+esac
+
+inherit autotools base eutils libtool
+
+EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
+
+# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
+# @DESCRIPTION:
+# Build directory, location where all autotools generated files should be
+# placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
+
+# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
+# @DESCRIPTION:
+# Set to enable in-source build.
+
+# @ECLASS-VARIABLE: ECONF_SOURCE
+# @DESCRIPTION:
+# Specify location of autotools' configure script. By default it uses ${S}.
+
+# @ECLASS-VARIABLE: myeconfargs
+# @DESCRIPTION:
+# Optional econf arguments as Bash array. Should be defined before calling src_configure.
+# @CODE
+# src_configure() {
+# 	local myeconfargs=(
+# 		--disable-readline
+# 		--with-confdir="/etc/nasty foo confdir/"
+# 		$(use_enable debug cnddebug)
+# 		$(use_enable threads multithreading)
+# 	)
+# 	autotools-utils_src_configure
+# }
+# @CODE
+
+# Determine using IN or OUT source build
+_check_build_dir() {
+	: ${ECONF_SOURCE:=${S}}
+	if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
+		AUTOTOOLS_BUILD_DIR="${ECONF_SOURCE}"
+	else
+		: ${AUTOTOOLS_BUILD_DIR:=${WORKDIR}/${P}_build}
+	fi
+	echo ">>> Working in BUILD_DIR: \"$AUTOTOOLS_BUILD_DIR\""
+}
+
+# @FUNCTION: remove_libtool_files
+# @USAGE: [all]
+# @DESCRIPTION:
+# Determines unnecessary libtool files (.la) and libtool static archives (.a)
+# and removes them from installation image.
+#
+# To unconditionally remove all libtool files, pass 'all' as argument.
+# Otherwise, libtool archives required for static linking will be preserved.
+#
+# In most cases it's not necessary to manually invoke this function.
+# See autotools-utils_src_install for reference.
+remove_libtool_files() {
+	debug-print-function ${FUNCNAME} "$@"
+	local removing_all
+	[[ ${#} -le 1 ]] || die "Invalid number of args to ${FUNCNAME}()"
+	if [[ ${#} -eq 1 ]]; then
+		case "${1}" in
+			all)
+				removing_all=1
+				;;
+			*)
+				die "Invalid argument to ${FUNCNAME}(): ${1}"
+		esac
+	fi
+
+	local pc_libs=()
+	if [[ ! ${removing_all} ]]; then
+		local arg
+		for arg in $(find "${D}" -name '*.pc' -exec \
+					sed -n -e 's;^Libs:;;p' {} +); do
+			[[ ${arg} == -l* ]] && pc_libs+=(lib${arg#-l}.la)
+		done
+	fi
+
+	local f
+	find "${D}" -type f -name '*.la' -print0 | while read -r -d '' f; do
+		local shouldnotlink=$(sed -ne '/^shouldnotlink=yes$/p' "${f}")
+		local archivefile=${f/%.la/.a}
+		[[ "${f}" != "${archivefile}" ]] || die 'regex sanity check failed'
+
+		# Remove static libs we're not supposed to link against.
+		if [[ ${shouldnotlink} ]]; then
+			einfo "Removing unnecessary ${archivefile#${D%/}}"
+			rm -f "${archivefile}" || die
+			# The .la file may be used by a module loader, so avoid removing it
+			# unless explicitly requested.
+			[[ ${removing_all} ]] || continue
+		fi
+
+		# Remove .la files when:
+		# - user explicitly wants us to remove all .la files,
+		# - respective static archive doesn't exist,
+		# - they are covered by a .pc file already,
+		# - they don't provide any new information (no libs & no flags).
+		local removing
+		if [[ ${removing_all} ]]; then removing='forced'
+		elif [[ ! -f ${archivefile} ]]; then removing='no static archive'
+		elif has "$(basename "${f}")" "${pc_libs[@]}"; then
+			removing='covered by .pc'
+		elif [[ ! $(sed -n -e \
+			"s/^\(dependency_libs\|inherited_linker_flags\)='\(.*\)'$/\2/p" \
+			"${f}") ]]; then removing='no libs & flags'
+		fi
+
+		if [[ ${removing} ]]; then
+			einfo "Removing unnecessary ${f#${D%/}} (${removing})"
+			rm -f "${f}" || die
+		fi
+	done
+
+	# check for invalid eclass use
+	# this is the most commonly used function, so do it here
+	_check_build_dir
+	if [[ ! -d "${AUTOTOOLS_BUILD_DIR}" ]]; then
+		eqawarn "autotools-utils used but autotools-utils_src_configure was never called."
+		eqawarn "This is not supported and never was. Please report a bug against"
+		eqawarn "the offending ebuild. This will become a fatal error in a near future."
+	fi
+}
+
+# @FUNCTION: autotools-utils_src_prepare
+# @DESCRIPTION:
+# The src_prepare function.
+#
+# Supporting PATCHES array and user patches. See base.eclass(5) for reference.
+autotools-utils_src_prepare() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	base_src_prepare
+	elibtoolize --patch-only
+}
+
+# @FUNCTION: autotools-utils_src_configure
+# @DESCRIPTION:
+# The src_configure function. For out of source build it creates build
+# directory and runs econf there. Configuration parameters defined
+# in myeconfargs are passed here to econf. Additionally following USE
+# flags are known:
+#
+# IUSE="static-libs" passes --enable-shared and either --disable-static/--enable-static
+# to econf respectively.
+autotools-utils_src_configure() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	[[ -z ${myeconfargs+1} || $(declare -p myeconfargs) == 'declare -a'* ]] \
+		|| die 'autotools-utils.eclass: myeconfargs has to be an array.'
+
+	# Common args
+	local econfargs=()
+
+	# Handle static-libs found in IUSE, disable them by default
+	if in_iuse static-libs; then
+		econfargs+=(
+			--enable-shared
+			$(use_enable static-libs static)
+		)
+	fi
+
+	# Append user args
+	econfargs+=("${myeconfargs[@]}")
+
+	_check_build_dir
+	mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
+	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
+	base_src_configure "${econfargs[@]}" "$@"
+	popd > /dev/null
+}
+
+# @FUNCTION: autotools-utils_src_compile
+# @DESCRIPTION:
+# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR.
+autotools-utils_src_compile() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	_check_build_dir
+	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
+	base_src_compile "$@"
+	popd > /dev/null
+}
+
+# @FUNCTION: autotools-utils_src_install
+# @DESCRIPTION:
+# The autotools src_install function. Runs emake install, unconditionally
+# removes unnecessary static libs (based on shouldnotlink libtool property)
+# and removes unnecessary libtool files when static-libs USE flag is defined
+# and unset.
+#
+# DOCS and HTML_DOCS arrays are supported. See base.eclass(5) for reference.
+autotools-utils_src_install() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	_check_build_dir
+	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
+	base_src_install "$@"
+	popd > /dev/null
+
+	# Remove libtool files and unnecessary static libs
+	remove_libtool_files
+}
+
+# @FUNCTION: autotools-utils_src_test
+# @DESCRIPTION:
+# The autotools src_test function. Runs emake check in build directory.
+autotools-utils_src_test() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	_check_build_dir
+	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
+	# Run default src_test as defined in ebuild.sh
+	default_src_test
+	popd > /dev/null
+}



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-11-29 21:41 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-11-29 21:41 UTC (permalink / raw
  To: gentoo-commits

commit:     8075e6f18a42e8504026b7a7d458a4d86cfb4371
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 29 21:11:44 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Nov 29 21:13:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=8075e6f1

autotools-utils: Disable unnecessarily adding autotools depends.

---
 eclass/autotools-utils.eclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 0aa1679..1f75cd9 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -93,6 +93,7 @@ case ${EAPI:-0} in
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
+AUTOTOOLS_AUTO_DEPEND=no \
 inherit autotools base eutils libtool
 
 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-12-05  8:36 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-12-05  8:36 UTC (permalink / raw
  To: gentoo-commits

commit:     ecc6cc7bb7f67cd024df4ae4840d77d823c3ceff
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 30 17:50:12 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Dec  5 08:36:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=ecc6cc7b

autotools-utils: drop base.eclass inherit and thus src_unpack() export.

Importing base.eclass causes us to export src_unpack() phase function
which is entirely useless in EAPIs 2+ (which we only support), and
causes trouble importing autotools-utils e.g. after VCS eclasses.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=392651

---
 eclass/autotools-utils.eclass |   54 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 1f75cd9..2ad6e38 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -94,24 +94,28 @@ case ${EAPI:-0} in
 esac
 
 AUTOTOOLS_AUTO_DEPEND=no \
-inherit autotools base eutils libtool
+inherit autotools eutils libtool
 
 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
 
 # @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # Build directory, location where all autotools generated files should be
 # placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
 
 # @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # Set to enable in-source build.
 
 # @ECLASS-VARIABLE: ECONF_SOURCE
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # Specify location of autotools' configure script. By default it uses ${S}.
 
 # @ECLASS-VARIABLE: myeconfargs
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # Optional econf arguments as Bash array. Should be defined before calling src_configure.
 # @CODE
@@ -126,6 +130,36 @@ EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
 # }
 # @CODE
 
+# @ECLASS-VARIABLE: DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array containing documents passed to dodoc command.
+#
+# Example:
+# @CODE
+# DOCS=( NEWS README )
+# @CODE
+
+# @ECLASS-VARIABLE: HTML_DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array containing documents passed to dohtml command.
+#
+# Example:
+# @CODE
+# HTML_DOCS=( doc/html/ )
+# @CODE
+
+# @ECLASS-VARIABLE: PATCHES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# PATCHES array variable containing all various patches to be applied.
+#
+# Example:
+# @CODE
+# PATCHES=( "${FILESDIR}"/${P}-mypatch.patch )
+# @CODE
+
 # Determine using IN or OUT source build
 _check_build_dir() {
 	: ${ECONF_SOURCE:=${S}}
@@ -225,7 +259,9 @@ remove_libtool_files() {
 autotools-utils_src_prepare() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	base_src_prepare
+	[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+	epatch_user
+
 	elibtoolize --patch-only
 }
 
@@ -261,7 +297,7 @@ autotools-utils_src_configure() {
 	_check_build_dir
 	mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
 	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
-	base_src_configure "${econfargs[@]}" "$@"
+	econf "${econfargs[@]}" "$@"
 	popd > /dev/null
 }
 
@@ -273,7 +309,7 @@ autotools-utils_src_compile() {
 
 	_check_build_dir
 	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
-	base_src_compile "$@"
+	emake "$@" || die 'emake failed'
 	popd > /dev/null
 }
 
@@ -290,9 +326,17 @@ autotools-utils_src_install() {
 
 	_check_build_dir
 	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
-	base_src_install "$@"
+	emake DESTDIR="${D}" "$@" install || die "emake install failed"
 	popd > /dev/null
 
+	# XXX: support installing them from builddir as well?
+	if [[ ${DOCS} ]]; then
+		dodoc "${DOCS[@]}" || die "dodoc failed"
+	fi
+	if [[ ${HTML_DOCS} ]]; then
+		dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
+	fi
+
 	# Remove libtool files and unnecessary static libs
 	remove_libtool_files
 }



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-12-05  8:38 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-12-05  8:38 UTC (permalink / raw
  To: gentoo-commits

commit:     d0a416cfdbcd3246b51b07b459793c9c41a8b41f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 30 17:50:12 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 30 22:57:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=d0a416cf

autotools-utils: drop base.eclass inherit and thus src_unpack() export.

Importing base.eclass causes us to export src_unpack() phase function
which is entirely useless in EAPIs 2+ (which we only support), and
causes trouble importing autotools-utils e.g. after VCS eclasses.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=392651

---
 eclass/autotools-utils.eclass |   54 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 0aa1679..87cbd4a 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -93,24 +93,28 @@ case ${EAPI:-0} in
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
-inherit autotools base eutils libtool
+inherit autotools eutils libtool
 
 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
 
 # @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # Build directory, location where all autotools generated files should be
 # placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
 
 # @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # Set to enable in-source build.
 
 # @ECLASS-VARIABLE: ECONF_SOURCE
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # Specify location of autotools' configure script. By default it uses ${S}.
 
 # @ECLASS-VARIABLE: myeconfargs
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # Optional econf arguments as Bash array. Should be defined before calling src_configure.
 # @CODE
@@ -125,6 +129,36 @@ EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
 # }
 # @CODE
 
+# @ECLASS-VARIABLE: DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array containing documents passed to dodoc command.
+#
+# Example:
+# @CODE
+# DOCS=( NEWS README )
+# @CODE
+
+# @ECLASS-VARIABLE: HTML_DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array containing documents passed to dohtml command.
+#
+# Example:
+# @CODE
+# HTML_DOCS=( doc/html/ )
+# @CODE
+
+# @ECLASS-VARIABLE: PATCHES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# PATCHES array variable containing all various patches to be applied.
+#
+# Example:
+# @CODE
+# PATCHES=( "${FILESDIR}"/${P}-mypatch.patch )
+# @CODE
+
 # Determine using IN or OUT source build
 _check_build_dir() {
 	: ${ECONF_SOURCE:=${S}}
@@ -224,7 +258,9 @@ remove_libtool_files() {
 autotools-utils_src_prepare() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	base_src_prepare
+	[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+	epatch_user
+
 	elibtoolize --patch-only
 }
 
@@ -260,7 +296,7 @@ autotools-utils_src_configure() {
 	_check_build_dir
 	mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
 	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
-	base_src_configure "${econfargs[@]}" "$@"
+	econf "${econfargs[@]}" "$@"
 	popd > /dev/null
 }
 
@@ -272,7 +308,7 @@ autotools-utils_src_compile() {
 
 	_check_build_dir
 	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
-	base_src_compile "$@"
+	emake "$@" || die 'emake failed'
 	popd > /dev/null
 }
 
@@ -289,9 +325,17 @@ autotools-utils_src_install() {
 
 	_check_build_dir
 	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
-	base_src_install "$@"
+	emake DESTDIR="${D}" "$@" install || die "emake install failed"
 	popd > /dev/null
 
+	# XXX: support installing them from builddir as well?
+	if [[ ${DOCS} ]]; then
+		dodoc "${DOCS[@]}" || die "dodoc failed"
+	fi
+	if [[ ${HTML_DOCS} ]]; then
+		dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
+	fi
+
 	# Remove libtool files and unnecessary static libs
 	remove_libtool_files
 }



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-12-05  8:38 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-12-05  8:38 UTC (permalink / raw
  To: gentoo-commits

commit:     7287d370d6e50b791f5a75a7f1cbfc3d69bae114
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 30 09:19:31 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 30 23:02:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=7287d370

autotools-utils: support AUTOTOOLS_AUTORECONF.

---
 eclass/autotools-utils.eclass |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 2ad6e38..9b1b81e 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -93,11 +93,20 @@ case ${EAPI:-0} in
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
-AUTOTOOLS_AUTO_DEPEND=no \
+# @ECLASS-VARIABLE: AUTOTOOLS_AUTORECONF
+# @DEFAULT-UNSET
+# @DESCRIPTION:
+# Set to enable running autoreconf in src_prepare() and adding autotools
+# dependencies.
+[[ ${AUTOTOOLS_AUTORECONF} ]] || _autotools_auto_dep=no
+
+AUTOTOOLS_AUTO_DEPEND=${_autotools_auto_dep} \
 inherit autotools eutils libtool
 
 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
 
+unset _autotools_auto_dep
+
 # @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -262,7 +271,14 @@ autotools-utils_src_prepare() {
 	[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
 	epatch_user
 
-	elibtoolize --patch-only
+	local want_autoreconf=${AUTOTOOLS_AUTORECONF}
+
+	base_src_prepare
+	if [[ ${want_autoreconf} ]]; then
+		eautoreconf
+	else
+		elibtoolize --patch-only
+	fi
 }
 
 # @FUNCTION: autotools-utils_src_configure



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-12-05  8:38 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-12-05  8:38 UTC (permalink / raw
  To: gentoo-commits

commit:     0221d344b3316200094bfd2affe253f8efa9c12c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 29 21:11:44 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 30 23:01:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=0221d344

autotools-utils: Disable unnecessarily adding autotools depends.

---
 eclass/autotools-utils.eclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 87cbd4a..2ad6e38 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -93,6 +93,7 @@ case ${EAPI:-0} in
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
+AUTOTOOLS_AUTO_DEPEND=no \
 inherit autotools eutils libtool
 
 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-12-05  8:38 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-12-05  8:38 UTC (permalink / raw
  To: gentoo-commits

commit:     9f6763ac34770f484a8bbe1ae868094876d7df6c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 30 22:02:25 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 30 23:16:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=9f6763ac

Move autoreconf into separate func.

---
 eclass/autotools-utils.eclass |   79 ++++++++++++++++++++++-------------------
 1 files changed, 42 insertions(+), 37 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 0f9cd26..035d1de 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -268,54 +268,59 @@ remove_libtool_files() {
 	fi
 }
 
-# @FUNCTION: autotools-utils_src_prepare
+# @FUNCTION: autotools-utils_autoreconf
 # @DESCRIPTION:
-# The src_prepare function.
-#
-# Supporting PATCHES array and user patches. See base.eclass(5) for reference.
-autotools-utils_src_prepare() {
+# Reconfigure the sources (like gnome-doc-autogen.sh or eautoreconf).
+autotools-utils_autoreconf() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
-	epatch_user
+	# Support running additional tools like gnome-autogen.sh.
+	# Note: you need to add additional depends to the ebuild.
 
-	local want_autoreconf=${AUTOTOOLS_AUTORECONF}
+	# aclocal is required to localize the macros
+	# XXX: do not call it twice...
+	eaclocal
 
-	base_src_prepare
-	if [[ ${want_autoreconf} ]]; then
-		# Support running additional tools like gnome-autogen.sh.
-		# Note: you need to add additional depends to the ebuild.
+	# gettext
+	if [[ $(autotools_check_macro AM_GLIB_GNU_GETTEXT) ]]; then
+		echo 'no' | autotools_run_tool glib-gettextize --copy
+	elif [[ $(autotools_check_macro AM_GNU_GETTEXT) ]]; then
+		eautopoint
+	fi
 
-		# aclocal is required to localize the macros
-		# XXX: do not call it twice...
-		eaclocal
+	# intltool
+	if [[ $(autotools_check_macro AC_PROG_INTLTOOL IT_PROG_INTLTOOL) ]]; then
+		autotools_run_tool intltoolize --copy --automake
+	fi
 
-		# gettext
-		if [[ $(autotools_check_macro AM_GLIB_GNU_GETTEXT) ]]; then
-			echo 'no' | autotools_run_tool glib-gettextize --copy
-		elif [[ $(autotools_check_macro AM_GNU_GETTEXT) ]]; then
-			eautopoint
-		fi
+	# gtk-doc
+	if [[ $(autotools_check_macro GTK_DOC_CHECK) ]]; then
+		autotools_run_tool gtkdocize --copy
+	fi
 
-		# intltool
-		if [[ $(autotools_check_macro AC_PROG_INTLTOOL IT_PROG_INTLTOOL) ]]; then
-			autotools_run_tool intltoolize --copy --automake
-		fi
+	# gnome-doc
+	if [[ $(autotools_check_macro GNOME_DOC_INIT) ]]; then
+		autotools_run_tool gnome-doc-prepare --copy
+	fi
 
-		# gtk-doc
-		if [[ $(autotools_check_macro GTK_DOC_CHECK) ]]; then
-			autotools_run_tool gtkdocize --copy
-		fi
+	eautoreconf
+}
 
-		# gnome-doc
-		if [[ $(autotools_check_macro GNOME_DOC_INIT) ]]; then
-			autotools_run_tool gnome-doc-prepare --copy
-		fi
+# @FUNCTION: autotools-utils_src_prepare
+# @DESCRIPTION:
+# The src_prepare function.
+#
+# Supporting PATCHES array and user patches. See base.eclass(5) for reference.
+autotools-utils_src_prepare() {
+	debug-print-function ${FUNCNAME} "$@"
 
-		eautoreconf
-	else
-		elibtoolize --patch-only
-	fi
+	local want_autoreconf=${AUTOTOOLS_AUTORECONF}
+
+	[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+	epatch_user
+
+	[[ ${want_autoreconf} ]] && autotools-utils_autoreconf
+	elibtoolize --patch-only
 }
 
 # @FUNCTION: autotools-utils_src_configure



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-12-05  8:38 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-12-05  8:38 UTC (permalink / raw
  To: gentoo-commits

commit:     618e2e90d7d2b738222c5bfaff548e3cadaf636e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 30 09:46:58 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 30 23:02:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=618e2e90

autotools-utils: support calling additional autoconfiguration tools.

---
 eclass/autotools-utils.eclass |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 9b1b81e..0f9cd26 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -98,6 +98,14 @@ esac
 # @DESCRIPTION:
 # Set to enable running autoreconf in src_prepare() and adding autotools
 # dependencies.
+#
+# The eclass will try to determine the correct autotools to run including a few
+# external tools: gettext, glib-gettext, intltool, gtk-doc, gnome-doc-prepare.
+# If your tool is not supported, please open a bug and we'll add support for it.
+#
+# Note that dependencies are added for autoconf, automake and libtool only.
+# If your package needs one of the external tools listed above, you need to add
+# appropriate packages to DEPEND yourself.
 [[ ${AUTOTOOLS_AUTORECONF} ]] || _autotools_auto_dep=no
 
 AUTOTOOLS_AUTO_DEPEND=${_autotools_auto_dep} \
@@ -275,6 +283,35 @@ autotools-utils_src_prepare() {
 
 	base_src_prepare
 	if [[ ${want_autoreconf} ]]; then
+		# Support running additional tools like gnome-autogen.sh.
+		# Note: you need to add additional depends to the ebuild.
+
+		# aclocal is required to localize the macros
+		# XXX: do not call it twice...
+		eaclocal
+
+		# gettext
+		if [[ $(autotools_check_macro AM_GLIB_GNU_GETTEXT) ]]; then
+			echo 'no' | autotools_run_tool glib-gettextize --copy
+		elif [[ $(autotools_check_macro AM_GNU_GETTEXT) ]]; then
+			eautopoint
+		fi
+
+		# intltool
+		if [[ $(autotools_check_macro AC_PROG_INTLTOOL IT_PROG_INTLTOOL) ]]; then
+			autotools_run_tool intltoolize --copy --automake
+		fi
+
+		# gtk-doc
+		if [[ $(autotools_check_macro GTK_DOC_CHECK) ]]; then
+			autotools_run_tool gtkdocize --copy
+		fi
+
+		# gnome-doc
+		if [[ $(autotools_check_macro GNOME_DOC_INIT) ]]; then
+			autotools_run_tool gnome-doc-prepare --copy
+		fi
+
 		eautoreconf
 	else
 		elibtoolize --patch-only



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-12-05  8:38 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-12-05  8:38 UTC (permalink / raw
  To: gentoo-commits

commit:     956819d793ccbbd943343c8b55b241e210048d92
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 30 22:20:33 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 30 23:16:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=956819d7

Reimplement autoreconf from autotools.

---
 eclass/autotools-utils.eclass |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 035d1de..71b0bfc 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -274,12 +274,17 @@ remove_libtool_files() {
 autotools-utils_autoreconf() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	# Support running additional tools like gnome-autogen.sh.
-	# Note: you need to add additional depends to the ebuild.
+	einfo "Autoreconfiguring '${PWD}' ..."
+
+	local auxdir=$(autotools_get_auxdir)
+	[[ ${auxdir} ]] && mkdir -p ${auxdir}
 
-	# aclocal is required to localize the macros
-	# XXX: do not call it twice...
+	# XXX: avoid calling this twice somehow...
 	eaclocal
+	_elibtoolize --copy --force --install
+
+	# Support running additional tools like gnome-autogen.sh.
+	# Note: you need to add additional depends to the ebuild.
 
 	# gettext
 	if [[ $(autotools_check_macro AM_GLIB_GNU_GETTEXT) ]]; then
@@ -289,7 +294,8 @@ autotools-utils_autoreconf() {
 	fi
 
 	# intltool
-	if [[ $(autotools_check_macro AC_PROG_INTLTOOL IT_PROG_INTLTOOL) ]]; then
+	if [[ $(autotools_check_macro AC_PROG_INTLTOOL IT_PROG_INTLTOOL) ]]
+	then
 		autotools_run_tool intltoolize --copy --automake
 	fi
 
@@ -303,7 +309,18 @@ autotools-utils_autoreconf() {
 		autotools_run_tool gnome-doc-prepare --copy
 	fi
 
-	eautoreconf
+	eautoconf
+	eautoheader
+	eautomake
+
+	local x
+	for x in $(autotools_get_subdirs); do
+		if [[ -d ${x} ]] ; then
+			pushd "${x}" >/dev/null
+			autotools-utils_eautoreconf
+			popd >/dev/null
+		fi
+	done
 }
 
 # @FUNCTION: autotools-utils_src_prepare



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-12-05  8:38 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-12-05  8:38 UTC (permalink / raw
  To: gentoo-commits

commit:     c90d731df39a9970030d494c3e524f31514c0f36
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  1 19:00:41 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  1 19:00:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=c90d731d

autotools-utils: rewrite some more autotools code to make it faster.

Now we don't run aclocal multiple times, and we don't need to call
autoconf to check for various macros. Of course, there is a number of
corner cases where we will fail terribly.

---
 eclass/autotools-utils.eclass |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 71b0bfc..54b7d6e 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -274,14 +274,26 @@ remove_libtool_files() {
 autotools-utils_autoreconf() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	einfo "Autoreconfiguring '${PWD}' ..."
+	# Override this func to not require unnecessary eaclocal calls.
+	autotools_check_macro() {
+		local x
+
+		# Add a few additional variants as we don't get expansions.
+		[[ ${1} = AC_CONFIG_HEADERS ]] && set -- "${@}" AC_CONFIG_HEADER
 
-	local auxdir=$(autotools_get_auxdir)
-	[[ ${auxdir} ]] && mkdir -p ${auxdir}
+		for x; do
+			grep -h "^${x}" configure.{ac,in} 2>/dev/null
+		done
+	}
+
+	einfo "Autoreconfiguring '${PWD}' ..."
 
-	# XXX: avoid calling this twice somehow...
-	eaclocal
-	_elibtoolize --copy --force --install
+	local auxdir=$(sed -n -e 's/^AC_CONFIG_AUX_DIR(\(.*\))$/\1/p' \
+			configure.{ac,in} 2>/dev/null)
+	if [[ ${auxdir} ]]; then
+		auxdir=${auxdir%%]}
+		mkdir -p ${auxdir##[}
+	fi
 
 	# Support running additional tools like gnome-autogen.sh.
 	# Note: you need to add additional depends to the ebuild.
@@ -309,6 +321,15 @@ autotools-utils_autoreconf() {
 		autotools_run_tool gnome-doc-prepare --copy
 	fi
 
+	# We need to perform the check twice to know whether to run eaclocal.
+	# (_elibtoolize does that itself)
+	if [[ $(autotools_check_macro AC_PROG_LIBTOOL AM_PROG_LIBTOOL LT_INIT) ]]
+	then
+		_elibtoolize --copy --force --install
+	else
+		eaclocal
+	fi
+
 	eautoconf
 	eautoheader
 	eautomake



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2011-12-29 20:25 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2011-12-29 20:25 UTC (permalink / raw
  To: gentoo-commits

commit:     007a7e90a92045ec45c18adce01e3f110f1aa1d7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 29 20:26:06 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 20:26:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=007a7e90

Ling.

---
 eclass/autotools-utils.eclass |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 54b7d6e..f2daa55 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -96,8 +96,8 @@ esac
 # @ECLASS-VARIABLE: AUTOTOOLS_AUTORECONF
 # @DEFAULT-UNSET
 # @DESCRIPTION:
-# Set to enable running autoreconf in src_prepare() and adding autotools
-# dependencies.
+# Set to a non-empty value in order to enable running autoreconf
+# in src_prepare() and adding autotools dependencies.
 #
 # The eclass will try to determine the correct autotools to run including a few
 # external tools: gettext, glib-gettext, intltool, gtk-doc, gnome-doc-prepare.
@@ -270,7 +270,7 @@ remove_libtool_files() {
 
 # @FUNCTION: autotools-utils_autoreconf
 # @DESCRIPTION:
-# Reconfigure the sources (like gnome-doc-autogen.sh or eautoreconf).
+# Reconfigure the sources (like gnome-autogen.sh or eautoreconf).
 autotools-utils_autoreconf() {
 	debug-print-function ${FUNCNAME} "$@"
 



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2012-01-07 22:36 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2012-01-07 22:36 UTC (permalink / raw
  To: gentoo-commits

commit:     07d1b26c5e93402b270c7746ea92955edc3f4479
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 21:57:27 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan  6 22:06:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=07d1b26c

Autoreconfigure packages when user patches need it.

If (user) patches modify either configure.{ac,in} or Makefile.am files,
autoreconfigure the package for user.

---
 eclass/autotools-utils.eclass |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 87f8b4d..1b19ed2 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -99,6 +99,11 @@ esac
 # Set to a non-empty value in order to enable running autoreconf
 # in src_prepare() and adding autotools dependencies.
 #
+# This is usually necessary when using live sources or applying patches
+# modifying configure.ac or Makefile.am files. Note that in the latter case
+# setting this variable is obligatory even though the eclass will work without
+# it (to add the necessary dependencies).
+#
 # The eclass will try to determine the correct autotools to run including a few
 # external tools: gettext, glib-gettext, intltool, gtk-doc, gnome-doc-prepare.
 # If your tool is not supported, please open a bug and we'll add support for it.
@@ -354,8 +359,19 @@ autotools-utils_src_prepare() {
 
 	local want_autoreconf=${AUTOTOOLS_AUTORECONF}
 
+	touch "${T}"/.autotools-utils.timestamp || die
 	[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
 	epatch_user
+	if [[ ! ${want_autoreconf} ]]; then
+		if [[ $(find . -newer "${T}"/.autotools-utils.timestamp \
+				-a '(' -name 'Makefile.am' \
+				-o -name 'configure.ac' \
+				-o -name 'configure.in' ')' \
+				-print -quit) ]]; then
+			einfo 'Will autoreconfigure due to patches applied.'
+			want_autoreconf=yep
+		fi
+	fi
 
 	[[ ${want_autoreconf} ]] && autotools-utils_autoreconf
 	elibtoolize --patch-only



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2012-01-07 22:36 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2012-01-07 22:36 UTC (permalink / raw
  To: gentoo-commits

commit:     c2e449b082c81567396525af8c85b2d777ce8053
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 21:58:46 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan  6 22:06:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=c2e449b0

Disallow eautomake from calling eautoreconf unnecessarily.

As we're running the complete set of commands for autoreconf, it is
completely unnecessary for eautomake to conditionally run that. Thus, we
need to set FROM_EAUTORECONF.

---
 eclass/autotools-utils.eclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 96b3372..87f8b4d 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -332,7 +332,7 @@ autotools-utils_autoreconf() {
 
 	eautoconf
 	eautoheader
-	eautomake
+	FROM_EAUTORECONF=yep eautomake
 
 	local x
 	for x in $(autotools_get_subdirs); do



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2012-01-07 22:36 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2012-01-07 22:36 UTC (permalink / raw
  To: gentoo-commits

commit:     ec5be66c90dddba6c4eb8b8e091e4c779bb7c06b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 15:13:09 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan  6 22:06:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=ec5be66c

Support installing default docs, similarly to EAPI4.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=397659

---
 eclass/autotools-utils.eclass |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index f2daa55..e5ce908 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -428,6 +428,15 @@ autotools-utils_src_install() {
 	# XXX: support installing them from builddir as well?
 	if [[ ${DOCS} ]]; then
 		dodoc "${DOCS[@]}" || die "dodoc failed"
+	else
+		local f
+		# same list as in PMS
+		for f in README* ChangeLog AUTHORS NEWS TODO CHANGES \
+				THANKS BUGS FAQ CREDITS CHANGELOG; do
+			if [[ -s ${f} ]]; then
+				dodoc "${f}" || die "(default) dodoc ${f} failed"
+			fi
+		done
 	fi
 	if [[ ${HTML_DOCS} ]]; then
 		dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2012-01-07 22:36 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2012-01-07 22:36 UTC (permalink / raw
  To: gentoo-commits

commit:     3fb6769df56bcca6046eacd410622118b742d8ae
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 15:32:13 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan  6 22:06:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=3fb6769d

Pass --docdir to configure, and install docs from it.

As EAPI 2 support is intended, this requires configuring the build
system to install docs into a temporary location and moving files from
it. Due to the lack of 'dodoc -r', directories inside docdir are
supported only with EAPI 4.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=350423

---
 eclass/autotools-utils.eclass |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index e5ce908..96b3372 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -377,7 +377,9 @@ autotools-utils_src_configure() {
 		|| die 'autotools-utils.eclass: myeconfargs has to be an array.'
 
 	# Common args
-	local econfargs=()
+	local econfargs=(
+		--docdir=/temporary-docdir
+	)
 
 	# Handle static-libs found in IUSE, disable them by default
 	if in_iuse static-libs; then
@@ -442,6 +444,23 @@ autotools-utils_src_install() {
 		dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
 	fi
 
+	# Move docs installed by autotools.
+	if [[ -d ${D}/temporary-docdir ]]; then
+		if [[ ${EAPI} = 4 ]]; then
+			dodoc -r "${D}"/temporary-docdir/* || die "docdir dodoc failed"
+		else
+			local f
+			for f in "${D}"/temporary-docdir/*; do
+				[[ -d ${f} ]] \
+					&& die "directories in docdir require at least EAPI 4"
+			done
+
+			dodoc "${D}"/temporary-docdir/* || die "docdir dodoc failed"
+		fi
+
+		rm -r "${D}"/temporary-docdir
+	fi
+
 	# Remove libtool files and unnecessary static libs
 	remove_libtool_files
 }



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2012-01-08 16:32 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2012-01-08 16:32 UTC (permalink / raw
  To: gentoo-commits

commit:     d26b8b1ed6938af622c6041fdda3a98b518448e7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  8 10:07:23 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jan  8 10:07:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=d26b8b1e

Fix passing temporary --docdir to packages.

Rather install in the actual docdir, and move forth and back whenever
necessary.

---
 eclass/autotools-utils.eclass |   39 +++++++++++++++++++++------------------
 1 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 1b19ed2..fcdf219 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -392,9 +392,11 @@ autotools-utils_src_configure() {
 	[[ -z ${myeconfargs+1} || $(declare -p myeconfargs) == 'declare -a'* ]] \
 		|| die 'autotools-utils.eclass: myeconfargs has to be an array.'
 
+	[[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX=
+
 	# Common args
 	local econfargs=(
-		--docdir=/temporary-docdir
+		--docdir="${EPREFIX}/usr/share/doc/${PF}"
 	)
 
 	# Handle static-libs found in IUSE, disable them by default
@@ -443,6 +445,24 @@ autotools-utils_src_install() {
 	emake DESTDIR="${D}" "$@" install || die "emake install failed"
 	popd > /dev/null
 
+	# Move docs installed by autotools (in EAPI < 4).
+	if [[ -d ${D}${EPREFIX}/usr/share/doc/${PF} ]]; then
+		if [[ ${EAPI} == [23] ]]; then
+			mkdir "${T}"/temp-docdir
+			mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* "${T}"/temp-docdir/ \
+				|| die "moving docs to tempdir failed"
+
+			local f
+			for f in "${T}"/temp-docdir/*; do
+				[[ -d ${f} ]] \
+					&& die "directories in docdir require at least EAPI 4"
+			done
+
+			dodoc "${T}"/temp-docdir/* || die "docdir dodoc failed"
+			rm -r "${T}"/temp-docdir || die
+		fi
+	fi
+
 	# XXX: support installing them from builddir as well?
 	if [[ ${DOCS} ]]; then
 		dodoc "${DOCS[@]}" || die "dodoc failed"
@@ -460,23 +480,6 @@ autotools-utils_src_install() {
 		dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
 	fi
 
-	# Move docs installed by autotools.
-	if [[ -d ${D}/temporary-docdir ]]; then
-		if [[ ${EAPI} = 4 ]]; then
-			dodoc -r "${D}"/temporary-docdir/* || die "docdir dodoc failed"
-		else
-			local f
-			for f in "${D}"/temporary-docdir/*; do
-				[[ -d ${f} ]] \
-					&& die "directories in docdir require at least EAPI 4"
-			done
-
-			dodoc "${D}"/temporary-docdir/* || die "docdir dodoc failed"
-		fi
-
-		rm -r "${D}"/temporary-docdir
-	fi
-
 	# Remove libtool files and unnecessary static libs
 	remove_libtool_files
 }



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2012-01-14 21:22 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2012-01-14 21:22 UTC (permalink / raw
  To: gentoo-commits

commit:     732169c5e10551699370dd4c572a917a54795cbb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 21:58:46 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jan  8 10:08:45 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=732169c5

Disallow eautomake from calling eautoreconf unnecessarily.

As we're running the complete set of commands for autoreconf, it is
completely unnecessary for eautomake to conditionally run that. Thus, we
need to set FROM_EAUTORECONF.

---
 eclass/autotools-utils.eclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index e5ce908..b2d8c3e 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -332,7 +332,7 @@ autotools-utils_autoreconf() {
 
 	eautoconf
 	eautoheader
-	eautomake
+	FROM_EAUTORECONF=yep eautomake
 
 	local x
 	for x in $(autotools_get_subdirs); do



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2012-01-14 21:22 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2012-01-14 21:22 UTC (permalink / raw
  To: gentoo-commits

commit:     d781a725a056437643ca33ab927c63fb53d6baf5
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 15:32:13 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jan  8 10:08:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=d781a725

Pass --docdir to configure, and install docs from it.

As EAPI 2 support is intended, this requires configuring the build
system to install docs into a temporary location and moving files from
it. Due to the lack of 'dodoc -r', directories inside docdir are
supported only with EAPI 4.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=350423

---
 eclass/autotools-utils.eclass |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 9a13a3a..fcdf219 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -392,8 +392,12 @@ autotools-utils_src_configure() {
 	[[ -z ${myeconfargs+1} || $(declare -p myeconfargs) == 'declare -a'* ]] \
 		|| die 'autotools-utils.eclass: myeconfargs has to be an array.'
 
+	[[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX=
+
 	# Common args
-	local econfargs=()
+	local econfargs=(
+		--docdir="${EPREFIX}/usr/share/doc/${PF}"
+	)
 
 	# Handle static-libs found in IUSE, disable them by default
 	if in_iuse static-libs; then
@@ -441,6 +445,24 @@ autotools-utils_src_install() {
 	emake DESTDIR="${D}" "$@" install || die "emake install failed"
 	popd > /dev/null
 
+	# Move docs installed by autotools (in EAPI < 4).
+	if [[ -d ${D}${EPREFIX}/usr/share/doc/${PF} ]]; then
+		if [[ ${EAPI} == [23] ]]; then
+			mkdir "${T}"/temp-docdir
+			mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* "${T}"/temp-docdir/ \
+				|| die "moving docs to tempdir failed"
+
+			local f
+			for f in "${T}"/temp-docdir/*; do
+				[[ -d ${f} ]] \
+					&& die "directories in docdir require at least EAPI 4"
+			done
+
+			dodoc "${T}"/temp-docdir/* || die "docdir dodoc failed"
+			rm -r "${T}"/temp-docdir || die
+		fi
+	fi
+
 	# XXX: support installing them from builddir as well?
 	if [[ ${DOCS} ]]; then
 		dodoc "${DOCS[@]}" || die "dodoc failed"



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2012-01-14 21:22 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2012-01-14 21:22 UTC (permalink / raw
  To: gentoo-commits

commit:     ecae2e6f2e4abcefc4f6459bf35200cb2598ba6f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 21:57:27 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jan  8 10:08:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=ecae2e6f

Autoreconfigure packages when user patches need it.

If (user) patches modify either configure.{ac,in} or Makefile.am files,
autoreconfigure the package for user.

---
 eclass/autotools-utils.eclass |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index b2d8c3e..9a13a3a 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -99,6 +99,11 @@ esac
 # Set to a non-empty value in order to enable running autoreconf
 # in src_prepare() and adding autotools dependencies.
 #
+# This is usually necessary when using live sources or applying patches
+# modifying configure.ac or Makefile.am files. Note that in the latter case
+# setting this variable is obligatory even though the eclass will work without
+# it (to add the necessary dependencies).
+#
 # The eclass will try to determine the correct autotools to run including a few
 # external tools: gettext, glib-gettext, intltool, gtk-doc, gnome-doc-prepare.
 # If your tool is not supported, please open a bug and we'll add support for it.
@@ -354,8 +359,19 @@ autotools-utils_src_prepare() {
 
 	local want_autoreconf=${AUTOTOOLS_AUTORECONF}
 
+	touch "${T}"/.autotools-utils.timestamp || die
 	[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
 	epatch_user
+	if [[ ! ${want_autoreconf} ]]; then
+		if [[ $(find . -newer "${T}"/.autotools-utils.timestamp \
+				-a '(' -name 'Makefile.am' \
+				-o -name 'configure.ac' \
+				-o -name 'configure.in' ')' \
+				-print -quit) ]]; then
+			einfo 'Will autoreconfigure due to patches applied.'
+			want_autoreconf=yep
+		fi
+	fi
 
 	[[ ${want_autoreconf} ]] && autotools-utils_autoreconf
 	elibtoolize --patch-only



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [gentoo-commits] dev/mgorny:master commit in: eclass/
@ 2012-05-21 17:32 Michał Górny
  0 siblings, 0 replies; 31+ messages in thread
From: Michał Górny @ 2012-05-21 17:32 UTC (permalink / raw
  To: gentoo-commits

commit:     54c8731ca4010da0c5ba1041e082e723c7cce5df
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon May 21 17:33:14 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon May 21 17:33:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=54c8731c

Remove copy of autotools-utils eclass.

---
 eclass/autotools-utils.eclass |  498 -----------------------------------------
 1 files changed, 0 insertions(+), 498 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
deleted file mode 100644
index fcdf219..0000000
--- a/eclass/autotools-utils.eclass
+++ /dev/null
@@ -1,498 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.29 2011/11/27 09:57:20 mgorny Exp $
-
-# @ECLASS: autotools-utils.eclass
-# @MAINTAINER:
-# Maciej Mrozowski <reavertm@gentoo.org>
-# Michał Górny <mgorny@gentoo.org>
-# @BLURB: common ebuild functions for autotools-based packages
-# @DESCRIPTION:
-# autotools-utils.eclass is autotools.eclass(5) and base.eclass(5) wrapper
-# providing all inherited features along with econf arguments as Bash array,
-# out of source build with overridable build dir location, static archives
-# handling, libtool files removal.
-#
-# Please note note that autotools-utils does not support mixing of its phase
-# functions with regular econf/emake calls. If necessary, please call
-# autotools-utils_src_compile instead of the latter.
-#
-# @EXAMPLE:
-# Typical ebuild using autotools-utils.eclass:
-#
-# @CODE
-# EAPI="2"
-#
-# inherit autotools-utils
-#
-# DESCRIPTION="Foo bar application"
-# HOMEPAGE="http://example.org/foo/"
-# SRC_URI="mirror://sourceforge/foo/${P}.tar.bz2"
-#
-# LICENSE="LGPL-2.1"
-# KEYWORDS=""
-# SLOT="0"
-# IUSE="debug doc examples qt4 static-libs tiff"
-#
-# CDEPEND="
-# 	media-libs/libpng:0
-# 	qt4? (
-# 		x11-libs/qt-core:4
-# 		x11-libs/qt-gui:4
-# 	)
-# 	tiff? ( media-libs/tiff:0 )
-# "
-# RDEPEND="${CDEPEND}
-# 	!media-gfx/bar
-# "
-# DEPEND="${CDEPEND}
-# 	doc? ( app-doc/doxygen )
-# "
-#
-# # bug 123456
-# AUTOTOOLS_IN_SOURCE_BUILD=1
-#
-# DOCS=(AUTHORS ChangeLog README "Read me.txt" TODO)
-#
-# PATCHES=(
-# 	"${FILESDIR}/${P}-gcc44.patch" # bug 123458
-# 	"${FILESDIR}/${P}-as-needed.patch"
-# 	"${FILESDIR}/${P}-unbundle_libpng.patch"
-# )
-#
-# src_configure() {
-# 	local myeconfargs=(
-# 		$(use_enable debug)
-# 		$(use_with qt4)
-# 		$(use_enable threads multithreading)
-# 		$(use_with tiff)
-# 	)
-# 	autotools-utils_src_configure
-# }
-#
-# src_compile() {
-# 	autotools-utils_src_compile
-# 	use doc && autotools-utils_src_compile docs
-# }
-#
-# src_install() {
-# 	use doc && HTML_DOCS=("${AUTOTOOLS_BUILD_DIR}/apidocs/html/")
-# 	autotools-utils_src_install
-# 	if use examples; then
-# 		dobin "${AUTOTOOLS_BUILD_DIR}"/foo_example{1,2,3} \\
-# 			|| die 'dobin examples failed'
-# 	fi
-# }
-#
-# @CODE
-
-# Keep variable names synced with cmake-utils and the other way around!
-
-case ${EAPI:-0} in
-	2|3|4) ;;
-	*) die "EAPI=${EAPI} is not supported" ;;
-esac
-
-# @ECLASS-VARIABLE: AUTOTOOLS_AUTORECONF
-# @DEFAULT-UNSET
-# @DESCRIPTION:
-# Set to a non-empty value in order to enable running autoreconf
-# in src_prepare() and adding autotools dependencies.
-#
-# This is usually necessary when using live sources or applying patches
-# modifying configure.ac or Makefile.am files. Note that in the latter case
-# setting this variable is obligatory even though the eclass will work without
-# it (to add the necessary dependencies).
-#
-# The eclass will try to determine the correct autotools to run including a few
-# external tools: gettext, glib-gettext, intltool, gtk-doc, gnome-doc-prepare.
-# If your tool is not supported, please open a bug and we'll add support for it.
-#
-# Note that dependencies are added for autoconf, automake and libtool only.
-# If your package needs one of the external tools listed above, you need to add
-# appropriate packages to DEPEND yourself.
-[[ ${AUTOTOOLS_AUTORECONF} ]] || _autotools_auto_dep=no
-
-AUTOTOOLS_AUTO_DEPEND=${_autotools_auto_dep} \
-inherit autotools eutils libtool
-
-EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
-
-unset _autotools_auto_dep
-
-# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Build directory, location where all autotools generated files should be
-# placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
-
-# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Set to enable in-source build.
-
-# @ECLASS-VARIABLE: ECONF_SOURCE
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Specify location of autotools' configure script. By default it uses ${S}.
-
-# @ECLASS-VARIABLE: myeconfargs
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Optional econf arguments as Bash array. Should be defined before calling src_configure.
-# @CODE
-# src_configure() {
-# 	local myeconfargs=(
-# 		--disable-readline
-# 		--with-confdir="/etc/nasty foo confdir/"
-# 		$(use_enable debug cnddebug)
-# 		$(use_enable threads multithreading)
-# 	)
-# 	autotools-utils_src_configure
-# }
-# @CODE
-
-# @ECLASS-VARIABLE: DOCS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Array containing documents passed to dodoc command.
-#
-# Example:
-# @CODE
-# DOCS=( NEWS README )
-# @CODE
-
-# @ECLASS-VARIABLE: HTML_DOCS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Array containing documents passed to dohtml command.
-#
-# Example:
-# @CODE
-# HTML_DOCS=( doc/html/ )
-# @CODE
-
-# @ECLASS-VARIABLE: PATCHES
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# PATCHES array variable containing all various patches to be applied.
-#
-# Example:
-# @CODE
-# PATCHES=( "${FILESDIR}"/${P}-mypatch.patch )
-# @CODE
-
-# Determine using IN or OUT source build
-_check_build_dir() {
-	: ${ECONF_SOURCE:=${S}}
-	if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
-		AUTOTOOLS_BUILD_DIR="${ECONF_SOURCE}"
-	else
-		: ${AUTOTOOLS_BUILD_DIR:=${WORKDIR}/${P}_build}
-	fi
-	echo ">>> Working in BUILD_DIR: \"$AUTOTOOLS_BUILD_DIR\""
-}
-
-# @FUNCTION: remove_libtool_files
-# @USAGE: [all]
-# @DESCRIPTION:
-# Determines unnecessary libtool files (.la) and libtool static archives (.a)
-# and removes them from installation image.
-#
-# To unconditionally remove all libtool files, pass 'all' as argument.
-# Otherwise, libtool archives required for static linking will be preserved.
-#
-# In most cases it's not necessary to manually invoke this function.
-# See autotools-utils_src_install for reference.
-remove_libtool_files() {
-	debug-print-function ${FUNCNAME} "$@"
-	local removing_all
-	[[ ${#} -le 1 ]] || die "Invalid number of args to ${FUNCNAME}()"
-	if [[ ${#} -eq 1 ]]; then
-		case "${1}" in
-			all)
-				removing_all=1
-				;;
-			*)
-				die "Invalid argument to ${FUNCNAME}(): ${1}"
-		esac
-	fi
-
-	local pc_libs=()
-	if [[ ! ${removing_all} ]]; then
-		local arg
-		for arg in $(find "${D}" -name '*.pc' -exec \
-					sed -n -e 's;^Libs:;;p' {} +); do
-			[[ ${arg} == -l* ]] && pc_libs+=(lib${arg#-l}.la)
-		done
-	fi
-
-	local f
-	find "${D}" -type f -name '*.la' -print0 | while read -r -d '' f; do
-		local shouldnotlink=$(sed -ne '/^shouldnotlink=yes$/p' "${f}")
-		local archivefile=${f/%.la/.a}
-		[[ "${f}" != "${archivefile}" ]] || die 'regex sanity check failed'
-
-		# Remove static libs we're not supposed to link against.
-		if [[ ${shouldnotlink} ]]; then
-			einfo "Removing unnecessary ${archivefile#${D%/}}"
-			rm -f "${archivefile}" || die
-			# The .la file may be used by a module loader, so avoid removing it
-			# unless explicitly requested.
-			[[ ${removing_all} ]] || continue
-		fi
-
-		# Remove .la files when:
-		# - user explicitly wants us to remove all .la files,
-		# - respective static archive doesn't exist,
-		# - they are covered by a .pc file already,
-		# - they don't provide any new information (no libs & no flags).
-		local removing
-		if [[ ${removing_all} ]]; then removing='forced'
-		elif [[ ! -f ${archivefile} ]]; then removing='no static archive'
-		elif has "$(basename "${f}")" "${pc_libs[@]}"; then
-			removing='covered by .pc'
-		elif [[ ! $(sed -n -e \
-			"s/^\(dependency_libs\|inherited_linker_flags\)='\(.*\)'$/\2/p" \
-			"${f}") ]]; then removing='no libs & flags'
-		fi
-
-		if [[ ${removing} ]]; then
-			einfo "Removing unnecessary ${f#${D%/}} (${removing})"
-			rm -f "${f}" || die
-		fi
-	done
-
-	# check for invalid eclass use
-	# this is the most commonly used function, so do it here
-	_check_build_dir
-	if [[ ! -d "${AUTOTOOLS_BUILD_DIR}" ]]; then
-		eqawarn "autotools-utils used but autotools-utils_src_configure was never called."
-		eqawarn "This is not supported and never was. Please report a bug against"
-		eqawarn "the offending ebuild. This will become a fatal error in a near future."
-	fi
-}
-
-# @FUNCTION: autotools-utils_autoreconf
-# @DESCRIPTION:
-# Reconfigure the sources (like gnome-autogen.sh or eautoreconf).
-autotools-utils_autoreconf() {
-	debug-print-function ${FUNCNAME} "$@"
-
-	# Override this func to not require unnecessary eaclocal calls.
-	autotools_check_macro() {
-		local x
-
-		# Add a few additional variants as we don't get expansions.
-		[[ ${1} = AC_CONFIG_HEADERS ]] && set -- "${@}" AC_CONFIG_HEADER
-
-		for x; do
-			grep -h "^${x}" configure.{ac,in} 2>/dev/null
-		done
-	}
-
-	einfo "Autoreconfiguring '${PWD}' ..."
-
-	local auxdir=$(sed -n -e 's/^AC_CONFIG_AUX_DIR(\(.*\))$/\1/p' \
-			configure.{ac,in} 2>/dev/null)
-	if [[ ${auxdir} ]]; then
-		auxdir=${auxdir%%]}
-		mkdir -p ${auxdir##[}
-	fi
-
-	# Support running additional tools like gnome-autogen.sh.
-	# Note: you need to add additional depends to the ebuild.
-
-	# gettext
-	if [[ $(autotools_check_macro AM_GLIB_GNU_GETTEXT) ]]; then
-		echo 'no' | autotools_run_tool glib-gettextize --copy
-	elif [[ $(autotools_check_macro AM_GNU_GETTEXT) ]]; then
-		eautopoint
-	fi
-
-	# intltool
-	if [[ $(autotools_check_macro AC_PROG_INTLTOOL IT_PROG_INTLTOOL) ]]
-	then
-		autotools_run_tool intltoolize --copy --automake
-	fi
-
-	# gtk-doc
-	if [[ $(autotools_check_macro GTK_DOC_CHECK) ]]; then
-		autotools_run_tool gtkdocize --copy
-	fi
-
-	# gnome-doc
-	if [[ $(autotools_check_macro GNOME_DOC_INIT) ]]; then
-		autotools_run_tool gnome-doc-prepare --copy
-	fi
-
-	# We need to perform the check twice to know whether to run eaclocal.
-	# (_elibtoolize does that itself)
-	if [[ $(autotools_check_macro AC_PROG_LIBTOOL AM_PROG_LIBTOOL LT_INIT) ]]
-	then
-		_elibtoolize --copy --force --install
-	else
-		eaclocal
-	fi
-
-	eautoconf
-	eautoheader
-	FROM_EAUTORECONF=yep eautomake
-
-	local x
-	for x in $(autotools_get_subdirs); do
-		if [[ -d ${x} ]] ; then
-			pushd "${x}" >/dev/null
-			autotools-utils_eautoreconf
-			popd >/dev/null
-		fi
-	done
-}
-
-# @FUNCTION: autotools-utils_src_prepare
-# @DESCRIPTION:
-# The src_prepare function.
-#
-# Supporting PATCHES array and user patches. See base.eclass(5) for reference.
-autotools-utils_src_prepare() {
-	debug-print-function ${FUNCNAME} "$@"
-
-	local want_autoreconf=${AUTOTOOLS_AUTORECONF}
-
-	touch "${T}"/.autotools-utils.timestamp || die
-	[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
-	epatch_user
-	if [[ ! ${want_autoreconf} ]]; then
-		if [[ $(find . -newer "${T}"/.autotools-utils.timestamp \
-				-a '(' -name 'Makefile.am' \
-				-o -name 'configure.ac' \
-				-o -name 'configure.in' ')' \
-				-print -quit) ]]; then
-			einfo 'Will autoreconfigure due to patches applied.'
-			want_autoreconf=yep
-		fi
-	fi
-
-	[[ ${want_autoreconf} ]] && autotools-utils_autoreconf
-	elibtoolize --patch-only
-}
-
-# @FUNCTION: autotools-utils_src_configure
-# @DESCRIPTION:
-# The src_configure function. For out of source build it creates build
-# directory and runs econf there. Configuration parameters defined
-# in myeconfargs are passed here to econf. Additionally following USE
-# flags are known:
-#
-# IUSE="static-libs" passes --enable-shared and either --disable-static/--enable-static
-# to econf respectively.
-autotools-utils_src_configure() {
-	debug-print-function ${FUNCNAME} "$@"
-
-	[[ -z ${myeconfargs+1} || $(declare -p myeconfargs) == 'declare -a'* ]] \
-		|| die 'autotools-utils.eclass: myeconfargs has to be an array.'
-
-	[[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX=
-
-	# Common args
-	local econfargs=(
-		--docdir="${EPREFIX}/usr/share/doc/${PF}"
-	)
-
-	# Handle static-libs found in IUSE, disable them by default
-	if in_iuse static-libs; then
-		econfargs+=(
-			--enable-shared
-			$(use_enable static-libs static)
-		)
-	fi
-
-	# Append user args
-	econfargs+=("${myeconfargs[@]}")
-
-	_check_build_dir
-	mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
-	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
-	econf "${econfargs[@]}" "$@"
-	popd > /dev/null
-}
-
-# @FUNCTION: autotools-utils_src_compile
-# @DESCRIPTION:
-# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR.
-autotools-utils_src_compile() {
-	debug-print-function ${FUNCNAME} "$@"
-
-	_check_build_dir
-	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
-	emake "$@" || die 'emake failed'
-	popd > /dev/null
-}
-
-# @FUNCTION: autotools-utils_src_install
-# @DESCRIPTION:
-# The autotools src_install function. Runs emake install, unconditionally
-# removes unnecessary static libs (based on shouldnotlink libtool property)
-# and removes unnecessary libtool files when static-libs USE flag is defined
-# and unset.
-#
-# DOCS and HTML_DOCS arrays are supported. See base.eclass(5) for reference.
-autotools-utils_src_install() {
-	debug-print-function ${FUNCNAME} "$@"
-
-	_check_build_dir
-	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
-	emake DESTDIR="${D}" "$@" install || die "emake install failed"
-	popd > /dev/null
-
-	# Move docs installed by autotools (in EAPI < 4).
-	if [[ -d ${D}${EPREFIX}/usr/share/doc/${PF} ]]; then
-		if [[ ${EAPI} == [23] ]]; then
-			mkdir "${T}"/temp-docdir
-			mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* "${T}"/temp-docdir/ \
-				|| die "moving docs to tempdir failed"
-
-			local f
-			for f in "${T}"/temp-docdir/*; do
-				[[ -d ${f} ]] \
-					&& die "directories in docdir require at least EAPI 4"
-			done
-
-			dodoc "${T}"/temp-docdir/* || die "docdir dodoc failed"
-			rm -r "${T}"/temp-docdir || die
-		fi
-	fi
-
-	# XXX: support installing them from builddir as well?
-	if [[ ${DOCS} ]]; then
-		dodoc "${DOCS[@]}" || die "dodoc failed"
-	else
-		local f
-		# same list as in PMS
-		for f in README* ChangeLog AUTHORS NEWS TODO CHANGES \
-				THANKS BUGS FAQ CREDITS CHANGELOG; do
-			if [[ -s ${f} ]]; then
-				dodoc "${f}" || die "(default) dodoc ${f} failed"
-			fi
-		done
-	fi
-	if [[ ${HTML_DOCS} ]]; then
-		dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
-	fi
-
-	# Remove libtool files and unnecessary static libs
-	remove_libtool_files
-}
-
-# @FUNCTION: autotools-utils_src_test
-# @DESCRIPTION:
-# The autotools src_test function. Runs emake check in build directory.
-autotools-utils_src_test() {
-	debug-print-function ${FUNCNAME} "$@"
-
-	_check_build_dir
-	pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
-	# Run default src_test as defined in ebuild.sh
-	default_src_test
-	popd > /dev/null
-}



^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2012-05-21 17:32 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-30  6:45 [gentoo-commits] dev/mgorny:master commit in: eclass/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2012-05-21 17:32 Michał Górny
2012-01-14 21:22 Michał Górny
2012-01-14 21:22 Michał Górny
2012-01-14 21:22 Michał Górny
2012-01-08 16:32 Michał Górny
2012-01-07 22:36 Michał Górny
2012-01-07 22:36 Michał Górny
2012-01-07 22:36 Michał Górny
2012-01-07 22:36 Michał Górny
2011-12-29 20:25 Michał Górny
2011-12-05  8:38 Michał Górny
2011-12-05  8:38 Michał Górny
2011-12-05  8:38 Michał Górny
2011-12-05  8:38 Michał Górny
2011-12-05  8:38 Michał Górny
2011-12-05  8:38 Michał Górny
2011-12-05  8:38 Michał Górny
2011-12-05  8:36 Michał Górny
2011-11-29 21:41 Michał Górny
2011-11-29 21:41 Michał Górny
2011-09-18  9:42 Michał Górny
2011-04-30 21:14 Michał Górny
2011-04-30  6:45 Michał Górny
2011-04-30  6:45 Michał Górny
2011-04-30  6:45 Michał Górny
2011-04-28 16:33 Michał Górny
2011-04-28 14:33 Michał Górny
2011-04-28 14:33 Michał Górny
2011-04-28 14:02 Michał Górny
2011-04-17 19:41 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox