[Kget] KDE/kdenetwork/kget/transfer-plugins/bittorrent

Urs Wolfer uwolfer at kde.org
Wed Mar 26 20:24:25 CET 2008


SVN commit 790478 by uwolfer:

Remove dependency to KDE extragear (KTorrent).
Just create an svn external to the lib we need (libbtcore).
For now, the svn external points to KTorrent trunk. As soon as KTorrent 3.1 has been branched, we will switch over to that.
It is possible that things could break for a short time if massive changes happen in KTorrent as long as we stay with KTorrent trunk.

Also do not link against libbtcore, but compile it into the plugin. This way we can prevent problems people had in the past when LD_LIBRARY_PATH has not been set.

CCMAIL:joris.guisson at gmail.com, kget at kde.org

 _M            . (directory)  
 M  +174 -7    CMakeLists.txt  


** trunk/KDE/kdenetwork/kget/transfer-plugins/bittorrent #property svn:externals
   + libbtcore svn://anonsvn.kde.org/home/kde/trunk/extragear/network/ktorrent/libbtcore/
--- trunk/KDE/kdenetwork/kget/transfer-plugins/bittorrent/CMakeLists.txt #790477:790478
@@ -1,14 +1,181 @@
-macro_optional_find_package(BTCore)
-macro_log_feature(BTCORE_FOUND "BTCore" "KTorrent core library" "http://ktorrent.org/" FALSE "" "Needed to build Torrent support in KGet")
+macro_optional_find_package(GMP)
+macro_log_feature(GMP_FOUND "GMP" "The GNU Multiple Precision Arithmetic Library" "http://gmplib.org/" FALSE "" "Needed to build KGet Torrent support.")
 
-if (BTCORE_FOUND)
+if (GMP_FOUND AND QCA2_FOUND)
 add_definitions(${KDE4_ENABLE_EXCEPTIONS})
 
 include_directories(
    ../../
-   ${BTCORE_INCLUDE_DIR}
+   libbtcore
+   ${QCA2_INCLUDE_DIR}
 )
 
+# keep the following list in sync with libbtcore/CMakeLists.txt
+#XFS prealloc
+CHECK_INCLUDE_FILES(xfs/xfs.h HAVE_XFS_XFS_H)
+IF(HAVE_XFS_XFS_H)
+       SET(CMAKE_EXTRA_INCLUDE_FILES xfs/xfs.h)
+       CHECK_TYPE_SIZE(__u64 HAVE___U64)
+       CHECK_TYPE_SIZE(__s64 HAVE___S64)
+       SET(CMAKE_EXTRA_INCLUDE_FILES)
+ENDIF(HAVE_XFS_XFS_H)
+
+# check for 64 bit file I/O functions
+check_function_exists(fopen64 HAVE_FOPEN64)
+check_function_exists(fseeko64 HAVE_FSEEKO64)
+check_function_exists(ftello64 HAVE_FTELLO64)
+check_function_exists(fstat64 HAVE_FSTAT64)
+check_function_exists(stat64 HAVE_STAT64)
+check_function_exists(ftruncate64 HAVE_FTRUNCATE64)
+check_function_exists(lseek64 HAVE_LSEEK64)
+check_function_exists(mmap64 HAVE_MMAP64)
+check_function_exists(munmap64 HAVE_MUNMAP64)
+check_function_exists(posix_fallocate64 HAVE_POSIX_FALLOCATE64)
+check_function_exists(posix_fallocate HAVE_POSIX_FALLOCATE)
+check_function_exists(statvfs HAVE_STATVFS)
+check_function_exists(statvfs64 HAVE_STATVFS64)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libbtcore/config-btcore.h.cmake ${CMAKE_BINARY_DIR}/config-btcore.h)
+
+set(libbtcore_SRC
+    libbtcore/util/bitset.cpp
+    libbtcore/util/timer.cpp
+    libbtcore/util/urlencoder.cpp
+    libbtcore/util/sha1hashgen.cpp
+    libbtcore/util/sha1hash.cpp
+    libbtcore/util/functions.cpp
+    libbtcore/util/ptrmap.cpp
+    libbtcore/util/array.cpp
+    libbtcore/util/error.cpp
+    libbtcore/util/file.cpp
+    libbtcore/util/fileops.cpp
+    libbtcore/util/log.cpp
+    libbtcore/util/waitjob.cpp
+    libbtcore/util/autorotatelogjob.cpp
+    libbtcore/util/compressfilejob.cpp
+
+    libbtcore/bcodec/bdecoder.cpp  
+    libbtcore/bcodec/bencoder.cpp  
+    libbtcore/bcodec/bnode.cpp  
+    libbtcore/bcodec/value.cpp
+
+    libbtcore/net/address.cpp  
+    libbtcore/net/bufferedsocket.cpp  
+    libbtcore/net/portlist.cpp  
+    libbtcore/net/socket.cpp  
+    libbtcore/net/socketmonitor.cpp  
+    libbtcore/net/speed.cpp
+    libbtcore/net/uploadthread.cpp
+    libbtcore/net/downloadthread.cpp
+    libbtcore/net/networkthread.cpp
+    libbtcore/net/socketgroup.cpp
+    libbtcore/net/socks.cpp
+    
+    libbtcore/mse/bigint.cpp  
+    libbtcore/mse/functions.cpp  
+    libbtcore/mse/rc4encryptor.cpp  
+    libbtcore/mse/streamsocket.cpp
+    libbtcore/mse/encryptedauthenticate.cpp
+    libbtcore/mse/encryptedserverauthenticate.cpp
+    
+    libbtcore/peer/authenticatebase.cpp
+    libbtcore/peer/authenticate.cpp
+    libbtcore/peer/serverauthenticate.cpp
+    libbtcore/peer/authenticationmonitor.cpp
+    libbtcore/peer/chunkcounter.cpp
+    libbtcore/peer/peerid.cpp
+    libbtcore/peer/peer.cpp
+    libbtcore/peer/peermanager.cpp
+    libbtcore/peer/peerdownloader.cpp
+    libbtcore/peer/peeruploader.cpp
+    libbtcore/peer/packetwriter.cpp
+    libbtcore/peer/packetreader.cpp
+    libbtcore/peer/utpex.cpp
+
+    libbtcore/download/piece.cpp
+    libbtcore/download/request.cpp
+    libbtcore/download/packet.cpp
+    libbtcore/download/webseed.cpp
+    libbtcore/download/chunkdownload.cpp
+    libbtcore/download/chunkselector.cpp
+    libbtcore/download/downloader.cpp
+    libbtcore/download/httpconnection.cpp
+
+    libbtcore/interfaces/piecedownloader.cpp
+    libbtcore/interfaces/peerinterface.cpp
+    libbtcore/interfaces/peersource.cpp
+    libbtcore/interfaces/torrentinterface.cpp
+    libbtcore/interfaces/torrentfileinterface.cpp
+    libbtcore/interfaces/trackerslist.cpp
+    libbtcore/interfaces/logmonitorinterface.cpp
+    libbtcore/interfaces/ipblockinginterface.cpp
+    libbtcore/interfaces/exitoperation.cpp
+    libbtcore/interfaces/chunkdownloadinterface.cpp
+    libbtcore/interfaces/monitorinterface.cpp
+    libbtcore/interfaces/queuemanagerinterface.cpp
+    libbtcore/interfaces/chunkselectorinterface.cpp
+    libbtcore/interfaces/cachefactory.cpp
+    libbtcore/interfaces/webseedinterface.cpp
+
+    libbtcore/torrent/globals.cpp
+    libbtcore/torrent/server.cpp
+    libbtcore/torrent/torrent.cpp
+    libbtcore/torrent/torrentfile.cpp
+    libbtcore/torrent/ipblocklist.cpp
+    libbtcore/torrent/peersourcemanager.cpp
+    libbtcore/torrent/uploader.cpp
+    libbtcore/torrent/timeestimator.cpp
+    libbtcore/torrent/statsfile.cpp
+    libbtcore/torrent/choker.cpp
+    libbtcore/torrent/advancedchokealgorithm.cpp
+    libbtcore/torrent/torrentcontrol.cpp
+    libbtcore/torrent/torrentcreator.cpp
+
+    libbtcore/dht/announcetask.cpp  
+    libbtcore/dht/dht.cpp                
+    libbtcore/dht/kclosestnodessearch.cpp  
+    libbtcore/dht/nodelookup.cpp  
+    libbtcore/dht/rpcmsg.cpp     
+    libbtcore/dht/taskmanager.cpp
+    libbtcore/dht/database.cpp      
+    libbtcore/dht/dhttrackerbackend.cpp  
+    libbtcore/dht/key.cpp                  
+    libbtcore/dht/pack.cpp        
+    libbtcore/dht/rpcserver.cpp
+    libbtcore/dht/dhtbase.cpp       
+    libbtcore/dht/kbucket.cpp            
+    libbtcore/dht/node.cpp                 
+    libbtcore/dht/rpccall.cpp     
+    libbtcore/dht/task.cpp
+
+    libbtcore/diskio/cache.cpp      
+    libbtcore/diskio/chunk.cpp         
+    libbtcore/diskio/dndfile.cpp         
+    libbtcore/diskio/singlefilecache.cpp
+    libbtcore/diskio/cachefile.cpp  
+    libbtcore/diskio/chunkmanager.cpp  
+    libbtcore/diskio/multifilecache.cpp
+    libbtcore/diskio/preallocationthread.cpp
+    libbtcore/diskio/movedatafilesjob.cpp
+
+    libbtcore/tracker/httptracker.cpp  
+    libbtcore/tracker/tracker.cpp  
+    libbtcore/tracker/udptracker.cpp  
+    libbtcore/tracker/udptrackersocket.cpp
+    
+    libbtcore/datachecker/datachecker.cpp          
+    libbtcore/datachecker/datacheckerthread.cpp  
+    libbtcore/datachecker/singledatachecker.cpp
+    libbtcore/datachecker/datacheckerlistener.cpp  
+    libbtcore/datachecker/multidatachecker.cpp
+    
+    libbtcore/migrate/cachemigrate.cpp  
+    libbtcore/migrate/ccmigrate.cpp  
+    libbtcore/migrate/migrate.cpp
+    
+    libbtcore/btversion.cpp
+)
+
 set(kget_bittorrentfactory_PART_SRCS
   bttransfer.cpp
   bttransferfactory.cpp
@@ -45,11 +212,11 @@
 
 kde4_add_kcfg_files(kget_bittorrentfactory_PART_SRCS bittorrentsettings.kcfgc)
 
-kde4_add_plugin(kget_bittorrentfactory ${kget_bittorrentfactory_PART_SRCS})
+kde4_add_plugin(kget_bittorrentfactory ${kget_bittorrentfactory_PART_SRCS} ${libbtcore_SRC})
 
-target_link_libraries(kget_bittorrentfactory ${KDE4_KDEUI_LIBS} ${BTCORE_LIBRARIES} kgetcore)
+target_link_libraries(kget_bittorrentfactory ${KDE4_KDEUI_LIBS} ${GMP_LIBRARIES} ${QCA2_LIBRARIES} kgetcore)
 
 install(TARGETS kget_bittorrentfactory DESTINATION  ${PLUGIN_INSTALL_DIR})
 install(FILES kget_bittorrentfactory.desktop DESTINATION ${SERVICES_INSTALL_DIR})
 
-endif(BTCORE_FOUND)
+endif(GMP_FOUND AND QCA2_FOUND)


More information about the Kget mailing list