Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 513014 - >=dev-python/pypy-2.2.1 missing a flag to build shared library
Summary: >=dev-python/pypy-2.2.1 missing a flag to build shared library
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-11 22:47 UTC by Yuriy Taraday
Modified: 2014-06-19 06:51 UTC (History)
2 users (show)

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


Attachments
patch that worked for me (use-shared.patch,1.54 KB, patch)
2014-06-12 15:30 UTC, Yuriy Taraday
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuriy Taraday 2014-06-11 22:47:02 UTC
Since 2.2.1 PyPy supports building libpypy-c.so shared library + small executable instead of one huge executable.

Shared library is useful for embedding PyPy into other applications, e.g. uWSGI server.

I think a "shared" USE flag should be added that would result in adding "--shared" option to the translator (rpython).

Reproducible: Always
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-06-12 06:28:14 UTC
Does anything actually use this shared library?
Comment 2 Yuriy Taraday 2014-06-12 15:24:01 UTC
It has been developed by someone from uWSGI as I understand. So I wanted to build uWSGI with PyPy but found out that there's no shared lib.

Shared library support has appeared very recently but I think it won't hurt to have the USE flag around (and allow people like me to use it).

I'll attach a patch for 2.3 that worked for me.
Comment 3 Yuriy Taraday 2014-06-12 15:30:18 UTC
Created attachment 378752 [details, diff]
patch that worked for me

This patch worked for me. I bumped version to 2.3.1 because why not (although the source didn't appear at the expected URL).

I'm not sure if LD_LIBRARY_PATH setting is good but I didn't come up with a better idea.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-06-12 18:24:04 UTC
There's no need for an extra flag -- having the library built won't hurt. It would be better if it had proper SONAME though.
Comment 5 Ian Delaney (RETIRED) gentoo-dev 2014-06-18 23:39:26 UTC
(In reply to Michał Górny from comment #4)
> There's no need for an extra flag -- having the library built won't hurt. It
> would be better if it had proper SONAME though.

So tell upstream.

*pypy-2.3.1 (18 Jun 2014)

  18 Jun 2014; Ian Delaney <idella4@gentoo.org> +pypy-2.3.1.ebuild:
  bump; add shared lib libpypy-c, prompt and initial patch by Y. Taraday in bug
  #513014, closes said bug
Comment 6 Yuriy Taraday 2014-06-19 05:16:09 UTC
Thanks, Ian!
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-06-19 06:51:36 UTC
Comment on attachment 378752 [details, diff]
patch that worked for me

The following notes apply to the committed ebuild.

>--- pypy-2.3.ebuild	2014-06-12 19:26:02.198455654 +0400
>+++ pypy-2.3.1.ebuild	2014-06-12 11:22:28.029104687 +0400
>@@ -15,7 +15,7 @@
> 	einfo "Installing PyPy ..."
> 	insinto "/usr/$(get_libdir)/pypy"
>-	doins -r include lib_pypy lib-python pypy-c
>-	fperms a+x ${INSDESTTREE}/pypy-c
>-	pax-mark m "${ED%/}${INSDESTTREE}/pypy-c"
>+	doins -r include lib_pypy lib-python pypy-c $(usex shared 'libpypy-c.so' '')
>+	fperms a+x ${INSDESTTREE}/pypy-c ${INSDESTTREE}/libpypy-c.so
>+	local INSTSHARED=$(usex shared "${ED%/}${INSDESTTREE}/libpypy-c.so" "")
>+	pax-mark m "${ED%/}${INSDESTTREE}/pypy-c" "${INSTSHARED}"
> 	dosym ../$(get_libdir)/pypy/pypy-c /usr/bin/pypy
>+	dosym pypy/libpypy-c.so /usr/$(get_libdir)/libpypy-c.so

How about dolib'ing libpypy-c.so directly into libdir? Would that break PyPy prefix magic?

> 	dodoc README.rst
> 
> 	if ! use sqlite; then
>@@ -151,6 +154,9 @@
> 
> 	python_export pypy EPYTHON PYTHON PYTHON_SITEDIR
> 	local PYTHON=${ED%/}${INSDESTTREE}/pypy-c
>+	if use shared; then
>+		export LD_LIBRARY_PATH="${ED%/}${INSDESTTREE}"

local -x LD_LIBRARY_PATH=...