Bug 185032 - [PATCH] multimedia/k9copy-kde4 fix build on 10.0
Summary: [PATCH] multimedia/k9copy-kde4 fix build on 10.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-20 16:00 UTC by me
Modified: 2014-01-25 23:50 UTC (History)
0 users

See Also:


Attachments
file.diff (2.70 KB, patch)
2013-12-20 16:00 UTC, me
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description me 2013-12-20 16:00:00 UTC
[Patch sent to maintainer for comments on 2013-12-06 without response. Repeating it here for it not to get lost.]

multimedia/k9copy-kde4 fails on 10 due to loader changes and clang being more strict.

Fix: With the patch attached, it builds, installs and packages on 10.0-RC2/amd64. The binary runs. It still builds on 9.2-RELEASE/amd64.

Comments about the patch:

1. I do not know how to properly fix the linking failures due to loader changes. This works, though it seems really hacky:

LDFLAGS+= ${KDE4_PREFIX}/lib/libsolid.so ${LOCALBASE}/lib/libX11.so

2. The changes to src/xine/k9xineplayer.cpp should be correct.

3. I have not really analyzed the logic in src/mpeg2/kdecmpeg2.cpp, but since inserting 'return 0' at the end only makes an undefined return code defined, it should not break anything.

Patch attached with submission follows:
How-To-Repeat: Try to build multimedia/k9copy-kde4 on 10.0-RC2/amd64.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-20 16:00:07 UTC
Maintainer of multimedia/k9copy-kde4,

Please note that PR ports/185032 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/185032

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-20 16:00:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-01-25 22:41:50 UTC
Author: rakuco
Date: Sat Jan 25 22:41:42 2014
New Revision: 341132
URL: http://svnweb.freebsd.org/changeset/ports/341132
QAT: https://qat.redports.org/buildarchive/r341132/

Log:
  - Fix the build with clang and 10+'s ld(1).
    On the clang side, there's a non-void function missing a return statement
    and some wrong QString-to-char* casts that had to be fixed.
    On the linker side, r253839 made our ld stricter, so we had to add some
    shared libraries that we use since they are not being pulled in indirectly
    anymore.
    Based on a patch by Jan Henrik Sylvester <me@janh.de> [1].
  - Set LICENSE
  - Support staging.
  - Remove LATEST_LINK, it is deprecated.
  - Use the new OPTIONS helpers for conditional RUN_DEPENDS.
  
  PR:		ports/185032 [1]
  Submitted by:	Jan Henrik Sylvester <me@janh.de> [1]
  Approved by:	maintainer timeout (37 days)
  MFH:		2014Q1

Added:
  head/multimedia/k9copy-kde4/files/patch-src_mpeg2_kdecmpeg2.cpp   (contents, props changed)
Modified:
  head/multimedia/k9copy-kde4/Makefile
  head/multimedia/k9copy-kde4/files/patch-CMakeLists.txt
  head/multimedia/k9copy-kde4/files/patch-src-xine-k9xineplayer.cpp

Modified: head/multimedia/k9copy-kde4/Makefile
==============================================================================
--- head/multimedia/k9copy-kde4/Makefile	Sat Jan 25 22:40:05 2014	(r341131)
+++ head/multimedia/k9copy-kde4/Makefile	Sat Jan 25 22:41:42 2014	(r341132)
@@ -11,6 +11,8 @@ DISTNAME=	${PORTNAME}-${PORTVERSION}-Sou
 MAINTAINER=	egoliveira@gmail.com
 COMMENT=	DVD-9 to DVD-5 shrinking application for KDE
 
+LICENSE=	GPLv2
+
 LIB_DEPENDS=	libxine.so:${PORTSDIR}/multimedia/libxine \
 		libmpeg2.so:${PORTSDIR}/multimedia/libmpeg2 \
 		libavcodec0.so:${PORTSDIR}/multimedia/ffmpeg0
@@ -19,8 +21,6 @@ USES=		cmake gettext
 USE_KDE4=	kdeprefix kdelibs automoc4
 USE_QT4=	moc_build qmake_build rcc_build uic_build
 
-LATEST_LINK=	${PORTNAME}-kde4
-
 CFLAGS=		-I${LOCALBASE}/include/ffmpeg0
 CPPFLAGS=	-I${LOCALBASE}/include/ffmpeg0
 CXXFLAGS=	-I${LOCALBASE}/include/ffmpeg0
@@ -30,20 +30,9 @@ MENCODER_DESC=	MEncoder support
 MPLAYER_DESC=	MPlayer support
 DVDAUTHOR_DESC=	DVD Author support
 
-NO_STAGE=	yes
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MMENCODER}
-RUN_DEPENDS+=	mencoder:${PORTSDIR}/multimedia/mencoder
-.endif
-
-.if ${PORT_OPTIONS:MMPLAYER}
-RUN_DEPENDS+=	mplayer:${PORTSDIR}/multimedia/mplayer
-.endif
-
-.if ${PORT_OPTIONS:MDVDAUTHOR}
-RUN_DEPENDS+=	dvdauthor:${PORTSDIR}/multimedia/dvdauthor
-.endif
+MENCODER_RUN_DEPENDS=	mencoder:${PORTSDIR}/multimedia/mencoder
+MPLAYER_RUN_DEPENDS=	mplayer:${PORTSDIR}/multimedia/mplayer
+DVDAUTHOR_RUN_DEPENDS=	dvdauthor:${PORTSDIR}/multimedia/dvdauthor
 
 post-patch:
 	@${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},g' ${WRKSRC}/cmake/*.cmake

Modified: head/multimedia/k9copy-kde4/files/patch-CMakeLists.txt
==============================================================================
--- head/multimedia/k9copy-kde4/files/patch-CMakeLists.txt	Sat Jan 25 22:40:05 2014	(r341131)
+++ head/multimedia/k9copy-kde4/files/patch-CMakeLists.txt	Sat Jan 25 22:41:42 2014	(r341132)
@@ -29,10 +29,10 @@
  kde4_add_executable(k9xineplayer ${k9xineplayer_SRCS})
  
 -target_link_libraries(k9copy k9copylib ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS}  -lphonon )
-+target_link_libraries(k9copy k9copylib ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS}  ${PHONON_LIBRARY} )
++target_link_libraries(k9copy k9copylib ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS} ${KDE4_SOLID_LIBS} ${PHONON_LIBRARY} )
  target_link_libraries(k9play k9copylib ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS}  )
 -target_link_libraries(k9xineplayer ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS} -lxine )
-+target_link_libraries(k9xineplayer ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS} ${XINE_LIBRARY} )
++target_link_libraries(k9xineplayer ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS} ${XINE_LIBRARY} ${X11_LIBRARIES} )
  
  
  install(TARGETS k9copy DESTINATION ${BIN_INSTALL_DIR} )

Modified: head/multimedia/k9copy-kde4/files/patch-src-xine-k9xineplayer.cpp
==============================================================================
--- head/multimedia/k9copy-kde4/files/patch-src-xine-k9xineplayer.cpp	Sat Jan 25 22:40:05 2014	(r341131)
+++ head/multimedia/k9copy-kde4/files/patch-src-xine-k9xineplayer.cpp	Sat Jan 25 22:41:42 2014	(r341132)
@@ -1,6 +1,15 @@
---- src/xine/k9xineplayer.cpp.orig
-+++ src/xine/k9xineplayer.cpp
-@@ -260,8 +260,10 @@ void k9xinePlayer::init(WId _wid) {
+--- src/xine/k9xineplayer.cpp.orig	2009-12-06 10:13:37.000000000 +0000
++++ src/xine/k9xineplayer.cpp	2013-12-06 15:34:35.000000000 +0000
+@@ -251,7 +251,7 @@
+ 
+     if ((vo_port = xine_open_video_driver(xine,
+                                           m_vo.toAscii(), XINE_VISUAL_TYPE_X11, (void *) &vis)) == NULL) {
+-        printf("I'm unable to initialize '%s' video driver. Giving up.\n", m_vo.toAscii());
++        printf("I'm unable to initialize '%s' video driver. Giving up.\n", m_vo.toAscii().constData());
+         return ;
+     }
+ 
+@@ -260,8 +260,10 @@
      event_queue = xine_event_new_queue(stream);
      xine_event_create_listener_thread(event_queue, event_listener, this);
  
@@ -13,7 +22,16 @@
      m_execute=true;
  
  }
-@@ -284,7 +286,8 @@ void k9xinePlayer::quit() {
+@@ -270,7 +272,7 @@
+     running=false;
+     m_title="";
+     if ((!xine_open(stream, m_mrl.toUtf8())) || (!xine_play(stream, 0, 0))) {
+-        printf("Unable to open mrl '%s'\n", m_mrl.toUtf8());
++        printf("Unable to open mrl '%s'\n", m_mrl.toUtf8().constData());
+         return ;
+     }
+     QTimer::singleShot (500, this, SLOT (updatePosition ()));
+@@ -284,7 +286,8 @@
  void k9xinePlayer::update() {
      if (stream && !running ) {
          if (m_mutex.tryLock()) {

Added: head/multimedia/k9copy-kde4/files/patch-src_mpeg2_kdecmpeg2.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/k9copy-kde4/files/patch-src_mpeg2_kdecmpeg2.cpp	Sat Jan 25 22:41:42 2014	(r341132)
@@ -0,0 +1,10 @@
+--- src/mpeg2/kdecmpeg2.cpp.orig	2009-12-06 10:13:36.000000000 +0000
++++ src/mpeg2/kdecmpeg2.cpp	2013-12-06 15:00:15.000000000 +0000
+@@ -286,6 +286,7 @@
+ 	      }
+     	}
+     }
++    return 0;
+ }
+ 
+ void kDecMPEG2::sync() {
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-01-25 22:42:59 UTC
State Changed
From-To: feedback->closed

Thanks, I've committed a slightly different version that correctly links 
against libsolid and libX11.
Comment 5 dfilter service freebsd_committer freebsd_triage 2014-01-25 23:45:25 UTC
Author: rakuco
Date: Sat Jan 25 23:45:17 2014
New Revision: 341140
URL: http://svnweb.freebsd.org/changeset/ports/341140
QAT: https://qat.redports.org/buildarchive/r341140/

Log:
  MFH: r341132
  
  - Fix the build with clang and 10+'s ld(1).
    On the clang side, there's a non-void function missing a return statement
    and some wrong QString-to-char* casts that had to be fixed.
    On the linker side, r253839 made our ld stricter, so we had to add some
    shared libraries that we use since they are not being pulled in indirectly
    anymore.
    Based on a patch by Jan Henrik Sylvester <me@janh.de> [1].
  - Set LICENSE
  - Support staging.
  - Remove LATEST_LINK, it is deprecated.
  - Use the new OPTIONS helpers for conditional RUN_DEPENDS.
  
  PR:		ports/185032 [1]
  Submitted by:	Jan Henrik Sylvester <me@janh.de> [1]
  Approved by:	maintainer timeout (37 days)
  
  Approved by:	portmgr (antoine)

Added:
  branches/2014Q1/multimedia/k9copy-kde4/files/patch-src_mpeg2_kdecmpeg2.cpp
     - copied unchanged from r341132, head/multimedia/k9copy-kde4/files/patch-src_mpeg2_kdecmpeg2.cpp
Modified:
  branches/2014Q1/multimedia/k9copy-kde4/Makefile
  branches/2014Q1/multimedia/k9copy-kde4/files/patch-CMakeLists.txt
  branches/2014Q1/multimedia/k9copy-kde4/files/patch-src-xine-k9xineplayer.cpp
Directory Properties:
  branches/2014Q1/   (props changed)

Modified: branches/2014Q1/multimedia/k9copy-kde4/Makefile
==============================================================================
--- branches/2014Q1/multimedia/k9copy-kde4/Makefile	Sat Jan 25 23:44:40 2014	(r341139)
+++ branches/2014Q1/multimedia/k9copy-kde4/Makefile	Sat Jan 25 23:45:17 2014	(r341140)
@@ -11,6 +11,8 @@ DISTNAME=	${PORTNAME}-${PORTVERSION}-Sou
 MAINTAINER=	egoliveira@gmail.com
 COMMENT=	DVD-9 to DVD-5 shrinking application for KDE
 
+LICENSE=	GPLv2
+
 LIB_DEPENDS=	libxine.so:${PORTSDIR}/multimedia/libxine \
 		libmpeg2.so:${PORTSDIR}/multimedia/libmpeg2 \
 		libavcodec0.so:${PORTSDIR}/multimedia/ffmpeg0
@@ -19,8 +21,6 @@ USES=		cmake gettext
 USE_KDE4=	kdeprefix kdelibs automoc4
 USE_QT4=	moc_build qmake_build rcc_build uic_build
 
-LATEST_LINK=	${PORTNAME}-kde4
-
 CFLAGS=		-I${LOCALBASE}/include/ffmpeg0
 CPPFLAGS=	-I${LOCALBASE}/include/ffmpeg0
 CXXFLAGS=	-I${LOCALBASE}/include/ffmpeg0
@@ -30,20 +30,9 @@ MENCODER_DESC=	MEncoder support
 MPLAYER_DESC=	MPlayer support
 DVDAUTHOR_DESC=	DVD Author support
 
-NO_STAGE=	yes
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MMENCODER}
-RUN_DEPENDS+=	mencoder:${PORTSDIR}/multimedia/mencoder
-.endif
-
-.if ${PORT_OPTIONS:MMPLAYER}
-RUN_DEPENDS+=	mplayer:${PORTSDIR}/multimedia/mplayer
-.endif
-
-.if ${PORT_OPTIONS:MDVDAUTHOR}
-RUN_DEPENDS+=	dvdauthor:${PORTSDIR}/multimedia/dvdauthor
-.endif
+MENCODER_RUN_DEPENDS=	mencoder:${PORTSDIR}/multimedia/mencoder
+MPLAYER_RUN_DEPENDS=	mplayer:${PORTSDIR}/multimedia/mplayer
+DVDAUTHOR_RUN_DEPENDS=	dvdauthor:${PORTSDIR}/multimedia/dvdauthor
 
 post-patch:
 	@${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},g' ${WRKSRC}/cmake/*.cmake

Modified: branches/2014Q1/multimedia/k9copy-kde4/files/patch-CMakeLists.txt
==============================================================================
--- branches/2014Q1/multimedia/k9copy-kde4/files/patch-CMakeLists.txt	Sat Jan 25 23:44:40 2014	(r341139)
+++ branches/2014Q1/multimedia/k9copy-kde4/files/patch-CMakeLists.txt	Sat Jan 25 23:45:17 2014	(r341140)
@@ -29,10 +29,10 @@
  kde4_add_executable(k9xineplayer ${k9xineplayer_SRCS})
  
 -target_link_libraries(k9copy k9copylib ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS}  -lphonon )
-+target_link_libraries(k9copy k9copylib ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS}  ${PHONON_LIBRARY} )
++target_link_libraries(k9copy k9copylib ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS} ${KDE4_SOLID_LIBS} ${PHONON_LIBRARY} )
  target_link_libraries(k9play k9copylib ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS}  )
 -target_link_libraries(k9xineplayer ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS} -lxine )
-+target_link_libraries(k9xineplayer ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS} ${XINE_LIBRARY} )
++target_link_libraries(k9xineplayer ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS} ${XINE_LIBRARY} ${X11_LIBRARIES} )
  
  
  install(TARGETS k9copy DESTINATION ${BIN_INSTALL_DIR} )

Modified: branches/2014Q1/multimedia/k9copy-kde4/files/patch-src-xine-k9xineplayer.cpp
==============================================================================
--- branches/2014Q1/multimedia/k9copy-kde4/files/patch-src-xine-k9xineplayer.cpp	Sat Jan 25 23:44:40 2014	(r341139)
+++ branches/2014Q1/multimedia/k9copy-kde4/files/patch-src-xine-k9xineplayer.cpp	Sat Jan 25 23:45:17 2014	(r341140)
@@ -1,6 +1,15 @@
---- src/xine/k9xineplayer.cpp.orig
-+++ src/xine/k9xineplayer.cpp
-@@ -260,8 +260,10 @@ void k9xinePlayer::init(WId _wid) {
+--- src/xine/k9xineplayer.cpp.orig	2009-12-06 10:13:37.000000000 +0000
++++ src/xine/k9xineplayer.cpp	2013-12-06 15:34:35.000000000 +0000
+@@ -251,7 +251,7 @@
+ 
+     if ((vo_port = xine_open_video_driver(xine,
+                                           m_vo.toAscii(), XINE_VISUAL_TYPE_X11, (void *) &vis)) == NULL) {
+-        printf("I'm unable to initialize '%s' video driver. Giving up.\n", m_vo.toAscii());
++        printf("I'm unable to initialize '%s' video driver. Giving up.\n", m_vo.toAscii().constData());
+         return ;
+     }
+ 
+@@ -260,8 +260,10 @@
      event_queue = xine_event_new_queue(stream);
      xine_event_create_listener_thread(event_queue, event_listener, this);
  
@@ -13,7 +22,16 @@
      m_execute=true;
  
  }
-@@ -284,7 +286,8 @@ void k9xinePlayer::quit() {
+@@ -270,7 +272,7 @@
+     running=false;
+     m_title="";
+     if ((!xine_open(stream, m_mrl.toUtf8())) || (!xine_play(stream, 0, 0))) {
+-        printf("Unable to open mrl '%s'\n", m_mrl.toUtf8());
++        printf("Unable to open mrl '%s'\n", m_mrl.toUtf8().constData());
+         return ;
+     }
+     QTimer::singleShot (500, this, SLOT (updatePosition ()));
+@@ -284,7 +286,8 @@
  void k9xinePlayer::update() {
      if (stream && !running ) {
          if (m_mutex.tryLock()) {

Copied: branches/2014Q1/multimedia/k9copy-kde4/files/patch-src_mpeg2_kdecmpeg2.cpp (from r341132, head/multimedia/k9copy-kde4/files/patch-src_mpeg2_kdecmpeg2.cpp)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2014Q1/multimedia/k9copy-kde4/files/patch-src_mpeg2_kdecmpeg2.cpp	Sat Jan 25 23:45:17 2014	(r341140, copy of r341132, head/multimedia/k9copy-kde4/files/patch-src_mpeg2_kdecmpeg2.cpp)
@@ -0,0 +1,10 @@
+--- src/mpeg2/kdecmpeg2.cpp.orig	2009-12-06 10:13:36.000000000 +0000
++++ src/mpeg2/kdecmpeg2.cpp	2013-12-06 15:00:15.000000000 +0000
+@@ -286,6 +286,7 @@
+ 	      }
+     	}
+     }
++    return 0;
+ }
+ 
+ void kDecMPEG2::sync() {
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"