[131841] trunk/dports/office

mk at macports.org mk at macports.org
Mon Jan 19 11:26:09 PST 2015


Revision: 131841
          https://trac.macports.org/changeset/131841
Author:   mk at macports.org
Date:     2015-01-19 11:26:09 -0800 (Mon, 19 Jan 2015)
Log Message:
-----------
charm(-qt5): new port for qt[45] (Thanks, Rene: see issue #46575)

Added Paths:
-----------
    trunk/dports/office/charm/
    trunk/dports/office/charm/Portfile
    trunk/dports/office/charm/files/
    trunk/dports/office/charm/files/adapt-to-osx-macports.patch
    trunk/dports/office/charm/files/patch-CMakeFiles.patch

Added: trunk/dports/office/charm/Portfile
===================================================================
--- trunk/dports/office/charm/Portfile	                        (rev 0)
+++ trunk/dports/office/charm/Portfile	2015-01-19 19:26:09 UTC (rev 131841)
@@ -0,0 +1,63 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem          1.0
+PortGroup           github 1.0
+PortGroup           cmake 1.0
+
+github.setup        KDAB Charm aca5faf6
+
+# The last release version is too old:
+#github.setup        KDAB Charm 1.8.0
+#github.tarball_from releases
+
+name                charm
+version             1.8.0
+maintainers         gmail.com:rjvbertin
+categories          office
+license             GPL-2+ LGPL-2.1+
+description         Charm - the Cross-Platform Time Tracker
+long_description    Charm is a program for OS X, Linux and Windows that helps to keep track of time. It is built around two major ideas - tasks and events. Tasks are the things time is spend on, repeatedly. For example, ironing laundry is a task. The laundry done for two hours on last Tuesday is an event in that task. When doing laundry multiple times, the events will be accumulated, and can later be printed in activity reports or weekly/monthly time sheets. So in case laundry would be done for three hours on Wednesday again, the activity report for the "Ironing Laundry" task would list the event on tuesday, the event on wednesday and a total of five hours.
+platforms           darwin
+
+subport ${name}-qt5 {
+    PortGroup       qt5 1.0
+    conflicts       ${name}
+    depends_lib-append      port:qt5-mac-sqlite3-plugin
+    configure.args-append   -DWITH_QT4:BOOL=OFF
+}
+
+if {${subport} ne "${name}-qt5"} {
+    PortGroup       qt4 1.0
+    conflicts       ${name}-qt5
+    depends_build-append    port:automoc
+    depends_lib-append      port:qt4-mac-sqlite3-plugin
+    configure.args-append   -DWITH_QT4:BOOL=ON -DBIN_INSTALL_DIR:PATH=${qt_apps_dir}
+}
+
+configure.args-append   -DCharm_VERSION="${version}-${github.version}" -DBIN_INSTALL_DIR:PATH=${qt_apps_dir}
+
+# aca5faf6
+checksums           rmd160  c0f938504705477a751f4be7f28220de261a1e56 \
+                    sha256  1651dc8fb4c5100c96137e1fe076ce86a89b98b2e81e652a4fae1b8a5c5860f7
+
+# 1.8.0
+#checksums           rmd160  95fca2fd3236f8d39bf9e67b5ca43e3466f6c205 \
+#                    sha256  d2cfefd78893288e99b8b813185fa5449a423988e070940b9894e304e0208c54
+
+patchfiles          patch-CMakeFiles.patch \
+                    adapt-to-osx-macports.patch
+
+post-extract                {file mkdir ${workpath}/build}
+# standard post-arg, where to find the primary CMakeLists.txt file.
+default configure.post_args {../${worksrcdir}}
+default configure.dir       {${workpath}/build}
+default build.dir           {${workpath}/build}
+
+use_parallel_build  yes
+
+post-destroot {
+    xinstall -m 0755 -d ${destroot}${qt_apps_dir}
+    ln -s ${qt_apps_dir}/Charm.app/Contents/MacOS/Charm ${destroot}${prefix}/bin/charmtimetracker
+}
+


Property changes on: trunk/dports/office/charm/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/office/charm/files/adapt-to-osx-macports.patch
===================================================================
--- trunk/dports/office/charm/files/adapt-to-osx-macports.patch	                        (rev 0)
+++ trunk/dports/office/charm/files/adapt-to-osx-macports.patch	2015-01-19 19:26:09 UTC (rev 131841)
@@ -0,0 +1,124 @@
+diff --git Charm/ApplicationCore.cpp Charm/ApplicationCore.cpp
+index 17cd0fe..964d098 100644
+--- Charm/ApplicationCore.cpp
++++ Charm/ApplicationCore.cpp
+@@ -158,10 +158,12 @@ ApplicationCore::ApplicationCore( QObject* parent )
+              SLOT( slotQuitApplication() ) );
+ 
+     m_actionAboutDialog.setText( tr( "About Charm" ) );
++    m_actionAboutDialog.setMenuRole(QAction::AboutRole);
+     connect( &m_actionAboutDialog, SIGNAL( triggered() ),
+              &mainView(),  SLOT( slotAboutDialog() ) );
+ 
+     m_actionPreferences.setText( tr( "Preferences" ) );
++    m_actionPreferences.setMenuRole(QAction::PreferencesRole);
+     m_actionPreferences.setIcon( Data::configureIcon() );
+     connect( &m_actionPreferences, SIGNAL( triggered( bool ) ),
+              &mainView(),  SLOT( slotEditPreferences( bool ) ) );
+@@ -260,7 +262,7 @@ void ApplicationCore::createWindowMenu( QMenuBar *menuBar )
+     menu->addAction( &m_actionActivityReport );
+     menu->addAction( &m_actionWeeklyTimesheetReport );
+     menu->addAction( &m_actionMonthlyTimesheetReport );
+-#ifndef Q_OS_OSX
++#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
+     menu->addSeparator();
+ #endif
+     menu->addAction( &m_actionPreferences );
+@@ -277,7 +279,7 @@ void ApplicationCore::createFileMenu( QMenuBar *menuBar )
+     menu->addAction( &m_actionSyncTasks );
+     menu->addAction( &m_actionImportTasks );
+     menu->addAction( &m_actionExportTasks );
+-#ifndef Q_OS_OSX
++#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
+     menu->addSeparator();
+ #endif
+     menu->addAction( &m_actionQuit );
+diff --git Charm/Charm.cpp Charm/Charm.cpp
+index 4872e3a..951ba5a 100644
+--- Charm/Charm.cpp
++++ Charm/Charm.cpp
+@@ -13,9 +13,10 @@
+ 
+ static ApplicationCore* createApplicationCore()
+ {
+-#ifdef Q_OS_OSX
+-    return new MacApplicationCore;
+-#endif
++// #if defined(Q_OS_OSX) || defined(Q_OS_MAC)
++//     // this seems to disable (menu) shortcuts...
++//     return new MacApplicationCore;
++// #endif
+     return new ApplicationCore;
+ }
+ 
+@@ -46,6 +47,9 @@ int main ( int argc, char** argv )
+ 
+     try {
+         QApplication app( argc, argv );
++#if defined(Q_OS_MAC) || defined(Q_OS_OSX)
++        app.setAttribute(Qt::AA_DontShowIconsInMenus);
++#endif
+         QScopedPointer<ApplicationCore> core( createApplicationCore() );
+         QObject::connect( &app, SIGNAL(commitDataRequest(QSessionManager&)), core.data(), SLOT(commitData(QSessionManager&)) );
+         QObject::connect( &app, SIGNAL(saveStateRequest(QSessionManager&)), core.data(), SLOT(saveState(QSessionManager&)) );
+diff --git Charm/Data.cpp Charm/Data.cpp
+index ad8abfa..a7778b1 100644
+--- Charm/Data.cpp
++++ Charm/Data.cpp
+@@ -18,7 +18,7 @@ const QIcon& Data::charmTrayIcon()
+     // On X11: pure-Qt apps get 22x22 from QSystemTrayIcon.
+     // KDE apps seem to get 24x24 in KSystemTrayIcon via KIconLoader, which is actually better.
+ 
+-#ifdef Q_OS_OSX
++#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
+     static const QString iconPath = QLatin1String(":/Charm/charmtray_mac.png");
+ #else
+     static const QString iconPath = QLatin1String(":/Charm/charmtray22.png");
+@@ -37,7 +37,7 @@ const QIcon& Data::charmTrayActiveIcon()
+     // On X11: pure-Qt apps get 22x22 from QSystemTrayIcon.
+     // KDE apps seem to get 24x24 in KSystemTrayIcon via KIconLoader, which is actually better.
+ 
+-#ifdef Q_OS_OSX
++#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
+     static const QString iconPath = QLatin1String(":/Charm/charmtrayactive_mac.png");
+ #else
+     static const QString iconPath = QLatin1String(":/Charm/charmtrayactive22.png");
+diff --git Charm/Idle/IdleDetector.cpp Charm/Idle/IdleDetector.cpp
+index 131e76e..47c575c 100644
+--- Charm/Idle/IdleDetector.cpp
++++ Charm/Idle/IdleDetector.cpp
+@@ -20,7 +20,7 @@ IdleDetector::IdleDetector( QObject* parent )
+ IdleDetector* IdleDetector::createIdleDetector( QObject* parent )
+ {
+ #ifdef CHARM_IDLE_DETECTION
+-#ifdef Q_OS_OSX
++#if defined(Q_OS_OSX) || defined(Q_OS_MAC)
+     return new MacIdleDetector( parent );
+ #endif
+ 
+diff --git Charm/Widgets/CharmWindow.cpp Charm/Widgets/CharmWindow.cpp
+index 375aedc..8bd7657 100644
+--- Charm/Widgets/CharmWindow.cpp
++++ Charm/Widgets/CharmWindow.cpp
+@@ -85,7 +85,7 @@ void CharmWindow::setWindowNumber( int number )
+     delete m_shortcut;
+     m_shortcut = new QShortcut( this );
+     QKeySequence sequence( tr( "Ctrl+%1" ).arg( number ) );
+-#ifdef Q_OS_OSX
++#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
+     m_shortcut->setKey( sequence );
+ #endif
+     m_shortcut->setContext( Qt::ApplicationShortcut );
+diff --git Charm/Widgets/EventView.cpp Charm/Widgets/EventView.cpp
+index 2fb9ef4..2eae8aa 100644
+--- Charm/Widgets/EventView.cpp
++++ Charm/Widgets/EventView.cpp
+@@ -96,7 +96,7 @@ EventView::EventView( QToolBar* toolBar, QWidget* parent )
+     m_actionDeleteEvent.setText( tr( "Delete Event..." ) );
+     QList<QKeySequence> deleteShortcuts;
+     deleteShortcuts << QKeySequence::Delete;
+-#ifdef Q_OS_OSX
++#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
+     deleteShortcuts << Qt::Key_Backspace;
+ #endif
+     m_actionDeleteEvent.setShortcuts(deleteShortcuts);

Added: trunk/dports/office/charm/files/patch-CMakeFiles.patch
===================================================================
--- trunk/dports/office/charm/files/patch-CMakeFiles.patch	                        (rev 0)
+++ trunk/dports/office/charm/files/patch-CMakeFiles.patch	2015-01-19 19:26:09 UTC (rev 131841)
@@ -0,0 +1,100 @@
+diff --git CMakeLists.txt CMakeLists.txt
+index 4e735a1..55f78bc 100644
+--- CMakeLists.txt
++++ CMakeLists.txt
+@@ -38,8 +38,10 @@ CMAKE_MINIMUM_REQUIRED( VERSION 2.6.0 )
+ SET( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake" )
+ SET( CMAKE_AUTOMOC ON )
+ 
+-# try Qt5 first, and prefer that if found
+-find_package(Qt5Core QUIET)
++if(NOT WITH_QT4)
++    # try Qt5 first, and prefer that if found
++    find_package(Qt5Core QUIET)
++endif()
+ IF (Qt5Core_FOUND)
+     find_package(Qt5Widgets REQUIRED)
+     find_package(Qt5Xml REQUIRED)
+@@ -61,11 +63,11 @@ IF (Qt5Core_FOUND)
+         SET(QT_PLATFORM_SPECIFIC_LIBRARIES)
+     ENDIF()
+ 
+-    IF(APPLE)
++#     IF(APPLE)
+         find_package(Qt5MacExtras REQUIRED)
+         include_directories(${Qt5MacExtras_INCLUDE_DIRS})
+         set(QT_PLATFORM_SPECIFIC_LIBRARIES ${Qt5MacExtras_LIBRARIES})
+-    ENDIF()
++#     ENDIF()
+ 
+     IF(NOT APPLE)
+         find_package(Qt5DBus)
+@@ -124,7 +126,7 @@ ELSE()
+ 
+     SET(CHARM_MAC_HIGHRES_SUPPORT_ENABLED OFF)
+ 
+-    IF(UNIX AND NOT APPLE)
++    IF(UNIX) # AND NOT APPLE)
+         find_package(Qt4 COMPONENTS QtDBus)
+         IF (QT_QTDBUS_FOUND)
+             set(HAVE_DBUS ON)
+@@ -197,8 +199,10 @@ IF( UNIX AND NOT APPLE )
+     SET( DOC_INSTALL_DIR share/doc/${Charm_EXECUTABLE} )
+ ELSE()
+     set( Charm_EXECUTABLE Charm )
+-    SET( BIN_INSTALL_DIR . )
+-    SET( DOC_INSTALL_DIR . )
++    if(NOT BIN_INSTALL_DIR)
++        SET( BIN_INSTALL_DIR . )
++    endif()
++    SET( DOC_INSTALL_DIR share/doc/${Charm_EXECUTABLE} )
+ ENDIF()
+ SET( ICONS_DIR "${CMAKE_SOURCE_DIR}/Charm/Icons" )
+ 
+@@ -223,9 +227,9 @@ CONFIGURE_FILE( CharmCMake.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/CharmCMake.h )
+ 
+ SET( LICENSE_FILE "License.txt" )
+ SET( README_FILE "ReadMe.txt" )
+-IF( NOT APPLE )
++#IF( NOT APPLE )
+     INSTALL( FILES "${LICENSE_FILE}" "${README_FILE}" DESTINATION ${DOC_INSTALL_DIR} )
+-ENDIF()
++#ENDIF()
+ 
+     # Only support CPack packaging on newer versions of CMake.
+ IF( NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.4" )
+@@ -252,7 +256,7 @@ IF( NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.4" )
+             "${README_FILE}" "Readme"
+         )
+         SET( CPACK_NSIS_MUI_FINISHPAGE_RUN "${CPACK_NSIS_INSTALLED_ICON_NAME}" )
+-    ELSEIF( APPLE )
++    ELSEIF( APPLENATIVE )
+         SET( CPACK_GENERATOR "DragNDrop" )
+         SET( CPACK_DMG_FORMAT "UDBZ" )
+         SET( CPACK_DMG_VOLUME_NAME "Charm" )
+diff --git Charm/CMakeLists.txt Charm/CMakeLists.txt
+index e11bae3..a9faff9 100644
+--- Charm/CMakeLists.txt
++++ Charm/CMakeLists.txt
+@@ -180,7 +180,7 @@ IF( WIN32 )
+ ENDIF()
+ MESSAGE( STATUS "Charm will be installed to ${CMAKE_INSTALL_PREFIX}" )
+ 
+-IF( UNIX AND NOT APPLE )
++IF( UNIX) # AND NOT APPLE )
+     SET( XDG_APPS_INSTALL_DIR share/applications )
+     INSTALL( FILES charmtimetracker.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+     INSTALL( FILES Icons/Charm-128x128.png DESTINATION share/icons/hicolor/128x128/apps )
+@@ -217,8 +217,8 @@ IF( NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.4" )
+                  DESTINATION ${BIN_INSTALL_DIR} )
+     ENDIF()
+ 
+-    IF( APPLE OR WIN32 )
+-        INCLUDE( DeployQt4 )
+-        INSTALL_QT4_EXECUTABLE( "${EXECUTABLE}" "qsqlite" )
+-    ENDIF()
++#     IF( APPLE OR WIN32 )
++#         INCLUDE( DeployQt4 )
++#         INSTALL_QT4_EXECUTABLE( "${EXECUTABLE}" "qsqlite" )
++#     ENDIF()
+ ENDIF()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150119/ca8f83f5/attachment-0001.html>


More information about the macports-changes mailing list