summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Duft <mduft@gentoo.org>2008-12-09 08:30:18 +0000
committerMarkus Duft <mduft@gentoo.org>2008-12-09 08:30:18 +0000
commit0bc1e870a3dd7b45cf6db5fbca26482e7d29c673 (patch)
treee2a714a26ce5ae0fd36b416e40f173cf1e0bd1d4 /dev-util
parentUpdate PIC patch (#250335) (diff)
downloadgentoo-2-0bc1e870a3dd7b45cf6db5fbca26482e7d29c673.tar.gz
gentoo-2-0bc1e870a3dd7b45cf6db5fbca26482e7d29c673.tar.bz2
gentoo-2-0bc1e870a3dd7b45cf6db5fbca26482e7d29c673.zip
added patch to enable faster installation rules in generated makefiles
(Portage version: 2.1.4.5)
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/confix/ChangeLog9
-rw-r--r--dev-util/confix/confix-2.1.0-r2.ebuild (renamed from dev-util/confix/confix-2.1.0-r1.ebuild)4
-rw-r--r--dev-util/confix/files/2.1.0/fast-install.patch307
3 files changed, 318 insertions, 2 deletions
diff --git a/dev-util/confix/ChangeLog b/dev-util/confix/ChangeLog
index d6f6add59244..986c45abe860 100644
--- a/dev-util/confix/ChangeLog
+++ b/dev-util/confix/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-util/confix
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/confix/ChangeLog,v 1.5 2008/10/17 09:51:27 mduft Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/confix/ChangeLog,v 1.6 2008/12/09 08:30:18 mduft Exp $
+
+*confix-2.1.0-r2 (09 Dec 2008)
+
+ 09 Dec 2008; Markus Duft <mduft@gentoo.org>
+ +files/2.1.0/fast-install.patch, -confix-2.1.0-r1.ebuild,
+ +confix-2.1.0-r2.ebuild:
+ added patch to enable faster installation rules in generated makefiles
*confix-2.1.0-r1 (17 Oct 2008)
diff --git a/dev-util/confix/confix-2.1.0-r1.ebuild b/dev-util/confix/confix-2.1.0-r2.ebuild
index d8324b7e2a77..f5e84ab8011e 100644
--- a/dev-util/confix/confix-2.1.0-r1.ebuild
+++ b/dev-util/confix/confix-2.1.0-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/confix/confix-2.1.0-r1.ebuild,v 1.1 2008/10/17 09:12:48 mduft Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/confix/confix-2.1.0-r2.ebuild,v 1.1 2008/12/09 08:30:18 mduft Exp $
inherit distutils
@@ -38,6 +38,8 @@ src_unpack() {
epatch "${FILESDIR}"/${PV}/ext-ac-archive.patch
# enable SET_FILE_PROPERTIES(file, { 'PRIVATE_CINCLUDE', 1 })
epatch "${FILESDIR}"/${PV}/private-headers.patch
+ # enable fast installation rules.
+ epatch "${FILESDIR}"/${PV}/fast-install.patch
# need to store repos in exact versioned share/confix-PV/repo
sed -i -e "s,'confix2','confix-${PV}'," \
diff --git a/dev-util/confix/files/2.1.0/fast-install.patch b/dev-util/confix/files/2.1.0/fast-install.patch
new file mode 100644
index 000000000000..aaec4d86f0d8
--- /dev/null
+++ b/dev-util/confix/files/2.1.0/fast-install.patch
@@ -0,0 +1,307 @@
+diff -ru Confix-2.1.0.orig/libconfix/core/automake/file_installer.py Confix-2.1.0/libconfix/core/automake/file_installer.py
+--- Confix-2.1.0.orig/libconfix/core/automake/file_installer.py 2008-10-21 11:17:30 +0200
++++ Confix-2.1.0/libconfix/core/automake/file_installer.py 2008-11-05 13:17:14 +0100
+@@ -22,6 +22,11 @@
+ from libconfix.core.utils.paragraph import Paragraph
+ from libconfix.core.utils import const
+
++try:
++ from hashlib import md5 as my_md5
++except ImportError:
++ from md5 import new as my_md5
++
+ import helper_automake
+ from rule import Rule
+
+@@ -55,10 +60,17 @@
+ ## FILENAME_BULK_INSTALL_PUBLIC = '.bulk-install-public'
+ ## FILENAME_BULK_INSTALL_LOCAL = '.bulk-install-local'
+
+-## TARGET_INSTALL_PUBLIC = 'confix-install-public'
++ TARGET_INSTALL_PUBLIC = 'confix-install-public'
++ TARGET_INSTALL_DATA_PUBLIC = 'confix-install-data-public'
++ TARGET_INSTALL_PREFIX_PUBLIC = 'confix-install-prefix-public'
++ TARGET_UNINSTALL_PUBLIC = 'confix-uninstall-public'
++ TARGET_UNINSTALL_DATA_PUBLIC = 'confix-uninstall-data-public'
++ TARGET_UNINSTALL_PREFIX_PUBLIC = 'confix-uninstall-prefix-public'
+ TARGET_INSTALL_LOCAL = 'confix-install-local'
+ TARGET_CLEAN_LOCAL = 'confix-clean-local'
+
++ MAX_SIMULTANOUS_INSTALL = 20
++
+ ## VAR_SRCDIR = 'srcdir'
+ ## VAR_BUILDDIR = 'builddir'
+ ## VAR_INCLUDEDIR = 'includedir'
+@@ -190,10 +202,13 @@
+ ## buildmod.makefile_am().add_lines(['if !BULK_INSTALL', ''])
+ ## pass
+
+- self.automake_install_public_headers_(makefile_am=makefile_am)
+- self.automake_install_datafiles_(makefile_am=makefile_am)
+- self.automake_install_prefixfiles_(makefile_am=makefile_am)
+- self.automake_install_private_headers_(makefile_am=makefile_am)
++ #self.automake_install_public_headers_(makefile_am=makefile_am)
++ #self.automake_install_datafiles_(makefile_am=makefile_am)
++ #self.automake_install_prefixfiles_(makefile_am=makefile_am)
++ self.fast_install_public_headers_(makefile_am=makefile_am)
++ self.fast_install_datafiles_(makefile_am=makefile_am)
++ self.fast_install_prefixfiles_(makefile_am=makefile_am)
++ self.fast_install_private_headers_(makefile_am=makefile_am)
+ ## buildmod.makefile_am().add_lines(helper_automake.format_rule(
+ ## targets=[FileInstaller.TARGET_INSTALL_PUBLIC]))
+
+@@ -264,6 +279,55 @@
+ files=filelist)
+ pass
+ pass
++
++ def fast_install_public_headers_(self, makefile_am):
++ makefile_am.add_install_data_local(FileInstaller.TARGET_INSTALL_PUBLIC)
++ # this rule should be provided by makefile_am, much like the above install-data-local
++ makefile_am.add_element(Rule(targets=['uninstall-local'], prerequisites=[FileInstaller.TARGET_UNINSTALL_PUBLIC], commands=[]))
++
++ install_public_rule = Rule(targets=[FileInstaller.TARGET_INSTALL_PUBLIC], prerequisites=[], commands=[])
++ uninstall_public_rule = Rule(targets=[FileInstaller.TARGET_UNINSTALL_PUBLIC], prerequisites=[], commands=[])
++
++ makefile_am.add_element(install_public_rule)
++ makefile_am.add_element(uninstall_public_rule)
++
++ dir2file_dict = self.dir2filedict_(self.public_headers_)
++
++ for (installpath, files) in dir2file_dict.iteritems():
++ if len(installpath):
++ targetdir = '/'.join(['$(includedir)', installpath])
++
++ # define symbol for backwards compatability in handwritten rules.
++ symbolicname = self.compute_install_dirname_('publicheader_'+installpath)
++ makefile_am.define_install_directory(symbolicname=symbolicname,
++ dirname='$(includedir)/'+installpath)
++ else:
++ targetdir = '$(includedir)'
++ pass
++
++ # add mkdir rules for every subdirectory
++ makefile_am.add_element(
++ Rule(targets=[targetdir],
++ prerequisites=[],
++ commands=['-$(mkinstalldirs) '+targetdir]))
++
++ _i=0
++ _f=[]
++ for f in files:
++ _f.append(f)
++ _i+=1
++ if len(_f) >= FileInstaller.MAX_SIMULTANOUS_INSTALL or _i >= len(files):
++ # is this rule name unique enough?
++ rulename='.installstamp.public_' + my_md5(str(hash(self)) + targetdir + str(_i)).hexdigest()
++ self.fast_general_install(makefile_am, rulename, targetdir, _f, '0644')
++ install_public_rule.add_prerequisite(rulename)
++ uninstall_public_rule.add_prerequisite(rulename + '_clean')
++ _f=[]
++ pass
++ pass
++ pass
++ pass
++
+
+ def automake_install_datafiles_(self, makefile_am):
+ for dirname, filelist in self.dir2filedict_(file2dirdict=self.datafiles_).iteritems():
+@@ -278,6 +342,50 @@
+ pass
+ pass
+
++ def fast_install_datafiles_(self, makefile_am):
++ makefile_am.add_install_data_local(FileInstaller.TARGET_INSTALL_DATA_PUBLIC)
++ # this rule should be provided by makefile_am, much like the above install-data-local
++ makefile_am.add_element(Rule(targets=['uninstall-local'], prerequisites=[FileInstaller.TARGET_UNINSTALL_DATA_PUBLIC], commands=[]))
++
++ install_public_data_rule = Rule(targets=[FileInstaller.TARGET_INSTALL_DATA_PUBLIC], prerequisites=[], commands=[])
++ uninstall_public_data_rule = Rule(targets=[FileInstaller.TARGET_UNINSTALL_DATA_PUBLIC], prerequisites=[], commands=[])
++
++ makefile_am.add_element(install_public_data_rule)
++ makefile_am.add_element(uninstall_public_data_rule)
++
++ dir2file_dict = self.dir2filedict_(self.datafiles_)
++
++ for (installpath, files) in dir2file_dict.iteritems():
++ targetdir = '/'.join(['$(datadir)', installpath])
++
++ # define symbol for backwards compatability in handwritten rules.
++ symbolicname = self.compute_install_dirname_('data_'+installpath)
++ makefile_am.define_install_directory(symbolicname=symbolicname,
++ dirname='$(datadir)/'+installpath)
++
++ # add mkdir rules for every subdirectory
++ makefile_am.add_element(
++ Rule(targets=[targetdir],
++ prerequisites=[],
++ commands=['-$(mkinstalldirs) '+targetdir]))
++
++ _i=0
++ _f=[]
++ for f in files:
++ _f.append(f)
++ _i+=1
++ if len(_f) >= FileInstaller.MAX_SIMULTANOUS_INSTALL or _i >= len(files):
++ # is this rule name unique enough?
++ rulename='.installstamp.public_data_' + my_md5(str(hash(self)) + targetdir + str(_i)).hexdigest()
++ self.fast_general_install(makefile_am, rulename, targetdir, _f, '0644')
++ install_public_data_rule.add_prerequisite(rulename)
++ uninstall_public_data_rule.add_prerequisite(rulename + '_clean')
++ _f=[]
++ pass
++ pass
++ pass
++ pass
++
+ def automake_install_prefixfiles_(self, makefile_am):
+ for dirname, filelist in self.dir2filedict_(file2dirdict=self.prefixfiles_).iteritems():
+ # define directory
+@@ -291,17 +399,92 @@
+ pass
+ pass
+
+- def automake_install_private_headers_(self, makefile_am):
++ def fast_install_prefixfiles_(self, makefile_am):
++ makefile_am.add_install_data_local(FileInstaller.TARGET_INSTALL_PREFIX_PUBLIC)
++ # this rule should be provided by makefile_am, much like the above install-data-local
++ makefile_am.add_element(Rule(targets=['uninstall-local'], prerequisites=[FileInstaller.TARGET_UNINSTALL_PREFIX_PUBLIC], commands=[]))
++
++ install_public_prefix_rule = Rule(targets=[FileInstaller.TARGET_INSTALL_PREFIX_PUBLIC], prerequisites=[], commands=[])
++ uninstall_public_prefix_rule = Rule(targets=[FileInstaller.TARGET_UNINSTALL_PREFIX_PUBLIC], prerequisites=[], commands=[])
++
++ makefile_am.add_element(install_public_prefix_rule)
++ makefile_am.add_element(uninstall_public_prefix_rule)
++
++ dir2file_dict = self.dir2filedict_(self.prefixfiles_)
++
++ for (installpath, files) in dir2file_dict.iteritems():
++ targetdir = '/'.join(['$(prefix)', installpath])
++
++ # define symbol for backwards compatability in handwritten rules.
++ symbolicname = self.compute_install_dirname_('prefix_'+installpath)
++ makefile_am.define_install_directory(symbolicname=symbolicname,
++ dirname='$(prefix)/'+installpath)
++
++ # add mkdir rules for every subdirectory
++ makefile_am.add_element(
++ Rule(targets=[targetdir],
++ prerequisites=[],
++ commands=['-$(mkinstalldirs) '+targetdir]))
++
++ _i=0
++ _f=[]
++ for f in files:
++ _f.append(f)
++ _i+=1
++ if len(_f) >= FileInstaller.MAX_SIMULTANOUS_INSTALL or _i >= len(files):
++ # is this rule name unique enough?
++ rulename='.installstamp.public_prefix_' + my_md5(str(hash(self)) + targetdir + str(_i)).hexdigest()
++ self.fast_general_install(makefile_am, rulename, targetdir, _f, '0644')
++ install_public_prefix_rule.add_prerequisite(rulename)
++ uninstall_public_prefix_rule.add_prerequisite(rulename + '_clean')
++ _f=[]
++ pass
++ pass
++ pass
++ pass
++
++
++
++ def fast_general_install(self, makefile_am, rulename, targetdir, files, mode):
++ # WARNING: be _very_ carefull about what you change
++ # below, since this is a double-loop, one for'ing over
++ # all paths, and one shift'ing over all basenames. If
++ # for some reason those run apart, files may be copied
++ # to wrong destination names!
++ makefile_am.add_element(
++ Rule(targets=[rulename],
++ prerequisites=[' '.join(files)],
++ commands=['-@$(mkinstalldirs) ' + targetdir,
++ '@test -z "$?" && exit 0; \\',
++ 'set dummy $(?F); \\',
++ 'for f in $?; do \\',
++ ' shift; \\',
++ ' bf=$${1}; \\',
++ ' echo "fast install $${f} -> ' + targetdir + '/$${bf}"; \\',
++ ' __f="$${__f} $${f}"; \\',
++ ' __tf="$${__tf} ' + targetdir + '/$${bf}"; \\',
++ 'done; \\',
++ 'test -z "$${__f}" && exit 0; \\',
++ 'cp -fp $${__f} ' + targetdir + ' || exit 1; \\',
++ 'chmod ' + mode + ' $${__tf} || exit 1; \\',
++ 'touch ' + rulename + ';']))
++ makefile_am.add_element(
++ Rule(targets=[rulename + '_clean'],
++ prerequisites=[],
++ commands=['rm -f ' + rulename + ' ' + str(' ' + targetdir + '/').join([''] + files) + ';']))
++ pass
++
++ def fast_install_private_headers_(self, makefile_am):
+
+ # now for the private header files. this is a bit more
+ # complicated as we have to do it by hand, using the all-local
+ # hook.
+
+- makefile_am.add_all_local('confix-install-local')
+- makefile_am.add_clean_local('confix-clean-local')
++ makefile_am.add_all_local(FileInstaller.TARGET_INSTALL_LOCAL)
++ makefile_am.add_clean_local(FileInstaller.TARGET_CLEAN_LOCAL)
+
+- install_local_rule = Rule(targets=['confix-install-local'], prerequisites=[], commands=[])
+- clean_local_rule = Rule(targets=['confix-clean-local'], prerequisites=[], commands=[])
++ install_local_rule = Rule(targets=[FileInstaller.TARGET_INSTALL_LOCAL], prerequisites=[], commands=[])
++ clean_local_rule = Rule(targets=[FileInstaller.TARGET_CLEAN_LOCAL], prerequisites=[], commands=[])
+ makefile_am.add_element(install_local_rule)
+ makefile_am.add_element(clean_local_rule)
+
+@@ -321,20 +504,36 @@
+ commands=['-$(mkinstalldirs) '+targetdir]))
+
+ # copy files
++# for f in files:
++# targetfile = '/'.join([targetdir, f])
++# makefile_am.add_element(
++# Rule(targets=[targetfile],
++# prerequisites=[f],
++# commands=['-@$(mkinstalldirs) '+targetdir,
++# 'cp -fp $? '+' '+targetdir,
++# 'chmod 0444 '+targetfile]))
++# makefile_am.add_element(
++# Rule(targets=[targetfile+'-clean'],
++# prerequisites=[],
++# commands=['rm -f '+targetfile]))
++# install_local_rule.add_prerequisite(targetfile)
++# clean_local_rule.add_prerequisite(targetfile+'-clean')
++# pass
++# pass
++
++ _i=0
++ _f=[]
+ for f in files:
+- targetfile = '/'.join([targetdir, f])
+- makefile_am.add_element(
+- Rule(targets=[targetfile],
+- prerequisites=[f],
+- commands=['-@$(mkinstalldirs) '+targetdir,
+- 'cp -fp $? '+' '+targetdir,
+- 'chmod 0444 '+targetfile]))
+- makefile_am.add_element(
+- Rule(targets=[targetfile+'-clean'],
+- prerequisites=[],
+- commands=['rm -f '+targetfile]))
+- install_local_rule.add_prerequisite(targetfile)
+- clean_local_rule.add_prerequisite(targetfile+'-clean')
++ _f.append(f)
++ _i+=1
++ if len(_f) >= FileInstaller.MAX_SIMULTANOUS_INSTALL or _i >= len(files):
++ # is this rule name unique enough?
++ rulename='.installstamp.private_' + my_md5(str(hash(self)) + targetdir + str(_i)).hexdigest()
++ self.fast_general_install(makefile_am, rulename, targetdir, _f, '0444')
++ install_local_rule.add_prerequisite(rulename)
++ clean_local_rule.add_prerequisite(rulename + '_clean')
++ _f=[]
++ pass
+ pass
+ pass
+ pass