Package: termit
Version: 2.6.0-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: origin-ubuntu oneiric ubuntu-patch

the package termit fails to build when using the linker flag --as-needed
This is caused by the libraries being placed before the objects which
need the symbols on the command line. So the library symbols are not
registered as needed.
This is caused by use of LINKFLAGS instead of TARGET_LINK_LIBRARIES to
list libraries
See the log in the ubuntu bug:
https://bugs.launchpad.net/ubuntu/+source/termit/+bug/803204

Attached patch fixes this issue.
Description: fix build with ld --as-needed
 the CMakeLists.txt wrongly uses LINKFLAGS to register
 libraries to link with. This leads to a wrong ordering on the
 command line.
 ld --as-needed requires the libraries after the objects needing
 their symbols.
 Additionally FindGTK2 is used instead of FindGTK which is for gtk1
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/termit/+bug/803204
Author: Julian Taylor <[email protected]>
--- termit-2.6.0.orig/src/CMakeLists.txt
+++ termit-2.6.0/src/CMakeLists.txt
@@ -15,7 +15,7 @@ SET(TARGET "termit")
 
 INCLUDE_DIRECTORIES(${TERMIT_SOURCE_DIR})
 
-INCLUDE (FindGTK)
+INCLUDE (FindGTK2)
 
 INCLUDE (FindPkgConfig)
 pkg_search_module(VTE REQUIRED libvte>=0.17.1 vte>=0.17.1)
@@ -40,8 +40,6 @@ IF(DEBUG)
   SET(TERMIT_CFLAGS "${TERMIT_CFLAGS} -g -D DEBUG -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE")
 ENDIF(DEBUG)
 
-set(TERMIT_LDFLAGS ${VTE_LDFLAGS} ${GTK_LDFLAGS})
-
 SET_SOURCE_FILES_PROPERTIES(${TERMIT_SRCS} PROPERTIES 
   COMPILE_FLAGS "${TERMIT_CFLAGS}")
 
@@ -51,13 +49,7 @@ ADD_EXECUTABLE(${TARGET} ${TERMIT_SRCS})
 #  LINK_FLAGS ${TERMIT_LDFLAGS})
 #set_target_properties(${TARGET} PROPERTIES LINK_FLAGS ${TERMIT_LDFLAGS})
 
-SET(TERMIT_LDFLAGS "")
-FOREACH(ldflag ${VTE_LDFLAGS} ${GTK_LDFLAGS})
-  SET(TERMIT_LDFLAGS "${TERMIT_LDFLAGS} ${ldflag}")
-ENDFOREACH(ldflag)
-set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "${TERMIT_LDFLAGS}")
-
-target_link_libraries(${TARGET} ${LUA_LIBRARIES})
+target_link_libraries(${TARGET} ${LUA_LIBRARIES} ${GTK2_LIBRARIES} ${VTE_LIBRARIES})
 
 INSTALL(TARGETS ${TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to