commit:     244d4e4c13f039ed6520c354d054fb01f4cb22be
Author:     Matthew Thode <mthode <AT> mthode <DOT> org>
AuthorDate: Wed Aug 26 21:29:47 2015 +0000
Commit:     Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Wed Aug 26 21:30:09 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=244d4e4c

dev-python/PyECLib: fixing install to /usr/local

gentoo-bug: 558850

Package-Manager: portage-2.2.20.1

 ...yECLib-1.0.7.ebuild => PyECLib-1.0.7-r1.ebuild} | 12 +++-
 dev-python/PyECLib/PyECLib-1.0.7.ebuild            | 10 ++-
 dev-python/PyECLib/files/PyECLib-usr-local.patch   | 83 ++++++++++++++++++++++
 3 files changed, 102 insertions(+), 3 deletions(-)

diff --git a/dev-python/PyECLib/PyECLib-1.0.7.ebuild 
b/dev-python/PyECLib/PyECLib-1.0.7-r1.ebuild
similarity index 65%
copy from dev-python/PyECLib/PyECLib-1.0.7.ebuild
copy to dev-python/PyECLib/PyECLib-1.0.7-r1.ebuild
index 7e2428f..772f076 100644
--- a/dev-python/PyECLib/PyECLib-1.0.7.ebuild
+++ b/dev-python/PyECLib/PyECLib-1.0.7-r1.ebuild
@@ -13,10 +13,18 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
 
 LICENSE="BSD"
 SLOT="0"
-KEYWORDS="amd64 x86"
+KEYWORDS="~amd64 ~x86"
 IUSE="test"
 
 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
 RDEPEND="dev-libs/liberasurecode"
 
-PATCHES=( "${FILESDIR}/1.0.7-erasurecode_locations.patch" )
+PATCHES=(
+       "${FILESDIR}/1.0.7-erasurecode_locations.patch"
+       "${FILESDIR}/PyECLib-usr-local.patch"
+)
+
+python_install() {
+       distutils-r1_python_install
+       sed -i "s/^libdir.*$/libdir='\/usr\/lib'/g" 
"${D}"/usr/lib/libgf_complete.la || die
+}

diff --git a/dev-python/PyECLib/PyECLib-1.0.7.ebuild 
b/dev-python/PyECLib/PyECLib-1.0.7.ebuild
index 7e2428f..cf533ff 100644
--- a/dev-python/PyECLib/PyECLib-1.0.7.ebuild
+++ b/dev-python/PyECLib/PyECLib-1.0.7.ebuild
@@ -19,4 +19,12 @@ IUSE="test"
 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
 RDEPEND="dev-libs/liberasurecode"
 
-PATCHES=( "${FILESDIR}/1.0.7-erasurecode_locations.patch" )
+PATCHES=(
+       "${FILESDIR}/1.0.7-erasurecode_locations.patch"
+       "${FILESDIR}/PyECLib-usr-local.patch"
+)
+
+python_install() {
+       distutils-r1_python_install
+       sed -i "s/^libdir.*$/libdir='\/usr\/lib'/g" 
"${D}"/usr/lib/libgf_complete.la || die
+}

diff --git a/dev-python/PyECLib/files/PyECLib-usr-local.patch 
b/dev-python/PyECLib/files/PyECLib-usr-local.patch
new file mode 100644
index 0000000..d2697c4
--- /dev/null
+++ b/dev-python/PyECLib/files/PyECLib-usr-local.patch
@@ -0,0 +1,83 @@
+--- setup.py   2015-08-26 16:11:51.163684633 -0500
++++ setup.py.new       2015-08-26 16:14:24.203682415 -0500
+@@ -55,18 +55,16 @@
+ # and Tushar) cannot explain what is going on with
+ # distutils or libtool here.
+ #
+-standard_library_paths = [('%s/usr/local/lib' % _exec_prefix),
+-                          '/lib', '/usr/lib', '/usr/local/lib']
++standard_library_paths = [('%s/usr/lib' % _exec_prefix),
++                          '/lib', '/usr/lib']
+ 
+ default_library_paths = [default_python_libdir,
+-                         ('%s/usr/local/lib' % _exec_prefix),
+-                         '/lib', '/usr/lib', '/usr/local/lib',
+-                         'src/c/liberasurecode-1.0.7/src/.libs']
++                         ('%s/usr/lib' % _exec_prefix),
++                         '/lib', '/usr/lib']
+ 
+ default_include_paths = [default_python_incdir,
+-                         '/usr/local/include', '/usr/local/include/jerasure',
+-                         '/usr/include', 'src/c/pyeclib_c',
+-                         '/usr/include/liberasurecode', '/usr/local/include']
++                         '/usr/include', '/usr/include/jerasure', 
'src/c/pyeclib_c',
++                         '/usr/include', '/usr/include/liberasurecode']
+ 
+ libflags = ''
+ includeflags = ''
+@@ -131,8 +129,9 @@
+         if (os.path.isdir(locallibsrcdir)):
+             # patch default include, lib paths
+             topdir = os.getcwd()
+-            libdirs = [ (topdir + "/" + locallibsrcdir + "/.libs "),
+-                        (topdir + "/" + locallibsrcdir + "/src/.libs ")] 
++            libdirs = []
++            #libdirs = [ (topdir + "/" + locallibsrcdir + "/.libs "),
++            #            (topdir + "/" + locallibsrcdir + "/src/.libs ")] 
+             for d in libdirs:
+                 libflags = libflags + " -L" + d
+                 default_library_paths.append(d)
+@@ -148,7 +147,7 @@
+             statefile = "." + library + "_configured"
+             if (not os.path.isfile(statefile)):
+                 configure_cmd = ("CFLAGS=\"%s\" LDFLAGS=\"%s\" " % 
(includeflags, libflags))
+-                configure_cmd = ("%s ./configure --prefix=%s/usr/local" % \
++                configure_cmd = ("%s ./configure --prefix=%s/usr" % \
+                     (configure_cmd, installroot))
+                 print(configure_cmd)
+                 retval = os.system(configure_cmd)
+@@ -218,7 +217,7 @@
+                        "http://lab.jerasure.org/jerasure/jerasure.git";,
+                        "install", self.distribution)
+         installroot = _get_installroot(self.distribution)
+-        default_library_paths.insert(0, "%s/usr/local/lib" % installroot)
++        default_library_paths.insert(0, "%s/usr/lib" % installroot)
+         _install.run(self)
+ 
+         # Another Mac-ism...  If the libraries are installed
+@@ -231,13 +230,13 @@
+         print("***************************************************")
+         print("**                                                 ")
+         print("** PyECLib libraries have been installed to:       ")
+-        print("**   %susr/local/lib" % installroot)
++        print("**   %susr/lib" % installroot)
+         print("**                                                 ")
+         print("** Any user using this library must update:        ")
+         print("**   %s" % ldpath_str)
+         print("**                                                 ")
+         print("** Run 'ldconfig' or place this line:              ")
+-        print("**   export %s=%s" % (ldpath_str, "%susr/local/lib"
++        print("**   export %s=%s" % (ldpath_str, "%susr/lib"
+                                      % installroot))
+         print("**                                                 ")
+         print("** into .bashrc, .profile, or the appropriate shell")
+@@ -256,8 +255,7 @@
+                    libraries=['erasurecode'],
+                    # The extra arguments are for debugging
+                    # extra_compile_args=['-g', '-O0'],
+-                   extra_link_args=['-Wl,-rpath,%s' %
+-                                    l for l in default_library_paths],
++                   extra_link_args=[],
+                    sources=['src/c/pyeclib_c/pyeclib_c.c'])
+ 
+ setup(name='PyECLib',

Reply via email to