diff options
author | Ben de Groot <yngwin@gentoo.org> | 2015-05-20 20:45:03 +0800 |
---|---|---|
committer | Ben de Groot <yngwin@gentoo.org> | 2015-05-20 20:45:03 +0800 |
commit | 799dc33cb0d0e7bb6b3d9ef5ac5679ff4d4f8753 (patch) | |
tree | 21d8b8f55b9ebbb6de445de0be65b8c0524f9030 | |
parent | net-misc/android-file-transfer: initial commit; needs work on automagic deps (diff) | |
download | yngwin-799dc33cb0d0e7bb6b3d9ef5ac5679ff4d4f8753.tar.gz yngwin-799dc33cb0d0e7bb6b3d9ef5ac5679ff4d4f8753.tar.bz2 yngwin-799dc33cb0d0e7bb6b3d9ef5ac5679ff4d4f8753.zip |
net-misc/android-file-transfer: improvements, but qt4 does not work yet
-rw-r--r-- | net-misc/android-file-transfer/android-file-transfer-2.2.ebuild | 3 | ||||
-rw-r--r-- | net-misc/android-file-transfer/files/2.2-automagic.patch | 103 |
2 files changed, 106 insertions, 0 deletions
diff --git a/net-misc/android-file-transfer/android-file-transfer-2.2.ebuild b/net-misc/android-file-transfer/android-file-transfer-2.2.ebuild index 91f5502..36c845e 100644 --- a/net-misc/android-file-transfer/android-file-transfer-2.2.ebuild +++ b/net-misc/android-file-transfer/android-file-transfer-2.2.ebuild @@ -26,11 +26,14 @@ DEPEND="${RDEPEND} virtual/pkgconfig" S=${WORKDIR}/${MY_PN}-${PV} +PATCHES=( "${FILESDIR}/2.2-automagic.patch" ) src_configure() { local mycmakeargs=( $(cmake-utils_use_build qt4 QT_UI) + $(cmake-utils_use_use qt4 QT4) $(cmake-utils_use_build qt5 QT_UI) + $(cmake-utils_use_use qt5 QT5) ) cmake-utils_src_configure } diff --git a/net-misc/android-file-transfer/files/2.2-automagic.patch b/net-misc/android-file-transfer/files/2.2-automagic.patch new file mode 100644 index 0000000..d702c25 --- /dev/null +++ b/net-misc/android-file-transfer/files/2.2-automagic.patch @@ -0,0 +1,103 @@ +diff -burN android-file-transfer-linux-2.2.orig/CMakeLists.txt android-file-transfer-linux-2.2/CMakeLists.txt +--- android-file-transfer-linux-2.2.orig/CMakeLists.txt 2015-05-18 05:09:33.000000000 +0800 ++++ android-file-transfer-linux-2.2/CMakeLists.txt 2015-05-20 20:37:39.446876364 +0800 +@@ -6,11 +6,15 @@ + include(CheckFunctionExists) + + find_package ( Threads ) +-pkg_check_modules ( FUSE fuse ) + +-if (FUSE_FOUND) ++option(ENABLE_FUSE "Enable fuse interface support" OFF) ++if (ENABLE_FUSE) ++ pkg_check_modules ( FUSE fuse ) ++ ++ if (FUSE_FOUND) + message(STATUS "fuse found, building mount helper") + add_definitions(${FUSE_CFLAGS} -DFUSE_USE_VERSION=26) ++ endif() + endif() + + option(BUILD_QT_UI "Build reference Qt application" ON) +@@ -87,12 +91,15 @@ + + add_executable(aft-mtp-cli mtp/cli.cpp) + target_link_libraries(aft-mtp-cli ${MTP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) ++install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/aft-mtp-cli DESTINATION bin) + +-if (FUSE_FOUND) ++if (ENABLE_FUSE) ++ if (FUSE_FOUND) + add_executable(aft-mtp-mount mtp/fuse.cpp) + target_link_libraries(aft-mtp-mount ${MTP_LIBRARIES} ${FUSE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/aft-mtp-mount DESTINATION bin) +-endif() ++ endif (FUSE_FOUND) ++endif (ENABLE_FUSE) + + if (BUILD_QT_UI) + add_subdirectory(qt) +diff -burN android-file-transfer-linux-2.2.orig/qt/CMakeLists.txt android-file-transfer-linux-2.2/qt/CMakeLists.txt +--- android-file-transfer-linux-2.2.orig/qt/CMakeLists.txt 2015-05-18 05:09:33.000000000 +0800 ++++ android-file-transfer-linux-2.2/qt/CMakeLists.txt 2015-05-20 20:40:14.172887578 +0800 +@@ -1,7 +1,17 @@ + project(mtp-qt) + +-find_package(Qt5Widgets QUIET) +-find_package(Qt4 QUIET) ++option(USE_QT4 "Build Qt4 GUI" OFF) ++option(USE_QT5 "Build Qt5 GUI" ON) ++ ++if (NOT USE_QT4 AND NOT USE_QT5) ++ message(FATAL_ERROR "Neither Qt4 nor Qt5 enabled") ++endif() ++ ++if (USE_QT5) ++ find_package(Qt5Widgets REQUIRED) ++elseif (USE_QT4) ++ find_package(Qt4 REQUIRED) ++endif() + + set(SOURCES main.cpp + mainwindow.cpp +@@ -31,22 +41,30 @@ + renamedialog.ui + ) + +-if (Qt5Widgets_FOUND) +- message(STATUS "Using Qt5") +- qt5_wrap_cpp(HEADERS_MOC ${HEADERS}) +- qt5_wrap_ui(FORMS_HEADERS ${FORMS}) +- qt5_add_resources(RESOURCES android-file-transfer.qrc) +- include_directories(${Qt5Widgets_INCLUDE_DIRS}) +- set(EXTRA_QT_LINK ${Qt5Widgets_LIBRARIES}) +-elseif(Qt4_FOUND OR QT_FOUND OR QT4_FOUND) ++if (USE_QT4) ++ if(Qt4_FOUND OR QT_FOUND OR QT4_FOUND) + message(STATUS "Using Qt4") + qt4_wrap_cpp(HEADERS_MOC ${HEADERS}) + qt4_wrap_ui(FORMS_HEADERS ${FORMS}) + qt4_add_resources(RESOURCES android-file-transfer.qrc) + include(${QT_USE_FILE}) + set(EXTRA_QT_LINK ${QT_LIBRARIES}) +-else() +- message(FATAL_ERROR "No Qt found") ++ else() ++ message(FATAL_ERROR "Qt4 enabled but not found") ++ endif() ++endif() ++ ++if (USE_QT5) ++ if (Qt5Widgets_FOUND) ++ message(STATUS "Using Qt5") ++ qt5_wrap_cpp(HEADERS_MOC ${HEADERS}) ++ qt5_wrap_ui(FORMS_HEADERS ${FORMS}) ++ qt5_add_resources(RESOURCES android-file-transfer.qrc) ++ include_directories(${Qt5Widgets_INCLUDE_DIRS}) ++ set(EXTRA_QT_LINK ${Qt5Widgets_LIBRARIES}) ++ else() ++ message(FATAL_ERROR "Qt5 enabled but not found") ++ endif() + endif() + + add_definitions(${QT_DEFINITIONS}) |