Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 484404 - dev-python/PyQt4: re-implements python wrapping manually
Summary: dev-python/PyQt4: re-implements python wrapping manually
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal QA (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 484398
  Show dependency tree
 
Reported: 2013-09-09 21:14 UTC by Michał Górny
Modified: 2014-03-27 18:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
PyQt4.diff for solution 1 (PyQt4.diff,1.55 KB, patch)
2014-03-13 08:23 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-09-09 21:14:25 UTC
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.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-09-17 19:02:07 UTC
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.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-03-13 08:19:20 UTC
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.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-03-13 08:23:51 UTC
Created attachment 372544 [details, diff]
PyQt4.diff for solution 1
Comment 4 Davide Pesavento (RETIRED) gentoo-dev 2014-03-13 09:47:46 UTC
(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?
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-03-13 14:53:09 UTC
(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.
Comment 6 Davide Pesavento (RETIRED) gentoo-dev 2014-03-13 18:17:33 UTC
(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...
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-03-13 19:10:35 UTC
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.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-03-13 20:30:53 UTC
btw I've confirmed that my patch works :). If you're ok with this, I can commit it.
Comment 9 Davide Pesavento (RETIRED) gentoo-dev 2014-03-14 01:14:38 UTC
(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 10 Davide Pesavento (RETIRED) gentoo-dev 2014-03-14 01:22:12 UTC
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
Comment 11 Davide Pesavento (RETIRED) gentoo-dev 2014-03-14 01:23:10 UTC
(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.
Comment 12 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-03-14 06:25:34 UTC
(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.
Comment 13 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-03-27 18:05:35 UTC
+*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.