src_install() { installation() { # INSTALL_ROOT is used by designer/Makefile, other Makefiles use DESTDIR. emake DESTDIR="${D}" INSTALL_ROOT="${D}" install mv "${ED}"/usr/bin/pyuic4{,-${EPYTHON}} || die python_optimize } python_foreach_impl run_in_build_dir installation dosym python-exec /usr/bin/pyuic4 #... } I guess there's nothing specific we can do here, just please keep it open in case we change the wrapper logic and need to sync the package.
FYI: I've added DEPEND="dev-python/python-exec:0" and that should be enough for this package now. But we'll revisit this when the time comes to migrate it to python-exec:2, so please keep it open.
I see two possibilities here: 1) install to intermediate root, use python_doexe on pyuic4 there (and then remove it, and use multibuild_merge_root). This way, pyuic4 won't be replaced and you can cleanly support wrapping. 2) hack the build system to install 'pyuic4' under a different name, and use python_newexe (+ rm). Which is better for you? For the former, I'll attach an untested patch in a few minutes.
Created attachment 372544 [details, diff] PyQt4.diff for solution 1
(In reply to Michał Górny from comment #2) Honestly I don't like either of them, but (1) is definitely more maintainable from our POV. But what's wrong with calling just python_doexe "${ED}"/usr/bin/pyuic4, without all the intermediate image stuff?
(In reply to Davide Pesavento from comment #4) > (In reply to Michał Górny from comment #2) > > Honestly I don't like either of them, but (1) is definitely more > maintainable from our POV. > > But what's wrong with calling just python_doexe "${ED}"/usr/bin/pyuic4, > without all the intermediate image stuff? It will collide with itself since that function creates wrapper symlink in /usr/bin.
(In reply to Michał Górny from comment #5) > > But what's wrong with calling just python_doexe "${ED}"/usr/bin/pyuic4, > > without all the intermediate image stuff? > > It will collide with itself since that function creates wrapper symlink in > /usr/bin. As long as the original binary is copied first, and then ln is called with -f, I don't see the problem...
cp -f pyuic4 /tmp/portage/dev-python/PyQt4-4.10.3-r3/image//usr/bin/pyuic4 cp: bez zapisu przez dowiązanie symboliczne „/tmp/portage/dev-python/PyQt4-4.10.3-r3/image//usr/bin/pyuic4”, które nie wskazuje na istniejący plik (sorry for non-english locale) Long story short, after first implementation is installed, /usr/bin/pyuic4 is a symlink. The second 'make install' tries to copy next pyuic4 over it (without unlinking first) which results in cp-onto-dangling-symlink error.
btw I've confirmed that my patch works :). If you're ok with this, I can commit it.
(In reply to Michał Górny from comment #7) > Long story short, after first implementation is installed, /usr/bin/pyuic4 > is a symlink. The second 'make install' tries to copy next pyuic4 over it > (without unlinking first) which results in cp-onto-dangling-symlink error. Ah right.
Comment on attachment 372544 [details, diff] PyQt4.diff for solution 1 >@@ -185,15 +184,18 @@ > > src_install() { > installation() { >+ local tmp_root=${D}/tmp ${D%/} > # INSTALL_ROOT is used by designer/Makefile, other Makefiles use DESTDIR. >- emake DESTDIR="${D}" INSTALL_ROOT="${D}" install >- mkdir -p "${ED}"/usr/lib/python-exec/${EPYTHON} || die >- mv "${ED}"/usr/bin/pyuic4 "${ED}"/usr/lib/python-exec/${EPYTHON}/ || die >+ emake DESTDIR="${tmp_root}" INSTALL_ROOT="${tmp_root}" install >+ >+ python_doexe "${tmp_root}"/usr/bin/pyuic4 Shouldn't the path be "${tmp_root}${EPREFIX}"/usr/bin/pyuic4 ? Same below. >+ rm "${tmp_root}"/usr/bin/pyuic4 || die rm -f >+ >+ multibuild_merge_root "${tmp_root}" "${D}" > python_optimize > } > python_foreach_impl run_in_build_dir installation > >- dosym ../lib/python-exec/python-exec2 /usr/bin/pyuic4 > dodoc NEWS THANKS > > if use doc; then
(In reply to Michał Górny from comment #8) > btw I've confirmed that my patch works :). If you're ok with this, I can > commit it. Yes please go ahead once you've addressed the above comments. Thanks.
(In reply to Davide Pesavento from comment #10) > Comment on attachment 372544 [details, diff] [details, diff] > PyQt4.diff for solution 1 > > >@@ -185,15 +184,18 @@ > > > > src_install() { > > installation() { > >+ local tmp_root=${D}/tmp > > ${D%/} > > > # INSTALL_ROOT is used by designer/Makefile, other Makefiles use DESTDIR. > >- emake DESTDIR="${D}" INSTALL_ROOT="${D}" install > >- mkdir -p "${ED}"/usr/lib/python-exec/${EPYTHON} || die > >- mv "${ED}"/usr/bin/pyuic4 "${ED}"/usr/lib/python-exec/${EPYTHON}/ || die > >+ emake DESTDIR="${tmp_root}" INSTALL_ROOT="${tmp_root}" install > >+ > >+ python_doexe "${tmp_root}"/usr/bin/pyuic4 > > Shouldn't the path be "${tmp_root}${EPREFIX}"/usr/bin/pyuic4 ? > Same below. Probably. I have no idea :). > > >+ rm "${tmp_root}"/usr/bin/pyuic4 || die > > rm -f Why? The file must be there. If it isn't, something's seriously screwed up and '-f' will avoid proper error.
+*PyQt4-4.10.3-r3 (27 Mar 2014) + + 27 Mar 2014; Michał Górny <mgorny@gentoo.org> +PyQt4-4.10.3-r3.ebuild: + Replace manual Python wrapping with proper eclass functions, bug #484404.