pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/50877: misc/calibre needs -rpath options [with patch]



>Number:         50877
>Category:       pkg
>Synopsis:       misc/calibre needs -rpath options [with patch]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 01 22:10:00 +0000 2016
>Originator:     Rhialto
>Release:        NetBSD 7.0
>Organization:
	
>Environment:
	
	
System: NetBSD murthe.falu.nl 7.0 NetBSD 7.0 (GENERIC.201509250726Z) amd64
Architecture: x86_64
Machine: amd64
>Description:
	
	When building the package for misc/calibre, it is discovered
	that some -rpath options are needed:

=> Checking for missing run-time search paths in calibre-2.45.0
ERROR: lib/calibre/calibre/plugins/libheadless.so: missing library: libGL.so.2
ERROR: lib/calibre/calibre/plugins/libheadless.so: missing library: libfreetype.so.17
ERROR: lib/calibre/calibre/plugins/pictureflow.so: missing library: libGL.so.2
ERROR: lib/calibre/calibre/plugins/pictureflow.so: missing library: libfreetype.so.17
ERROR: lib/calibre/calibre/plugins/progress_indicator.so: missing library: libGL.so.2
ERROR: lib/calibre/calibre/plugins/progress_indicator.so: missing library: libfreetype.so.17
ERROR: lib/calibre/calibre/plugins/qt_hack.so: missing library: libGL.so.2
ERROR: lib/calibre/calibre/plugins/qt_hack.so: missing library: libfreetype.so.17
*** Error code 1
>How-To-Repeat:
	cd /usr/pkgsrc/misc/calibre
	make package

	This probably only happens if you use native X.
>Fix:
	
	I've included a diff for the Makefile and a diff for a patch.
	Since that tends to get unreadable, I've also included the new
	version of the patch as a whole.

	Alternatively, instead of adding several ldflags lines for 3
	plugins

+                ldflags=['-Wl,-rpath,@X11LIB@'],

	and passing that on to LIBS,

@@ -612,9 +616,11 @@ class Build(Command):
         macx {{
             QMAKE_LFLAGS += "-undefined dynamic_lookup"
         }}
+        LIBS += {ldflags}
         ''').format(
             target=sip['target'], headers=' '.join(sip['headers'] +
xt.headers), sources=' '.join(ext.sources + sip['sources']),
             sipinc=pyqt['sip_inc_dir'],
yinc=sysconfig.get_python_inc(), py_lib=py_lib,
+            ldflags=' '.join(ext.ldflags),

	it could also just be done with one

@@ -612,9 +616,11 @@ class Build(Command):
         macx {{
             QMAKE_LFLAGS += "-undefined dynamic_lookup"
         }}
+        LIBS += -Wl,-rpath,@X11LIB@

	since the affected plugins are exactly the pyqt_extensions.
	But I thought that would be less general.

	The result builds, packages, and even seems to run (I gave it a
	quick try) (which is an improvement over the last time I spent
	some time on calibre-2.*).

	I tried appending to other make variables than LIBS, but that
	didn't take effect.
	
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/misc/calibre/Makefile,v
retrieving revision 1.124
diff -u -r1.124 Makefile
--- Makefile	5 Dec 2015 21:25:50 -0000	1.124
+++ Makefile	1 Mar 2016 21:05:52 -0000
@@ -71,6 +71,12 @@
 SUBST_STAGE.path=	post-patch
 SUBST_FILES.path=	${FIX_PYTHON_PATHS}
 
+SUBST_CLASSES+=		x11lib
+SUBST_STAGE.x11lib=     post-patch
+SUBST_SED.x11lib+=      -e 's,@X11LIB@,${X11BASE}/lib,'
+SUBST_MESSAGE.x11lib=   Fixing rpath for X11 libraries.
+SUBST_FILES.x11lib+=    setup/extensions.py
+
 REPLACE_BASH+=		resources/calibre-portable.sh
 
 # These ones are for replacing python[0-9*] with PYTHONBIN
Index: patches/patch-setup_extensions.py
===================================================================
RCS file: /cvsroot/pkgsrc/misc/calibre/patches/patch-setup_extensions.py,v
retrieving revision 1.5
diff -u -r1.5 patch-setup_extensions.py
--- patches/patch-setup_extensions.py	8 Feb 2015 00:37:10 -0000	1.5
+++ patches/patch-setup_extensions.py	1 Mar 2016 21:05:52 -0000
@@ -1,10 +1,55 @@
 $NetBSD: patch-setup_extensions.py,v 1.5 2015/02/08 00:37:10 wiz Exp $
 
 Fix build for pictureflow.
+Add -Wl,-rpath,@X11LIB@ where needed.
 
---- setup/extensions.py.orig	2014-08-29 03:59:29.000000000 +0000
+--- setup/extensions.py.orig	2015-11-27 03:22:13.000000000 +0000
 +++ setup/extensions.py
-@@ -602,7 +602,7 @@ class Build(Command):
+@@ -231,6 +231,7 @@ extensions = [
+                 ['calibre/gui2/pictureflow/pictureflow.cpp'],
+                 inc_dirs=['calibre/gui2/pictureflow'],
+                 headers=['calibre/gui2/pictureflow/pictureflow.h'],
++                ldflags=['-Wl,-rpath,@X11LIB@'],
+                 sip_files=['calibre/gui2/pictureflow/pictureflow.sip']
+                 ),
+ 
+@@ -238,6 +239,7 @@ extensions = [
+                 ['calibre/gui2/progress_indicator/QProgressIndicator.cpp'],
+                 inc_dirs=['calibre/gui2/progress_indicator'],
+                 headers=['calibre/gui2/progress_indicator/QProgressIndicator.h'],
++                ldflags=['-Wl,-rpath,@X11LIB@'],
+                 sip_files=['calibre/gui2/progress_indicator/QProgressIndicator.sip']
+                 ),
+ 
+@@ -245,6 +247,7 @@ extensions = [
+                 ['calibre/ebooks/pdf/render/qt_hack.cpp'],
+                 inc_dirs=['calibre/ebooks/pdf/render'],
+                 headers=['calibre/ebooks/pdf/render/qt_hack.h'],
++                ldflags=['-Wl,-rpath,@X11LIB@'],
+                 qt_private=['core', 'gui'],
+                 sip_files=['calibre/ebooks/pdf/render/qt_hack.sip']
+                 ),
+@@ -552,6 +555,7 @@ class Build(Command):
+             DESTDIR = {destdir}
+             CONFIG -= create_cmake  # Prevent qmake from generating a cmake build file which it puts in the calibre src directory
+             QMAKE_LIBS_PRIVATE += {glib} {fontconfig}
++            LIBS += -Wl,-rpath,@X11LIB@
+             ''').format(
+                 headers=' '.join(headers), sources=' '.join(sources), others=' '.join(others), destdir=self.d(
+                     target), glib=glib_flags, fontconfig=fontconfig_flags, freetype=' '.join(ft_inc_dirs))
+@@ -612,9 +616,11 @@ class Build(Command):
+         macx {{
+             QMAKE_LFLAGS += "-undefined dynamic_lookup"
+         }}
++        LIBS += {ldflags}
+         ''').format(
+             target=sip['target'], headers=' '.join(sip['headers'] + ext.headers), sources=' '.join(ext.sources + sip['sources']),
+             sipinc=pyqt['sip_inc_dir'], pyinc=sysconfig.get_python_inc(), py_lib=py_lib,
++            ldflags=' '.join(ext.ldflags),
+             ver=__version__
+         )
+         for incdir in ext.inc_dirs:
+@@ -635,7 +641,7 @@ class Build(Command):
          if iswindows:
              qmc += ['-spec', 'win32-msvc2008']
          fext = 'dll' if iswindows else 'dylib' if isosx else 'so'


Full version of patches/patch-setup_extensions.py:

$NetBSD: patch-setup_extensions.py,v 1.5 2015/02/08 00:37:10 wiz Exp $

Fix build for pictureflow.
Add -Wl,-rpath,@X11LIB@ where needed.

--- setup/extensions.py.orig	2015-11-27 03:22:13.000000000 +0000
+++ setup/extensions.py
@@ -231,6 +231,7 @@ extensions = [
                 ['calibre/gui2/pictureflow/pictureflow.cpp'],
                 inc_dirs=['calibre/gui2/pictureflow'],
                 headers=['calibre/gui2/pictureflow/pictureflow.h'],
+                ldflags=['-Wl,-rpath,@X11LIB@'],
                 sip_files=['calibre/gui2/pictureflow/pictureflow.sip']
                 ),
 
@@ -238,6 +239,7 @@ extensions = [
                 ['calibre/gui2/progress_indicator/QProgressIndicator.cpp'],
                 inc_dirs=['calibre/gui2/progress_indicator'],
                 headers=['calibre/gui2/progress_indicator/QProgressIndicator.h'],
+                ldflags=['-Wl,-rpath,@X11LIB@'],
                 sip_files=['calibre/gui2/progress_indicator/QProgressIndicator.sip']
                 ),
 
@@ -245,6 +247,7 @@ extensions = [
                 ['calibre/ebooks/pdf/render/qt_hack.cpp'],
                 inc_dirs=['calibre/ebooks/pdf/render'],
                 headers=['calibre/ebooks/pdf/render/qt_hack.h'],
+                ldflags=['-Wl,-rpath,@X11LIB@'],
                 qt_private=['core', 'gui'],
                 sip_files=['calibre/ebooks/pdf/render/qt_hack.sip']
                 ),
@@ -552,6 +555,7 @@ class Build(Command):
             DESTDIR = {destdir}
             CONFIG -= create_cmake  # Prevent qmake from generating a cmake build file which it puts in the calibre src directory
             QMAKE_LIBS_PRIVATE += {glib} {fontconfig}
+            LIBS += -Wl,-rpath,@X11LIB@
             ''').format(
                 headers=' '.join(headers), sources=' '.join(sources), others=' '.join(others), destdir=self.d(
                     target), glib=glib_flags, fontconfig=fontconfig_flags, freetype=' '.join(ft_inc_dirs))
@@ -612,9 +616,11 @@ class Build(Command):
         macx {{
             QMAKE_LFLAGS += "-undefined dynamic_lookup"
         }}
+        LIBS += {ldflags}
         ''').format(
             target=sip['target'], headers=' '.join(sip['headers'] + ext.headers), sources=' '.join(ext.sources + sip['sources']),
             sipinc=pyqt['sip_inc_dir'], pyinc=sysconfig.get_python_inc(), py_lib=py_lib,
+            ldflags=' '.join(ext.ldflags),
             ver=__version__
         )
         for incdir in ext.inc_dirs:
@@ -635,7 +641,7 @@ class Build(Command):
         if iswindows:
             qmc += ['-spec', 'win32-msvc2008']
         fext = 'dll' if iswindows else 'dylib' if isosx else 'so'
-        name = '%s%s.%s' % ('release/' if iswindows else 'lib', sip['target'], fext)
+        name = '%s%s.%s' % ('release/' if iswindows else '.libs/lib', sip['target'], fext)
         try:
             os.chdir(src_dir)
             if self.newer(dest, sip['headers'] + sip['sources'] + ext.sources + ext.headers):

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl    -- 'this bath is too hot.'

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index