diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/CMake/packaging/CMakeLists.html texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/CMake/packaging/CMakeLists.html --- texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/CMake/packaging/CMakeLists.html 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/CMake/packaging/CMakeLists.html 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,151 @@ + + + + + + + + +
+
+ + +
+
+

CMake/packaging/CMakeLists.txt

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

CMake/packaging/CMakeLists.txt

+
+ + +
+

Packaging Tasks

+
+
+
+
+ + +
+

Create a CMake script containing packaging tasks specific to Apple. All +variables of the form @VARIABLE@ will be replaced, while variables of the +form ${VARIABLE} will be left untouched.

+
+
IF ( APPLE )
+  CONFIGURE_FILE(
+    ${PROJECT_SOURCE_DIR}/cmake/packaging/mac/MacPackagingTasks.cmake.in
+    ${PROJECT_BINARY_DIR}/CPackPackagingTasks.cmake
+    @ONLY
+  )
+ELSE ()
+
+
+ + +
+

Create a dummy script for other platforms.

+
+
  FILE(WRITE ${PROJECT_BINARY_DIR}/CPackPackagingTasks.cmake "")
+ENDIF ()
+
+
+ + +
+

Execute the packaging tasks. INSTALL(SCRIPT …) is used so that these tasks +executing during make install rather than make or cmake.

+ +
+
INSTALL(SCRIPT ${PROJECT_BINARY_DIR}/CPackPackagingTasks.cmake)
+
+
+ + + + + + + diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/CMake/packaging/mac/MacPackagingTasks.cmake.html texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/CMake/packaging/mac/MacPackagingTasks.cmake.html --- texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/CMake/packaging/mac/MacPackagingTasks.cmake.html 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/CMake/packaging/mac/MacPackagingTasks.cmake.html 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,403 @@ + + + + + + + + +
+
+ + +
+
+

CMake/packaging/mac/MacPackagingTasks.cmake.in

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

CMake/packaging/mac/MacPackagingTasks.cmake.in

+
+ + +
+

OS X packaging tasks

+
+
+
+
+ + +
+

This file is processed by CONFIGURE_FILE in ../CMakeLists.txt which inserts +values for @VARIABLE@ declarations. This is done to import values for some +variables that would otherwise be undefined when CPack is running.

+
+
SET(PROJECT_NAME @PROJECT_NAME@)
+SET(PROJECT_SOURCE_DIR @PROJECT_SOURCE_DIR@)
+SET(PROJECT_BINARY_DIR @PROJECT_BINARY_DIR@)
+SET(TeXworks_LIB_DIRS @TeXworks_LIB_DIRS@)
+SET(CMAKE_SHARED_LIBRARY_SUFFIX @CMAKE_SHARED_LIBRARY_SUFFIX@)
+SET(QT_PLUGINS @QT_PLUGINS@)
+
+
+ + +
+

This IF statement ensures that the following commands are executed only when +CPack is running—-i.e. when a user executes make package but not make install

+
+
IF ( ${CMAKE_INSTALL_PREFIX} MATCHES .*/_CPack_Packages/.* )
+
+
+ + +
+

Download and install Poppler data

+
+
  IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4.tar.gz )
+    MESSAGE(STATUS "Downloading Poppler data files")
+    FILE(DOWNLOAD "http://poppler.freedesktop.org/poppler-data-0.4.4.tar.gz"
+      ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4.tar.gz
+      EXPECTED_MD5 f3a1afa9218386b50ffd262c00b35b31
+      SHOW_PROGRESS
+    )
+  ENDIF ()
+
+  IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4 )
+    EXECUTE_PROCESS(COMMAND tar xzf ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4.tar.gz
+      WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    )
+  ENDIF ()
+
+  FILE(INSTALL ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4/
+    DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/poppler-data
+    PATTERN CMakeLists.txt EXCLUDE
+    PATTERN Makefile EXCLUDE
+  )
+
+
+ + +
+

Download and install TeXworks manual

+
+
  IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/TeXworks-manual-html-r814.zip )
+    MESSAGE(STATUS "Downloading TeXworks HTML manual")
+    FILE(DOWNLOAD "http://texworks.googlecode.com/files/TeXworks-manual-html-r814.zip"
+      ${PROJECT_SOURCE_DIR}/TeXworks-manual-html-r814.zip
+      EXPECTED_MD5 2894969a6ac4bba31953264e04553717
+      SHOW_PROGRESS
+    )
+  ENDIF ()
+
+  IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/TeXworks-manual )
+    EXECUTE_PROCESS(COMMAND unzip ${PROJECT_SOURCE_DIR}/TeXworks-manual-html-r814.zip
+      WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    )
+  ENDIF ()
+
+  FILE(INSTALL ${PROJECT_SOURCE_DIR}/TeXworks-manual
+    DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/texworks-help/
+  )
+
+
+ + +
+

Copy all runtime dependencies and rewrite loader paths

+
+
+
+
+ + +
+

Bring in DeployQt4 a CMake module taken from the Charm application:

+ +

https://github.com/KDAB/Charm

+ +

This module offers the FIXUP_QT4_BUNDLE function which wraps +FIXUP_BUNDLE from CMake’s BundleUtilities module and extends it with +additional Qt4-specific goodies—-such as installing Qt4 plugins.

+ +

FIXUP_BUNDLE is a wonderful function that examines an executable, finds +all non-system libraries it depends on, copies them into the .app bundle +and then re-writes the necessary loader paths.

+
+
  SET(CMAKE_MODULE_PATH @CMAKE_MODULE_PATH@)
+  INCLUDE(DeployQt4)
+
+
+ + +
+

Gather all TeXworks Plugin libraries.

+
+
  FILE(GLOB TeXworks_PLUGINS
+    ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/PlugIns/*${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+
+ + +
+

If BU_CHMOD_BUNDLE_ITEMS is not set, install_name_tool will fail to +re-write some loader paths due to insufficiant permissions.

+
+
  SET(BU_CHMOD_BUNDLE_ITEMS ON)
+
+  FIXUP_QT4_BUNDLE(${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app "${QT_PLUGINS}" "${TeXworks_PLUGINS}" "${TeXworks_LIB_DIRS}")
+
+
+ + +
+

Remove unecessary architectures from universal binaries

+
+
+
+
+ + +
+

Some libraries copied from the OS X system, such as X11 libraries, may +contain up to 4 different architectures. Here we will iterate over these +libraries and use lipo to strip out un-needed architectures.

+
+
+
+
+ + +
+

Another useful function from BundleUtilities.

+
+
  GET_BUNDLE_MAIN_EXECUTABLE(${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app APP_MAIN)
+
+
+ + +
+

We look at the TeXworks binary that was built rather than consulting the +value of the CMAKE_OSX_ARCHITECTURES because if the user did not set +CMAKE_OSX_ARCHITECTURES, then the variable will be an empty string and the +format of the resulting binary will depend on the versions of OS X and +XCode.

+
+
  MESSAGE(STATUS "Reducing the size of bundled libraries.")
+  MESSAGE(STATUS "Scanning architectures of: ${APP_MAIN}")
+  EXECUTE_PROCESS(
+
+
+ + +
+

lipo -info returns a list of the form:

+ +
<is universal binary?>: <program name>: <list of architectures>
+
+ +

Piping this output to cut -d : -f 3- allows us to extract just the list +of architectures.

+
+
    COMMAND lipo -info ${APP_MAIN}
+    COMMAND cut -d : -f 3-
+    OUTPUT_VARIABLE APP_ARCHS
+  )
+
+
+ + +
+

Strip leading and trailing whitespace.

+
+
  STRING(STRIP ${APP_ARCHS} APP_ARCHS)
+
+
+ + +
+

Convert spaces to semicolons so CMake will interpret the string as a list.

+
+
  STRING(REPLACE " " ";" APP_ARCHS ${APP_ARCHS})
+
+  MESSAGE(STATUS "Will reduce bundled libraries to: ${APP_ARCHS}")
+
+  FOREACH(ARCH IN LISTS APP_ARCHS)
+    SET(ARCHS_TO_EXTRACT "${ARCHS_TO_EXTRACT} -extract ${ARCH}")
+  ENDFOREACH ()
+
+
+ + +
+

NOTE: This will not process any dylibs from Frameworks copied by +FIXUP_BUNDLE, hence it may not touch any of the Qt libraries. Something to +fix in the future.

+
+
  FILE(GLOB BUNDLED_DYLIBS
+    ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/MacOS/*${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+  FOREACH(DYLIB IN LISTS BUNDLED_DYLIBS)
+    MESSAGE(STATUS "Processing included library: ${DYLIB}")
+
+
+ + +
+

lipo is very very anal about how arguments get passed to it. So we +execute through bash to side-step the issue.

+ +
+
    EXECUTE_PROCESS(COMMAND bash -c "lipo ${ARCHS_TO_EXTRACT} ${DYLIB} -output ${DYLIB}")
+  ENDFOREACH ()
+
+  MESSAGE(STATUS "Finished stripping architectures from bundled libraries.")
+
+ENDIF ()
+
+
+ + + + + + + diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/CMakeLists.html texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/CMakeLists.html --- texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/CMakeLists.html 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/CMakeLists.html 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,831 @@ + + + + + + + + +
+
+ + +
+
+

CMakeLists.txt

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

CMakeLists.txt

+
+ + +
+

Top-level build file for TeXworks, a simple editor for TeX and friends.

+ +

This buildsystem uses CMake and consists of the following files:

+ +
+  TeXworks
+  ├── CMakeLists.txt
+  ├── src
+  │   └── CMakeLists.txt
+  ├── plugins-src
+  │   ├── TWLuaPlugin
+  │   │   └── CMakeLists.txt
+  │   └── TWPythonPlugin
+  │       └── CMakeLists.txt
+  └── CMake
+      └── packaging
+          ├── CMakeLists.html
+          └── mac
+              └── MacPackagingTasks.cmake.in
+
+ +

Using CMake as a buildsystem offers some nice advantages:

+ +
    +
  • Supports component discovery and configuration for all three major +operating systems and can set TeXworks up to be built using GNU +Makefiles, XCode or Visual Studio.

  • +
  • Includes CPack, a tool which simplifies the task of packaging the +TeXworks app for release after it has been built. CPack can generate +Drag N' Drop installers for the Mac, Nullsoft installers for Windows and +.deb or .rpm packages for Linux.

  • +
+ +

Comments in the CMake files follow Markdown formatting conventions. +This convention allows the CMakeLists.txt files to be passed through a tool +such as Docco to create a nicely annotated README for the benefit of +future developers and maintainers.

+
+
+
+
+ + +
+

Setup and User Options

+
+
+
+
+ + +
+

Set project name.

+
+
PROJECT(TeXworks)
+
+
+ + +
+

We require CMake v2.8 or greater because it is the first version that +provides support for certain parts of Qt, such as the ScriptTools.

+
+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+SET(CMAKE_COLOR_MAKEFILE ON)
+
+
+ + +
+

Always add the current source and binary directories to the header include +path when compiling.

+
+
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+IF ( WIN32 )
+  MESSAGE( WARNING
+    "The CMake build system has only been tested on Mac OS X and Linux."
+    "\nIt probably won't work on Windows. Patches containing fixes are"
+    "\nwelcomed at:"
+    "\n  https://github.com/Sharpie/TeXworks"
+  )
+ENDIF ()
+
+
+ + +
+

Determine Version Numbers

+
+
+
+
+ + +
+

The values recovered here are used in the filenames of packaged builds and +influence parts of the application such as the “About” dialog.

+
+
+
+
+ + +
+

Recover canonical (x.y.z) version number from src/TWVersion.h.

+
+
FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_MAJOR REGEX "VER_MAJOR")
+STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_MAJOR ${TeXworks_VER_MAJOR})
+FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_MINOR REGEX "VER_MINOR")
+STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_MINOR ${TeXworks_VER_MINOR})
+FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_PATCH REGEX "VER_BUGFIX")
+STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_PATCH ${TeXworks_VER_PATCH})
+SET(TeXworks_VERSION ${TeXworks_VER_MAJOR}.${TeXworks_VER_MINOR}.${TeXworks_VER_PATCH})
+
+
+ + +
+

Recover SVN revision from src/SvnRev.h.

+
+
FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/SvnRev.h TeXworks_SVN_REV LIMIT_COUNT 1)
+STRING(REGEX MATCH "([0-9]+)" TeXworks_SVN_REV ${TeXworks_SVN_REV})
+
+
+ + +
+

Declare Project Options

+
+
+
+
+ + +
+

These are options that users can set at configure-time to determine how the +application is built and what functionalities it will have. Here we declare +these options by setting default values.

+
+
SET(TW_BUILD_ID "personal" CACHE STRING "A distribution-specific identifier for TeXworks")
+
+
+ + +
+

On UNIX, CMake installs to /usr/local by default. However, Mac users +will probably find /Applications a more convenient default.

+
+
IF( APPLE AND CMAKE_INSTALL_PREFIX MATCHES "/usr/local" )
+  SET( CMAKE_INSTALL_PREFIX "/Applications" )
+ENDIF()
+
+
+ + +
+

Do an optimized release build by default

+
+
IF ( NOT CMAKE_BUILD_TYPE )
+  SET(CMAKE_BUILD_TYPE "Release")
+ENDIF ()
+
+
+ + +
+

Options controlling the creation of scripting language plugins.

+
+
OPTION(WITH_LUA "Build TeXworks Lua plugin?" ON)
+OPTION(WITH_PYTHON "Build TeXworks Python plugin?" ON)
+
+
+ + +
+

On OS X we default to linking against the Python libraries provided by Apple +even if other Pythons are available. This helps when building +re-distributable .app packages. By disabling this option, a Mac user can +link against whatever Python they wish for a personal build.

+
+
IF ( APPLE )
+  OPTION(USE_SYSTEM_PYTHON "Link against Python Framework distributed with OS X?" ON)
+ENDIF ()
+
+
+ + +
+

Dependency Configuration

+
+
+
+
+ + +
+

Make the contents of CMake/Modules available. Among other things, this +directory contains scripts that locate project components such as Poppler.

+
+
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules ${CMAKE_MODULE_PATH})
+
+
+ + +
+

Declare Qt libraries required by this project.

+
+
SET (QT_COMPONENTS
+    QtCore
+    QtGui
+    QtUiTools
+    QtScript
+    QtScriptTools
+    QtXML
+)
+
+IF ( UNIX AND NOT APPLE )
+  LIST(APPEND QT_COMPONENTS QtDbus)
+ENDIF ()
+
+
+ + +
+

Locate Qt. INCLUDE(UseQt4) brings in a set of macros that helps us deal +with Qt-specific tasks such as compiling resources or running moc.

+
+
FIND_PACKAGE(Qt4 COMPONENTS ${QT_COMPONENTS} REQUIRED)
+INCLUDE(UseQt4)
+
+FIND_PACKAGE(ZLIB REQUIRED)
+FIND_PACKAGE(Hunspell REQUIRED)
+FIND_PACKAGE(Poppler REQUIRED)
+
+
+ + +
+

The only thing Poppler should need is the location of the include directories +in order to access header files. The library loader should be able to find +libfontconfig on standard search paths.

+
+
IF ( POPPLER_NEEDS_FONTCONFIG )
+  FIND_PACKAGE(Fontconfig REQUIRED)
+ENDIF ()
+
+
+ + +
+

Aggregate library names and include directories into variables for easy +access.

+
+
SET(TeXworks_INCLUDE_DIRS
+  ${QT_INCLUDE_DIR}
+  ${HUNSPELL_INCLUDE_DIR}
+  ${POPPLER_QT4_INCLUDE_DIR}
+  ${ZLIB_INCLUDE_DIR}
+)
+IF ( POPPLER_NEEDS_FONTCONFIG )
+  LIST(APPEND TeXworks_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR})
+ENDIF ()
+
+SET(TeXworks_LIB_DIRS ${QT_LIBRARY_DIR})
+
+SET(TeXworks_LIBS
+  ${QT_LIBRARIES}
+  ${POPPLER_LIBRARIES}
+  ${HUNSPELL_LIBRARIES}
+  ${ZLIB_LIBRARIES}
+)
+
+
+ + +
+

Configure Optional Dependencies

+
+
+
+
+ + +
+

CMake 2.8 has separate find scripts for Lua 5.1 and Lua 5.0. We assume that +the most recent Lua version is installed.

+
+
IF ( WITH_LUA )
+  FIND_PACKAGE(Lua51)
+ENDIF()
+
+IF ( WITH_PYTHON )
+  IF ( USE_SYSTEM_PYTHON )
+    SET(PYTHON_LIBRARIES "-F/System/Library/Frameworks -framework Python" CACHE PATH "Python library.")
+    SET(PYTHON_INCLUDE_DIR "/System/Library/Framework/Python.framework/Headers" CACHE PATH "Python framework.")
+    MARK_AS_ADVANCED(PYTHON_LIBRARIES)
+    MARK_AS_ADVANCED(PYTHON_INCLUDE_DIR)
+    SET(PYTHONLIBS_FOUND TRUE)
+  ELSE ()
+
+
+ + +
+

NOTE For some reason, FindPythonLibs.cmake always seems to default to +/System/Library/Frameworks/Python.framework/Headers as the include path +on OS X.

+
+
    FIND_PACKAGE(PythonLibs)
+  ENDIF ()
+ENDIF()
+
+
+ + +
+

Update Header Templates

+
+
+
+
+ + +
+

Some header files contain components that must be dynamically generated. For +example, getDefaultBinPaths.sh is a script that tries to figure out the +appropriate path to TeX binaries on UNIX-like systems.

+
+
IF ( UNIX )
+  IF ( NOT EXISTS ${TeXworks_SOURCE_DIR}/src/DefaultBinaryPaths.h )
+    MESSAGE(STATUS "Generating DefaultBinaryPaths.h")
+
+    EXECUTE_PROCESS(
+      COMMAND ${TeXworks_SOURCE_DIR}/getDefaultBinPaths.sh
+      WORKING_DIRECTORY ${TeXworks_SOURCE_DIR}
+    )
+  ENDIF ()
+ENDIF ()
+
+
+ + +
+

Building

+
+
+
+
+ + +
+

Build main TeXworks application

+
+
ADD_SUBDIRECTORY(src)
+
+
+ + +
+

Build Plugins

+
+
+
+
+ + +
+

Set the plugin installation path. This is a good default for UNIX-like +systems, but is not appropriate for Windows.

+
+
SET(TeXworks_PLUGIN_DIR lib)
+
+
+ + +
+

On OS X, the plugins should live inside the application bundle.

+
+
IF ( APPLE )
+  SET(TeXworks_PLUGIN_DIR ${PROJECT_NAME}.app/Contents/PlugIns)
+ENDIF ()
+
+
+ + +
+

Build scripting language plugins if the required libraries are available.

+
+
IF ( LUA51_FOUND )
+  ADD_SUBDIRECTORY(${TeXworks_SOURCE_DIR}/plugins-src/TWLuaPlugin)
+ENDIF ()
+
+IF ( PYTHONLIBS_FOUND )
+  ADD_SUBDIRECTORY(${TeXworks_SOURCE_DIR}/plugins-src/TWPythonPlugin)
+ENDIF ()
+
+
+ + +
+

Packaging

+
+
+
+
+ + +
+

This section is responsible for executing all tasks that run when a user +invokes cpack or make package after executing their platform’s equivalent +of of make. The packaging tasks are responsible for two things:

+ +
    +
  • Applying transformations to the compiled binaries such that they can be +distributed to another machine.

  • +
  • Gathering all binaries and libraries and packaging them into an archive +suitable for distribution such as a Windows installer or Mac disk image +file.

  • +
+
+
+
+
+ + +
+

Gather all libraries related to Qt plugins used by TeXworks so that they can +be bundled into packages.

+
+
SET(QT_PLUGINS
+  ${QT_QTACCESSIBLEWIDGETS_PLUGIN_RELEASE}
+  ${QT_QCNCODECS_PLUGIN_RELEASE}
+  ${QT_QJPCODECS_PLUGIN_RELEASE}
+  ${QT_QKRCODECS_PLUGIN_RELEASE}
+  ${QT_QTWCODECS_PLUGIN_RELEASE}
+  ${QT_QGIF_PLUGIN_RELEASE}
+  ${QT_QJPEG_PLUGIN_RELEASE}
+  ${QT_QTIFF_PLUGIN_RELEASE}
+)
+
+
+ + +
+

The file cmake/packaging/CMakeLists.txt controls the execution of tasks +specific to preparing binaries for packaging on a given platform. This script +is invoked via ADD_SUBDIRECTORY so that it executes after TeXworks and its +components are built and installed. You cannot fixup an application bundle +before it has been created…

+
+
ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/cmake/packaging)
+
+
+ + +
+

Set CPack variables.

+
+
SET(CPACK_PACKAGE_VERSION_MAJOR ${TeXworks_VER_MAJOR})
+SET(CPACK_PACKAGE_VERSION_MINOR ${TeXworks_VER_MINOR})
+SET(CPACK_PACKAGE_VERSION_PATCH ${TeXworks_VER_PATCH})
+SET(CPACK_PACKAGE_VERSION ${TeXworks_VERSION})
+
+SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
+SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}.${CPACK_PACKAGE_VERSION}-${TeXworks_SVN_REV}")
+
+
+ + +
+

Configure Drag N' Drop installer.

+
+
IF ( APPLE )
+  SET(MAC_PACK_BITS "${CMAKE_SOURCE_DIR}/cmake/packaging/mac")
+  SET(CPACK_GENERATOR DragNDrop)
+  SET( CPACK_DMG_BACKGROUND_IMAGE "${MAC_PACK_BITS}/texworks_dmg_background.png" )
+
+
+ + +
+

Configure an AppleScript for applying a nice window layout to Drag N' Drop disk +image.

+
+
  CONFIGURE_FILE( ${MAC_PACK_BITS}/set_dmg_layout.scpt.in
+    ${PROJECT_BINARY_DIR}/set_dmg_layout.scpt
+    @ONLY
+  )
+ENDIF ()
+
+INCLUDE(CPack)
+
+
+ + +
+

Summary

+
+
+
+
+ + +
+

This section displays a nice configuration summary for the user.

+
+
+
+
+ + +
+

These macros borrowed from the Poppler CMake scripts. They add some nice +formatting to configuration info.

+
+
MACRO(CONFIG_INFO what value)
+  STRING(LENGTH ${what} length_what)
+  MATH(EXPR left_char "35 - ${length_what}")
+  SET(blanks)
+  FOREACH(_i RANGE 1 ${left_char})
+    SET(blanks "${blanks} ")
+  ENDFOREACH()
+
+  MESSAGE("  ${what}:${blanks} ${value}")
+ENDMACRO()
+
+MACRO(CONFIG_YESNO what enabled)
+  IF(${enabled})
+    SET(enabled_string "yes")
+  ELSE(${enabled})
+    SET(enabled_string "no")
+  ENDIF()
+
+  CONFIG_INFO("${what}" "${enabled_string}")
+ENDMACRO()
+
+
+ + +
+

Print out configuration summary.

+ +
+
MESSAGE("TeXworks has been configured:\n")
+
+CONFIG_INFO("Version" ${TeXworks_VERSION})
+CONFIG_INFO("SVN Revision" ${TeXworks_SVN_REV})
+CONFIG_INFO("Build ID" ${TW_BUILD_ID})
+CONFIG_INFO("Compiler optimization" ${CMAKE_BUILD_TYPE})
+MESSAGE("")
+
+CONFIG_YESNO("Lua scripting plugin" LUA51_FOUND)
+CONFIG_YESNO("Python scripting plugin" PYTHONLIBS_FOUND)
+IF( APPLE )
+  CONFIG_YESNO("  OS X system python" USE_SYSTEM_PYTHON)
+ENDIF()
+MESSAGE("")
+
+MESSAGE("  TeXworks will be installed to:")
+MESSAGE("      ${CMAKE_INSTALL_PREFIX}")
+MESSAGE("")
+
+
+ + + + + + + diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/plugins-src/TWLuaPlugin/CMakeLists.html texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/plugins-src/TWLuaPlugin/CMakeLists.html --- texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/plugins-src/TWLuaPlugin/CMakeLists.html 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/plugins-src/TWLuaPlugin/CMakeLists.html 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,137 @@ + + + + + + + + +
+
+ + +
+
+

plugins-src/TWLuaPlugin/CMakeLists.txt

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + +

plugins-src/TWLuaPlugin/CMakeLists.txt

+
+ + +
+

Build Lua Plugin

+
+
INCLUDE_DIRECTORIES(
+  ${TeXworks_SOURCE_DIR}/src
+  ${QT_INCLUDE_DIR}
+  ${LUA_INCLUDE_DIR}
+)
+
+LINK_DIRECTORIES(${QT_LIBRARY_DIR})
+
+
+ + +
+

NOTE: Re-moccing headers from the main source directory that have +already been mocced during the build of the main program seems redundant, but +I’m not wise enough in the ways of Qt and CMake to figure out a good +alternative.

+ +
+
QT4_WRAP_CPP(LUA_PLUGIN_MOC ${TeXworks_SCRIPT_API_H} TWLuaPlugin.h)
+
+ADD_LIBRARY(TWLuaPlugin SHARED
+  TWLuaPlugin.cpp
+  ${TeXworks_SCRIPT_API}
+  ${LUA_PLUGIN_MOC}
+)
+TARGET_LINK_LIBRARIES(TWLuaPlugin ${QT_LIBRARIES} ${LUA_LIBRARIES})
+
+INSTALL(TARGETS TWLuaPlugin
+  LIBRARY DESTINATION ${TeXworks_PLUGIN_DIR}
+)
+
+
+ + + + + + + diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/plugins-src/TWPythonPlugin/CMakeLists.html texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/plugins-src/TWPythonPlugin/CMakeLists.html --- texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/plugins-src/TWPythonPlugin/CMakeLists.html 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/plugins-src/TWPythonPlugin/CMakeLists.html 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,137 @@ + + + + + + + + +
+
+ + +
+
+

plugins-src/TWPythonPlugin/CMakeLists.txt

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + +

plugins-src/TWPythonPlugin/CMakeLists.txt

+
+ + +
+

Build Python Plugin

+
+
INCLUDE_DIRECTORIES(
+  ${TeXworks_SOURCE_DIR}/src
+  ${QT_INCLUDE_DIR}
+  ${PYTHON_INCLUDE_DIRS}
+)
+
+LINK_DIRECTORIES(${QT_LIBRARY_DIR})
+
+
+ + +
+

NOTE: Re-moccing headers from the main source directory that have +already been mocced during the build of the main program seems redundant, but +I’m not wise enough in the ways of Qt and CMake to figure out an +alternative.

+ +
+
QT4_WRAP_CPP(PYTHON_PLUGIN_MOC ${TeXworks_SCRIPT_API_H} TWPythonPlugin.h)
+
+ADD_LIBRARY(TWPythonPlugin SHARED
+  TWPythonPlugin.cpp
+  ${TeXworks_SCRIPT_API}
+  ${PYTHON_PLUGIN_MOC}
+)
+TARGET_LINK_LIBRARIES(TWPythonPlugin ${QT_LIBRARIES} ${PYTHON_LIBRARIES})
+
+INSTALL(TARGETS TWPythonPlugin
+  LIBRARY DESTINATION ${TeXworks_PLUGIN_DIR}
+)
+
+
+ + + + + + + diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/src/CMakeLists.html texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/src/CMakeLists.html --- texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/src/CMakeLists.html 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/src/CMakeLists.html 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,428 @@ + + + + + + + + +
+
+ + +
+
+

src/CMakeLists.txt

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

src/CMakeLists.txt

+
+ + +
+

Build TeXworks

+
+
+
+
+ + +
+

Collect Source Files

+
+
+
+
+ + +
+

NOTE: A GLOB operation is quick, but may not be appropriate. It may be +better to maintain an explicit list of source files. Particularly, adding a +new file to an explicit list will cause CMake to automatically reconfigure +the next time make is invoked. When GLOB is used, the developer will have +to remember to re-run cmake if a source file is added.

+
+
FILE(GLOB TEXWORKS_SRCS       "*.cpp" "*.c")
+FILE(GLOB TEXWORKS_MOC_HDRS   "*.h")
+FILE(GLOB TEXWORKS_UIS        "*.ui")
+FILE(GLOB TEXWORKS_RCS        "${TeXworks_SOURCE_DIR}/res/*.qrc")
+FILE(GLOB TEXWORKS_TRANS      "${TeXworks_SOURCE_DIR}/trans/*.ts")
+
+
+ + +
+

These source files along with the .moc files generated from some headers +form the TeXworks scripting API. We export them to variables in the +PARENT_SCOPE (top level CMake file) so that they will be available to the +build processes of the scripting language plugins.

+
+
SET(TeXworks_SCRIPT_API
+  ${CMAKE_CURRENT_SOURCE_DIR}/TWScript.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/TWScriptAPI.cpp
+  PARENT_SCOPE
+)
+
+SET(TeXworks_SCRIPT_API_H
+  ${CMAKE_CURRENT_SOURCE_DIR}/TWScript.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/TWScriptAPI.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/TWSystemCmd.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/ConfigurableApp.h
+  PARENT_SCOPE
+)
+
+
+ + +
+

App Setup

+
+
+
+
+ + +
+

On OS X, set GUI type to an .app bundle, gather icon files and add core system +frameworks to the library link list.

+
+
IF ( APPLE )
+  SET(GUI_TYPE MACOSX_BUNDLE)
+
+  LIST(APPEND TeXworks_LIBS  "-framework CoreServices")
+
+  FILE(GLOB TeXworks_APP_ICONS ${TeXworks_SOURCE_DIR}/*.icns)
+  SET_SOURCE_FILES_PROPERTIES( ${TeXworks_APP_ICONS}
+    PROPERTIES
+      MACOSX_PACKAGE_LOCATION Resources
+  )
+ENDIF ()
+
+
+ + +
+

WARNING: Windows is untested

+
+
IF ( WIN32 )
+  SET(GUI_TYPE WIN32)
+ENDIF ()
+
+
+ + +
+

Make sure the compiler can find include files.

+
+
INCLUDE_DIRECTORIES(${TeXworks_INCLUDE_DIRS})
+
+
+ + +
+

Make sure the compiler can find library files.

+
+
LINK_DIRECTORIES(${TeXworks_LIB_DIRS})
+
+ADD_DEFINITIONS(-DTW_BUILD_ID=${TW_BUILD_ID})
+
+
+ + +
+

Poppler supports XPDF API calls?

+
+
IF (POPPLER_HAS_XPDF)
+  INCLUDE_DIRECTORIES(${POPPLER_XPDF_INCLUDE_DIR})
+  ADD_DEFINITIONS(-DHAVE_POPPLER_XPDF_HEADERS)
+ENDIF ()
+
+
+ + +
+

Qt-Specific Source Code Processing

+
+
+
+
+ + +
+

Run moc on header files.

+
+
QT4_WRAP_CPP(TEXWORKS_GEN_MOC ${TEXWORKS_MOC_HDRS})
+
+
+ + +
+

Run uic on user interface files.

+
+
QT4_WRAP_UI(TEXWORKS_GEN_UI ${TEXWORKS_UIS})
+
+
+ + +
+

Run rcc on reasource files.

+
+
QT4_ADD_RESOURCES(TEXWORKS_GEN_RCS ${TEXWORKS_RCS})
+
+
+ + +
+

Prep language translations.

+
+
QT4_ADD_TRANSLATION(TEXWORKS_GEN_TRANS ${TEXWORKS_TRANS})
+
+IF ( APPLE OR NOT UNIX )
+  SET(EXE_NAME TeXworks)
+ELSE ( APPLE OR NOT UNIX )
+  SET(EXE_NAME texworks)
+ENDIF ( APPLE OR NOT UNIX )
+
+
+ + +
+

Compilation

+
+
+
+
+ + +
+

Build the executible.

+
+
ADD_EXECUTABLE( ${EXE_NAME} ${GUI_TYPE}
+  ${TEXWORKS_SRCS}
+  ${TEXWORKS_GEN_MOC} ${TEXWORKS_GEN_UI} ${TEXWORKS_GEN_RCS} ${TEXWORKS_GEN_TRANS}
+  ${TeXworks_APP_ICONS}
+)
+
+
+ + +
+

Specify libraries to be linked to TeXworks.

+
+
TARGET_LINK_LIBRARIES( ${EXE_NAME} ${TeXworks_LIBS} )
+
+
+ + +
+

For OS X, generate Info.plist and add it to the .app bundle.

+
+
IF (APPLE)
+  SET(VER ${TeXworks_VERSION})
+  SET(REV ${TeXworks_SVN_REV})
+  CONFIGURE_FILE(${TeXworks_SOURCE_DIR}/TeXworks.plist.in
+    ${TeXworks_SOURCE_DIR}/TeXworks.plist
+    @ONLY
+  )
+
+  SET_TARGET_PROPERTIES( TeXworks PROPERTIES
+    MACOSX_BUNDLE_INFO_PLIST
+      ${TeXworks_SOURCE_DIR}/TeXworks.plist
+  )
+ENDIF ()
+
+
+ + +
+

Installation

+
+
INSTALL( TARGETS ${EXE_NAME}
+  RUNTIME DESTINATION bin COMPONENT
+  BUNDLE DESTINATION . COMPONENT
+)
+
+
+ + +
+

On OS X, ensure there is always a qt.conf file as all hell will break loose +if one isn’t there. This may need to be customized for use on non-Apple +systems.

+ +

Protip: If there are wierd errors like “Qt libraries loaded twice” or +“looking for a tablet device”, then something may have gone pear shaped with +qt.conf.

+ +
+
IF ( APPLE )
+  SET(QTCONF_DIR ${PROJECT_NAME}.app/Contents/Resources)
+  SET(QTCONF_CONTENTS "[Paths]\nPlugins = PlugIns")
+
+  INSTALL( CODE
+    "
+    FILE(WRITE \"\${CMAKE_INSTALL_PREFIX}/${QTCONF_DIR}/qt.conf\"
+      \"${QTCONF_CONTENTS}\"
+    )
+    "
+  )
+ENDIF()
+
+
+ + + + + + + diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/html/index.html texworks-0.4.4~svn1004~natty1/CMake/docs/html/index.html --- texworks-0.4.3~svn858~natty1/CMake/docs/html/index.html 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/html/index.html 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,12 @@ + + + + TeXworks CMake Documentation + + + + +

This page should redirect to docs/CMakeLists.html. If it does not, the link should work.

+ + diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/html/resources/docs.css texworks-0.4.4~svn1004~natty1/CMake/docs/html/resources/docs.css --- texworks-0.4.3~svn858~natty1/CMake/docs/html/resources/docs.css 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/html/resources/docs.css 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,305 @@ +/*--------------------- Layout and Typography ----------------------------*/ +body { + font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; + font-size: 15px; + line-height: 22px; + color: #252519; + margin: 0; padding: 0; +} +a { + color: #261a3b; +} + a:visited { + color: #261a3b; + } +p { + margin: 0 0 15px 0; +} +h1, h2, h3, h4, h5, h6 { + margin: 0px 0 15px 0; +} +#container { + position: relative; +} +#background { + position: fixed; + top: 0; left: 525px; right: 0; bottom: 0; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + z-index: -1; +} +table { + margin-top: 100px; +} +thead tr { + display: none; +} +table td { + border: 0; + outline: 0; +} + td.docs, th.docs { + max-width: 450px; + min-width: 450px; + min-height: 5px; + padding: 10px 25px 1px 50px; + overflow-x: hidden; + vertical-align: top; + text-align: left; + } + .docs pre { + margin: 15px 0 15px; + padding-left: 15px; + } + .docs p tt, .docs p code { + background: #f8f8ff; + border: 1px solid #dedede; + font-size: 12px; + padding: 0 0.2em; + } + .pilwrap { + position: relative; + } + .pilcrow { + font: 12px Arial; + text-decoration: none; + color: #454545; + position: absolute; + top: 3px; left: -20px; + padding: 1px 2px; + opacity: 0; + -webkit-transition: opacity 0.2s linear; + } + td.docs:hover .pilcrow { + opacity: 1; + } + td.code, th.code { + padding: 14px 15px 16px 25px; + width: 100%; + vertical-align: top; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + } + pre, tt, code { + font-size: 12px; line-height: 18px; + font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; + margin: 0; padding: 0; + } + +/*---------------------- Navbar: Cribbed from Coffee-Script -----------------------------*/ +.bookmark { + display: block; + width: 0; height: 0; + position: relative; + top: -100px; +} + +#fadeout { + z-index: 50; + position: fixed; + left: 0; top: 0; right: 0; + height: 100px; + background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 255)), to(rgba(255, 255, 255, 0))); + background: -moz-linear-gradient(top, rgba(255, 255, 255, 255), rgba(255, 255, 255, 0)); +} + +#flybar { + position: fixed; + z-index: 100; + height: 50px; + min-width: 600px; + left: 40px; right: 40px; top: 25px; + padding-left: 250px; + background: #eee; + background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#dadada)); + background: -moz-linear-gradient(top, #f8f8f8, #dadada); + border: 1px solid #aaa; + border-top: 1px solid #bbb; + border-bottom: 1px solid #888; + -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; + -webkit-box-shadow: 0 3px 5px rgba(0,0,0,0.1); + -moz-box-shadow: 0 3px 5px rgba(0,0,0,0.1); + box-shadow: 0 3px 5px rgba(0,0,0,0.1); +} + #title { + height: 50px; + line-height: 50px; + text-decoration: none; + top: 0px; left: 10px; + padding: 0px; + position: absolute; + } + #title h1 { + margin: 0px; + display: inline; + } + #error { + position: absolute; + -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; + -webkit-border-top-left-radius: 0; -moz-border-radius-topleft: 0; border-top-left-radius: 0; + -webkit-border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; border-bottom-left-radius: 0; + right: 0px; top: 0px; left: 726px; bottom: 0; + padding: 0 0 0 15px; + background: #fdcdcc; + background: -webkit-gradient(linear, left top, left bottom, from(#ffedec), to(#ff9a95)); + background: -moz-linear-gradient(top, #f8f8f8, #dadada); + color: #862322; + font-size: 10px; + line-height: 50px; + overflow: hidden; + text-transform: uppercase; + } + .navigation { + height: 30px; + line-height: 30px; + text-transform: uppercase; + position: relative; + padding: 0px 20px; + margin-top: 10px; + border: 1px solid #aaa; + cursor: pointer; + } + .navigation.about { + float: right; + margin-right: 260px; + } + .navigation.toc { + float: right; + margin-right: 30px; + } + .navigation:hover, + .navigation.active { + background: #eee; + background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#f8f8f8)); + background: -moz-linear-gradient(top, #eee, #f8f8f8); + } + .navigation.active { + height: 51px; + color: #000; + background: -webkit-gradient(linear, left top, left bottom, from(#e5e5e5), to(#fff)); + background: -moz-linear-gradient(top, #e5e5e5, #fff); + } + .navigation .button { + font-weight: bold; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -o-user-select: none; + user-select: none; + } + .navigation .button::selection { + background: transparent; + } + .navigation .contents { + display: none; + position: absolute; + background: #fff; + opacity: 0.97; + top: 40px; left: 0; + padding: 5px 0; + margin-left: -1px; + border: 1px solid #aaa; + border-top: 0; + -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; + -webkit-border-top-left-radius: 0; -moz-border-radius-topleft: 0; border-top-left-radius: 0; + -webkit-border-top-right-radius: 0; -moz-border-radius-topright: 0; border-top-right-radius: 0; + -webkit-box-shadow: 0 3px 5px rgba(0,0,0,0.2); + -moz-box-shadow: 0 3px 5px rgba(0,0,0,0.2); + box-shadow: 0 3px 5px rgba(0,0,0,0.2); + } + .navigation .contents p { + width: 335px; + display: block; + text-transform: none; + margin: 0px; + padding: 4px 10px; + border: 1px solid transparent; + border-left: 0; border-right: 0; + } + .navigation.about .contents a { + display: block; + text-transform: none; + padding: 4px 20px; + border: 1px solid transparent; + border-left: 0; border-right: 0; + } + .navigation .contents.menu a { + display: block; + text-transform: none; + text-decoration: none; + padding: 4px 10px; + border: 1px solid transparent; + border-left: 0; border-right: 0; + } + .navigation .contents.menu a:hover { + border-color: #ddd; + background: #eee; + } + .navigation.active .contents { + display: block; + } + +/*---------------------- Syntax Highlighting -----------------------------*/ +td.linenos { background-color: #f0f0f0; padding-right: 10px; } +span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } +body .hll { background-color: #ffffcc } +body .c { color: #408080; font-style: italic } /* Comment */ +body .err { border: 1px solid #FF0000 } /* Error */ +body .k { color: #954121 } /* Keyword */ +body .o { color: #666666 } /* Operator */ +body .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +body .cp { color: #BC7A00 } /* Comment.Preproc */ +body .c1 { color: #408080; font-style: italic } /* Comment.Single */ +body .cs { color: #408080; font-style: italic } /* Comment.Special */ +body .gd { color: #A00000 } /* Generic.Deleted */ +body .ge { font-style: italic } /* Generic.Emph */ +body .gr { color: #FF0000 } /* Generic.Error */ +body .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +body .gi { color: #00A000 } /* Generic.Inserted */ +body .go { color: #808080 } /* Generic.Output */ +body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +body .gs { font-weight: bold } /* Generic.Strong */ +body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +body .gt { color: #0040D0 } /* Generic.Traceback */ +body .kc { color: #954121 } /* Keyword.Constant */ +body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */ +body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */ +body .kp { color: #954121 } /* Keyword.Pseudo */ +body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */ +body .kt { color: #B00040 } /* Keyword.Type */ +body .m { color: #666666 } /* Literal.Number */ +body .s { color: #219161 } /* Literal.String */ +body .na { color: #7D9029 } /* Name.Attribute */ +body .nb { color: #954121 } /* Name.Builtin */ +body .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +body .no { color: #880000 } /* Name.Constant */ +body .nd { color: #AA22FF } /* Name.Decorator */ +body .ni { color: #999999; font-weight: bold } /* Name.Entity */ +body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +body .nf { color: #0000FF } /* Name.Function */ +body .nl { color: #A0A000 } /* Name.Label */ +body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +body .nt { color: #954121; font-weight: bold } /* Name.Tag */ +body .nv { color: #19469D } /* Name.Variable */ +body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +body .w { color: #bbbbbb } /* Text.Whitespace */ +body .mf { color: #666666 } /* Literal.Number.Float */ +body .mh { color: #666666 } /* Literal.Number.Hex */ +body .mi { color: #666666 } /* Literal.Number.Integer */ +body .mo { color: #666666 } /* Literal.Number.Oct */ +body .sb { color: #219161 } /* Literal.String.Backtick */ +body .sc { color: #219161 } /* Literal.String.Char */ +body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */ +body .s2 { color: #219161 } /* Literal.String.Double */ +body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +body .sh { color: #219161 } /* Literal.String.Heredoc */ +body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +body .sx { color: #954121 } /* Literal.String.Other */ +body .sr { color: #BB6688 } /* Literal.String.Regex */ +body .s1 { color: #219161 } /* Literal.String.Single */ +body .ss { color: #19469D } /* Literal.String.Symbol */ +body .bp { color: #954121 } /* Name.Builtin.Pseudo */ +body .vc { color: #19469D } /* Name.Variable.Class */ +body .vg { color: #19469D } /* Name.Variable.Global */ +body .vi { color: #19469D } /* Name.Variable.Instance */ +body .il { color: #666666 } /* Literal.Number.Integer.Long */ diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/layout.mustache texworks-0.4.4~svn1004~natty1/CMake/docs/layout.mustache --- texworks-0.4.3~svn858~natty1/CMake/docs/layout.mustache 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/layout.mustache 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,105 @@ + + + + + {{ url }} + + + +
+
+ + +
+
+

{{ file }}

+ + + + {{#sources?}} + + {{/sources?}} + +
+ + + + + + + + + + + + + {{#sections}} + + + + + {{/sections}} +

{{ file }}

+
+ + +
+ {{{ docs }}} +
+
{{{ code }}}
+
+
+ + + + + + + diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/Rakefile texworks-0.4.4~svn1004~natty1/CMake/docs/Rakefile --- texworks-0.4.3~svn858~natty1/CMake/docs/Rakefile 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/Rakefile 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,32 @@ +# Simple Rakefile for generating documentation from the CMake buildsystem using +# Rocco: +# +# http://rtomayko.github.com/rocco +# +require 'pathname' +require 'rocco/tasks' # Not used, but serves as a good test that Rocco is installed + +# Run everything from the project root directory +DOC_DIR = Pathname.new(__FILE__).realpath.dirname +ROOT_DIR = DOC_DIR.join '../..' +Dir.chdir ROOT_DIR + +# Gather all CMake files +CMAKE_FILES = Dir['**/CMakeLists.txt'] + Dir['**/*.cmake.in'] + +# Generate documentation from comments in CMake files +task :docs do + system 'rocco', + '--language=cmake', + "--output=#{DOC_DIR + 'html' + 'docs'}", + "--template=#{DOC_DIR + 'layout.mustache'}", + *CMAKE_FILES +end + +# Make doc generation the default task +task :default => :docs + +# Generate documentation and then view it +task :view => [:docs] do + exec "open #{DOC_DIR + 'html' + 'index.html'}" +end diff -Nru texworks-0.4.3~svn858~natty1/CMake/Modules/COPYING-CMAKE-MODULES texworks-0.4.4~svn1004~natty1/CMake/Modules/COPYING-CMAKE-MODULES --- texworks-0.4.3~svn858~natty1/CMake/Modules/COPYING-CMAKE-MODULES 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/Modules/COPYING-CMAKE-MODULES 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,23 @@ +Unless noted otherwise, all files in this directory and are released under the +following terms: + + +Copyright (C) 2011-2012 Charlie Sharpsteen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -Nru texworks-0.4.3~svn858~natty1/CMake/Modules/DeployQt4.cmake texworks-0.4.4~svn1004~natty1/CMake/Modules/DeployQt4.cmake --- texworks-0.4.3~svn858~natty1/CMake/Modules/DeployQt4.cmake 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/Modules/DeployQt4.cmake 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,102 @@ +# - Functions to help assemble a standalone Qt4 application. +# A collection of CMake utility functions useful for deploying +# Qt4 applications. +# +# The following functions are provided by this module: +# fixup_qt4_bundle +# install_qt4_app +# Requires CMake 2.6 or greater and depends on BundleUtilities.cmake. +# +# FIXUP_QT4_BUNDLE( [ ]) +# Copies Qt plugins, writes a Qt configuration file (if needed) and fixes up a +# Qt4 executable using BundleUtilities. +# +# INSTALL_QT4_APP( [ ]) +# Installs plugins, writes a Qt configuration file (if needed) and fixes up a +# Qt4 executable using BundleUtilties. + +#============================================================================= +# Copyright 2011 KDAB +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= + +# The functions defined in this file depend on the fixup_bundle function +# (and possibly others) found in BundleUtilities.cmake +# +get_filename_component(DeployQt4_cmake_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) +include(BundleUtilities) + +function(fixup_qt4_bundle app qtplugins) + set(libs ${ARGV2}) + set(dirs ${ARGV3}) + + message(STATUS "fixup_qt4_bundle") + message(STATUS " app='${app}'") + message(STATUS " qtplugins='${qtplugins}'") + message(STATUS " libs='${libs}'") + message(STATUS " dirs='${dirs}'") + + if(APPLE) + set(plugins_dir "PlugIns") + set(plugins_path "${app}/Contents/${plugins_dir}") + set(qt_conf_dir "${app}/Contents/Resources") + set(write_qt_conf 1) + else() + set(plugins_dir "plugins") + get_filename_component(app_path "${app}" PATH) + set(plugins_path "${app_path}/${plugins_dir}") + set(qt_conf_dir "") + set(write_qt_conf 0) + endif() + + foreach(plugin ${qtplugins}) + if(EXISTS ${plugin}) + set(plugin_group "") + + get_filename_component(plugin_path "${plugin}" PATH) + get_filename_component(plugin_parent_path "${plugin_path}" PATH) + get_filename_component(plugin_parent_dir_name "${plugin_parent_path}" NAME) + get_filename_component(plugin_name "${plugin}" NAME) + string(TOLOWER "${plugin_parent_dir_name}" plugin_parent_dir_name) + + if("${plugin_parent_dir_name}" STREQUAL "plugins") + get_filename_component(plugin_group "${plugin_path}" NAME) + message(STATUS "Matched ${plugin_name} to plugin group ${plugin_group}") + endif() + + set(plugin_path "${plugins_path}/${plugin_group}") + message(STATUS "Copying ${plugin_name} to ${plugin_path}") + file(MAKE_DIRECTORY "${plugin_path}") + file(COPY "${plugin}" DESTINATION "${plugin_path}") + + list(APPEND libs "${plugin_path}/${plugin_name}") + else() + message(FATAL_ERROR "Plugin ${plugin} not found") + endif() + endforeach() + + if(qtplugins AND write_qt_conf) + set(qt_conf_path "${qt_conf_dir}/qt.conf") + set(qt_conf_contents "[Paths]\nPlugins = ${plugins_dir}") + message(STATUS "Writing to ${qt_conf_dir}/qt.conf:\n${qt_conf_contents}") + file(WRITE "${qt_conf_path}" "${qt_conf_contents}") + endif() + + fixup_bundle("${app}" "${libs}" "${dirs}") +endfunction(fixup_qt4_bundle) + +function(install_qt4_app executable qtplugins) + set(libs ${ARGV2}) + set(dirs ${ARGV3}) + install(CODE +" INCLUDE( \"${CMAKE_MODULE_PATH}/DeployQt4.cmake\" ) + SET( BU_CHMOD_BUNDLE_ITEMS TRUE ) + FIXUP_QT4_BUNDLE( \"\${CMAKE_INSTALL_PREFIX}/${executable}\" \"${qtplugins}\" \"${libs}\" \"${dirs}\" ) " + ) +endfunction(install_qt4_app) \ No newline at end of file diff -Nru texworks-0.4.3~svn858~natty1/CMake/Modules/FindFontconfig.cmake texworks-0.4.4~svn1004~natty1/CMake/Modules/FindFontconfig.cmake --- texworks-0.4.3~svn858~natty1/CMake/Modules/FindFontconfig.cmake 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/Modules/FindFontconfig.cmake 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,51 @@ +# - Try to find Fontconfig +# Once done this will define +# +# FONTCONFIG_FOUND - system has Fontconfig +# FONTCONFIG_INCLUDE_DIR - the Fontconfig include directory +# FONTCONFIG_LIBRARIES - Link these to use Fontconfig +# +# Redistribution and use of this file is allowed according to the terms of the +# MIT license. For details see the file COPYING-CMAKE-MODULES. + + +if ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARIES ) + # in cache already + SET(Fontconfig_FIND_QUIETLY TRUE) +endif ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARIES ) + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +if( NOT WIN32 ) + find_package(PkgConfig) + + pkg_check_modules(FONTCONFIG_PKG QUIET fontconfig) +endif( NOT WIN32 ) + +FIND_PATH(FONTCONFIG_INCLUDE_DIR NAMES fontconfig/fontconfig.h + PATHS + /usr/local/include + /usr/X11/include + /usr/include + HINTS + ${FONTCONFIG_PKG_INCLUDE_DIRS} # Generated by pkg-config +) + +FIND_LIBRARY(FONTCONFIG_LIBRARIES NAMES fontconfig ${FONTCONFIG_PKG_LIBRARIES} + PATHS + /usr/local + /usr/X11 + /usr + HINTS + ${FONTCONFIG_PKG_LIBRARY_DIRS} # Generated by pkg-config + PATH_SUFFIXES + lib64 + lib +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR ) + +# show the FONTCONFIG_INCLUDE_DIR and FONTCONFIG_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIBRARIES ) + diff -Nru texworks-0.4.3~svn858~natty1/CMake/Modules/FindHunspell.cmake texworks-0.4.4~svn1004~natty1/CMake/Modules/FindHunspell.cmake --- texworks-0.4.3~svn858~natty1/CMake/Modules/FindHunspell.cmake 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/Modules/FindHunspell.cmake 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,50 @@ +# - Try to find Hunspell +# Once done this will define +# +# HUNSPELL_FOUND - system has Hunspell +# HUNSPELL_INCLUDE_DIR - the Hunspell include directory +# HUNSPELL_LIBRARIES - Link these to use Hunspell +# +# Redistribution and use of this file is allowed according to the terms of the +# MIT license. For details see the file COPYING-CMAKE-MODULES. + + +if ( HUNSPELL_INCLUDE_DIR AND HUNSPELL_LIBRARIES ) + # in cache already + SET(Hunspell_FIND_QUIETLY TRUE) +endif ( HUNSPELL_INCLUDE_DIR AND HUNSPELL_LIBRARIES ) + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +if( NOT WIN32 ) + find_package(PkgConfig) + + pkg_check_modules(HUNSPELL_PKG QUIET hunspell) +endif( NOT WIN32 ) + +FIND_PATH(HUNSPELL_INCLUDE_DIR NAMES hunspell.h + PATHS + /usr/local/include + /usr/include + HINTS + ${HUNSPELL_PKG_INCLUDE_DIRS} # Generated by pkg-config + PATH_SUFFIXES hunspell +) + +FIND_LIBRARY(HUNSPELL_LIBRARIES NAMES hunspell-1.3 hunspell-1.2 hunspell ${HUNSPELL_PKG_LIBRARIES} + PATHS + /usr/local + /usr + HINTS + ${HUNSPELL_PKG_LIBRARY_DIRS} # Generated by pkg-config + PATH_SUFFIXES + lib64 + lib +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Hunspell DEFAULT_MSG HUNSPELL_LIBRARIES HUNSPELL_INCLUDE_DIR ) + +# show the HUNSPELL_INCLUDE_DIR and HUNSPELL_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(HUNSPELL_INCLUDE_DIR HUNSPELL_LIBRARIES ) + diff -Nru texworks-0.4.3~svn858~natty1/CMake/Modules/FindPoppler.cmake texworks-0.4.4~svn1004~natty1/CMake/Modules/FindPoppler.cmake --- texworks-0.4.3~svn858~natty1/CMake/Modules/FindPoppler.cmake 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/Modules/FindPoppler.cmake 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,118 @@ +# - Try to find Poppler and Poppler-Qt4 +# Once done this will define +# +# POPPLER_FOUND - system has Poppler and Poppler-Qt4 +# POPPLER_HAS_XPDF - A boolean indicating if Poppler XPDF headers are available +# POPPLER_NEEDS_FONTCONFIG - A boolean indicating if libpoppler depends on libfontconfig +# POPPLER_XPDF_INCLUDE_DIR - the include directory for Poppler XPDF headers +# POPPLER_QT4_INCLUDE_DIR - the include directory for Poppler-Qt4 headers +# POPPLER_QT4_LIBRARIES - Link this to use only libpoppler-Qt4 +# POPPLER_LIBRARIES - Link these to use Poppler and Poppler-Qt4 +# +# Note: the Poppler-cpp include directory is currently not needed by TeXworks +# +# Redistribution and use of this file is allowed according to the terms of the +# MIT license. For details see the file COPYING-CMAKE-MODULES. + +if ( POPPLER_LIBRARIES ) + # in cache already + SET(Poppler_FIND_QUIETLY TRUE) +endif ( POPPLER_LIBRARIES ) + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +if( NOT WIN32 ) + find_package(PkgConfig) + + pkg_check_modules(POPPLER_PKG QUIET poppler) + pkg_check_modules(POPPLER_QT4_PKG QUIET poppler-qt4) +endif( NOT WIN32 ) + +# Check for Poppler XPDF headers (optional) +FIND_PATH(POPPLER_XPDF_INCLUDE_DIR NAMES poppler-config.h + PATHS + /usr/local/include + /usr/include + HINTS + ${POPPLER_PKG_INCLUDE_DIRS} # Generated by pkg-config + PATH_SUFFIXES + poppler +) + +IF( NOT(POPPLER_XPDF_INCLUDE_DIR) ) + + MESSAGE( STATUS "Could not find poppler-config.h, disabling support for Xpdf headers." ) + + SET( POPPLER_HAS_XPDF false ) + +ELSE( NOT(POPPLER_XPDF_INCLUDE_DIR) ) + + SET( POPPLER_HAS_XPDF true ) + +ENDIF( NOT(POPPLER_XPDF_INCLUDE_DIR) ) + +# Find libpoppler, libpoppler-qt4 and associated header files (Required) +FIND_LIBRARY(POPPLER_LIBRARIES NAMES poppler ${POPPLER_PKG_LIBRARIES} + PATHS + /usr/local + /usr + HINTS + ${POPPLER_PKG_LIBRARY_DIRS} # Generated by pkg-config + PATH_SUFFIXES + lib64 + lib +) +IF ( NOT(POPPLER_LIBRARIES) ) + MESSAGE(STATUS "Could not find libpoppler." ) +ENDIF () + +# Scan poppler libraries for dependencies on Fontconfig +INCLUDE(GetPrerequisites) +MARK_AS_ADVANCED(gp_cmd) +GET_PREREQUISITES("${POPPLER_LIBRARIES}" POPPLER_PREREQS TRUE FALSE "" "") +IF ("${POPPLER_PREREQS}" MATCHES "fontconfig") + SET(POPPLER_NEEDS_FONTCONFIG TRUE) +ELSE () + SET(POPPLER_NEEDS_FONTCONFIG FALSE) +ENDIF () + + +FIND_PATH(POPPLER_QT4_INCLUDE_DIR NAMES poppler-qt4.h poppler-link.h + PATHS + /usr/local/include + /usr/include + HINTS + ${POPPLER_QT4_PKG_INCLUDE_DIRS} # Generated by pkg-config + PATH_SUFFIXES + poppler + qt4 + poppler/qt4 +) +IF ( NOT(POPPLER_QT4_INCLUDE_DIR) ) + MESSAGE(STATUS "Could not find Poppler-Qt4 headers." ) +ENDIF () + +FIND_LIBRARY(POPPLER_QT4_LIBRARIES NAMES poppler-qt4 ${POPPLER_QT4_PKG_LIBRARIES} + PATHS + /usr/local + /usr + HINTS + ${POPPLER_PKG_LIBRARY_DIRS} # Generated by pkg-config + PATH_SUFFIXES + lib64 + lib +) +MARK_AS_ADVANCED(POPPLER_QT4_LIBRARIES) +IF ( NOT(POPPLER_QT4_LIBRARIES) ) + MESSAGE(STATUS "Could not find libpoppler-qt4." ) +ENDIF () +LIST(APPEND POPPLER_LIBRARIES ${POPPLER_QT4_LIBRARIES}) + + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Poppler DEFAULT_MSG POPPLER_LIBRARIES POPPLER_QT4_INCLUDE_DIR ) + + +# show the POPPLER_(XPDF/QT4)_INCLUDE_DIR and POPPLER_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(POPPLER_XPDF_INCLUDE_DIR POPPLER_QT4_INCLUDE_DIR POPPLER_LIBRARIES) + diff -Nru texworks-0.4.3~svn858~natty1/CMake/NOTES texworks-0.4.4~svn1004~natty1/CMake/NOTES --- texworks-0.4.3~svn858~natty1/CMake/NOTES 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/NOTES 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,11 @@ +On locating system libraries: + + http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries + + KDE's generate_findpackage_file script was used to create skeletons for many + of the Find*.cmake files in the Modules folder + + +On getting things into their proper places in Mac App bundles: + + http://www.vtk.org/Wiki/CMake:Bundles_And_Frameworks diff -Nru texworks-0.4.3~svn858~natty1/CMake/packaging/CMakeLists.txt texworks-0.4.4~svn1004~natty1/CMake/packaging/CMakeLists.txt --- texworks-0.4.3~svn858~natty1/CMake/packaging/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/packaging/CMakeLists.txt 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,21 @@ +# Packaging Tasks +# =============== + +# Create a CMake script containing packaging tasks specific to Apple. All +# variables of the form `@VARIABLE@` will be replaced, while variables of the +# form `${VARIABLE}` will be left untouched. +IF ( APPLE ) + CONFIGURE_FILE( + ${PROJECT_SOURCE_DIR}/cmake/packaging/mac/MacPackagingTasks.cmake.in + ${PROJECT_BINARY_DIR}/CPackPackagingTasks.cmake + @ONLY + ) +ELSE () + # Create a dummy script for other platforms. + FILE(WRITE ${PROJECT_BINARY_DIR}/CPackPackagingTasks.cmake "") +ENDIF () + +# Execute the packaging tasks. `INSTALL(SCRIPT ...)` is used so that these tasks +# executing during `make install` rather than `make` or `cmake`. +INSTALL(SCRIPT ${PROJECT_BINARY_DIR}/CPackPackagingTasks.cmake) + diff -Nru texworks-0.4.3~svn858~natty1/CMake/packaging/mac/MacPackagingTasks.cmake.in texworks-0.4.4~svn1004~natty1/CMake/packaging/mac/MacPackagingTasks.cmake.in --- texworks-0.4.3~svn858~natty1/CMake/packaging/mac/MacPackagingTasks.cmake.in 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/packaging/mac/MacPackagingTasks.cmake.in 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,148 @@ +# OS X packaging tasks + +# This file is processed by `CONFIGURE_FILE` in `../CMakeLists.txt` which inserts +# values for `@VARIABLE@` declarations. This is done to import values for some +# variables that would otherwise be undefined when CPack is running. +SET(PROJECT_NAME @PROJECT_NAME@) +SET(PROJECT_SOURCE_DIR @PROJECT_SOURCE_DIR@) +SET(PROJECT_BINARY_DIR @PROJECT_BINARY_DIR@) +SET(TeXworks_LIB_DIRS @TeXworks_LIB_DIRS@) +SET(CMAKE_SHARED_LIBRARY_SUFFIX @CMAKE_SHARED_LIBRARY_SUFFIX@) +SET(QT_PLUGINS @QT_PLUGINS@) + +# This `IF` statement ensures that the following commands are executed only when +# CPack is running---i.e. when a user executes `make package` but not `make install` +IF ( ${CMAKE_INSTALL_PREFIX} MATCHES .*/_CPack_Packages/.* ) + + # Download and install Poppler data + # --------------------------------- + IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4.tar.gz ) + MESSAGE(STATUS "Downloading Poppler data files") + FILE(DOWNLOAD "http://poppler.freedesktop.org/poppler-data-0.4.5.tar.gz" + ${PROJECT_SOURCE_DIR}/poppler-data-0.4.5.tar.gz + EXPECTED_MD5 448dd7c5077570e340340706cef931aa + SHOW_PROGRESS + ) + ENDIF () + + IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/poppler-data-0.4.5 ) + EXECUTE_PROCESS(COMMAND tar xzf ${PROJECT_SOURCE_DIR}/poppler-data-0.4.5.tar.gz + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + ) + ENDIF () + + FILE(INSTALL ${PROJECT_SOURCE_DIR}/poppler-data-0.4.5/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/poppler-data + PATTERN CMakeLists.txt EXCLUDE + PATTERN Makefile EXCLUDE + ) + + + # Download and install TeXworks manual + # ------------------------------------ + IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/TeXworks-manual-html-r959.zip ) + MESSAGE(STATUS "Downloading TeXworks HTML manual") + FILE(DOWNLOAD + "http://texworks.googlecode.com/files/TeXworks-manual-html-r959.zip" + ${PROJECT_SOURCE_DIR}/TeXworks-manual-html-r959.zip + EXPECTED_MD5 2071e3c2fc6b6fdb57bca0484abdd35a + SHOW_PROGRESS + ) + ENDIF () + + IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/TeXworks-manual ) + EXECUTE_PROCESS(COMMAND unzip ${PROJECT_SOURCE_DIR}/TeXworks-manual-html-r959.zip + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + ) + ENDIF () + + FILE(INSTALL ${PROJECT_SOURCE_DIR}/TeXworks-manual + DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/texworks-help/ + ) + + + # Copy all runtime dependencies and rewrite loader paths + # ------------------------------------------------------ + + # Bring in `DeployQt4` a CMake module taken from the Charm application: + # + # + # + # This module offers the `FIXUP_QT4_BUNDLE` function which wraps + # `FIXUP_BUNDLE` from CMake's `BundleUtilities` module and extends it with + # additional Qt4-specific goodies---such as installing Qt4 plugins. + # + # `FIXUP_BUNDLE` is a wonderful function that examines an executable, finds + # all non-system libraries it depends on, copies them into the `.app` bundle + # and then re-writes the necessary loader paths. + SET(CMAKE_MODULE_PATH @CMAKE_MODULE_PATH@) + INCLUDE(DeployQt4) + + # Gather all TeXworks Plugin libraries. + FILE(GLOB TeXworks_PLUGINS + ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/PlugIns/*${CMAKE_SHARED_MODULE_SUFFIX}) + + # If `BU_CHMOD_BUNDLE_ITEMS` is not set, `install_name_tool` will fail to + # re-write some loader paths due to insufficiant permissions. + SET(BU_CHMOD_BUNDLE_ITEMS ON) + + FIXUP_QT4_BUNDLE(${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app "${QT_PLUGINS}" "${TeXworks_PLUGINS}" "${TeXworks_LIB_DIRS}") + + + # Remove unecessary architectures from universal binaries + # ------------------------------------------------------- + + # Some libraries copied from the OS X system, such as X11 libraries, may + # contain up to 4 different architectures. Here we will iterate over these + # libraries and use `lipo` to strip out un-needed architectures. + + # Another useful function from `BundleUtilities`. + GET_BUNDLE_MAIN_EXECUTABLE(${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app APP_MAIN) + + # We look at the TeXworks binary that was built rather than consulting the + # value of the `CMAKE_OSX_ARCHITECTURES` because if the user did not set + # `CMAKE_OSX_ARCHITECTURES`, then the variable will be an empty string and the + # format of the resulting binary will depend on the versions of OS X and + # XCode. + MESSAGE(STATUS "Reducing the size of bundled libraries.") + MESSAGE(STATUS "Scanning architectures of: ${APP_MAIN}") + EXECUTE_PROCESS( + # `lipo -info` returns a list of the form: + # + # : : + # + # Piping this output to `cut -d : -f 3-` allows us to extract just the list + # of architectures. + COMMAND lipo -info ${APP_MAIN} + COMMAND cut -d : -f 3- + OUTPUT_VARIABLE APP_ARCHS + ) + + # Strip leading and trailing whitespace. + STRING(STRIP ${APP_ARCHS} APP_ARCHS) + # Convert spaces to semicolons so CMake will interpret the string as a list. + STRING(REPLACE " " ";" APP_ARCHS ${APP_ARCHS}) + + MESSAGE(STATUS "Will reduce bundled libraries to: ${APP_ARCHS}") + + FOREACH(ARCH IN LISTS APP_ARCHS) + SET(ARCHS_TO_EXTRACT "${ARCHS_TO_EXTRACT} -extract ${ARCH}") + ENDFOREACH () + + # __NOTE:__ This will not process any dylibs from Frameworks copied by + # `FIXUP_BUNDLE`, hence it may not touch any of the Qt libraries. Something to + # fix in the future. + FILE(GLOB BUNDLED_DYLIBS + ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/MacOS/*${CMAKE_SHARED_LIBRARY_SUFFIX}) + + FOREACH(DYLIB IN LISTS BUNDLED_DYLIBS) + MESSAGE(STATUS "Processing included library: ${DYLIB}") + # `lipo` is very very anal about how arguments get passed to it. So we + # execute through bash to side-step the issue. + EXECUTE_PROCESS(COMMAND bash -c "lipo ${ARCHS_TO_EXTRACT} ${DYLIB} -output ${DYLIB}") + ENDFOREACH () + + MESSAGE(STATUS "Finished stripping architectures from bundled libraries.") + +ENDIF () + diff -Nru texworks-0.4.3~svn858~natty1/CMake/packaging/mac/poppler.rb texworks-0.4.4~svn1004~natty1/CMake/packaging/mac/poppler.rb --- texworks-0.4.3~svn858~natty1/CMake/packaging/mac/poppler.rb 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/packaging/mac/poppler.rb 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,92 @@ +# This file contains a formula for installing Poppler on Mac OS X using the +# Homebrew package manager: +# +# http://mxcl.github.com/homebrew +# +# To install Poppler using this formula: +# +# brew install path/to/this/poppler.rb +# +# Changes compared to Homebrew's standard Poppler formula: +# +# - TeXworks-specific patches are applied to help Qt apps find the +# poppler-data directory. +# +# - Poppler is configured to use as few dependencies as possible. This +# reduces the number of dylibs that must be added to TeXworks.app when it +# is packaged for distribution. +TEXWORKS_SOURCE_DIR = Pathname.new(__FILE__).realpath.dirname.join('../../..') +TEXWORKS_PATCH_DIR = TEXWORKS_SOURCE_DIR + 'lib-patches' + +require 'formula' + +class PopplerData < Formula + url 'http://poppler.freedesktop.org/poppler-data-0.4.5.tar.gz' + md5 '448dd7c5077570e340340706cef931aa' +end + +class Poppler < Formula + url 'http://poppler.freedesktop.org/poppler-0.18.4.tar.gz' + homepage 'http://poppler.freedesktop.org' + md5 '12658f3308597e57f3faff538cc73baf' + version '0.18.4-texworks' + + depends_on 'pkg-config' => :build + depends_on 'qt' + + def patches + { + :p1 => [ + TEXWORKS_PATCH_DIR + 'poppler-qt4-globalparams.patch', + TEXWORKS_PATCH_DIR + 'poppler-bogus-memory-allocation-fix.patch', + TEXWORKS_PATCH_DIR + 'poppler-fix-cmake-install-names-for-homebrew.patch' + ] + } + end + + def install + ENV.x11 + cmake_args = std_cmake_parameters.split + + # Save time by not building tests + cmake_args.concat [ + '-DBUILD_CPP_TESTS=OFF', + '-DBUILD_GTK_TESTS=OFF', + '-DBUILD_QT3_TESTS=OFF', + '-DBUILD_QT4_TESTS=OFF' + ] + + # Components required by TeXworks. + cmake_args.concat [ + '-DWITH_Qt4=YES', + '-DENABLE_XPDF_HEADERS=YES' + ] + + # Minimize library dependencies for TeXworks + cmake_args.concat [ + '-DENABLE_ABIWORD=OFF', + '-DENABLE_CPP=OFF', + '-DENABLE_LCMS=OFF', + '-DENABLE_LIBCURL=OFF', + '-DENABLE_LIBOPENJPEG=OFF', + '-DENABLE_SPLASH=ON', # Required + '-DENABLE_UTILS=OFF', + '-DENABLE_ZLIB=OFF', + '-DWITH_Cairo=OFF', + '-DWITH_JPEG=OFF', + '-DWITH_PNG=OFF', + '-DWITH_Qt3=OFF' + ] + + Dir.mkdir 'build' + Dir.chdir 'build' do + system 'cmake', '..', *cmake_args + system "make install" + end + + # Install poppler font data. + PopplerData.new.brew do + system "make install prefix=#{prefix}" + end + end +end diff -Nru texworks-0.4.3~svn858~natty1/CMake/packaging/mac/set_dmg_layout.scpt.in texworks-0.4.4~svn1004~natty1/CMake/packaging/mac/set_dmg_layout.scpt.in --- texworks-0.4.3~svn858~natty1/CMake/packaging/mac/set_dmg_layout.scpt.in 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/packaging/mac/set_dmg_layout.scpt.in 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,91 @@ +#!/usr/bin/env osascript +(* + * This AppleScript file is a template that will format the appearance of the + * Drag N' Drop installer window. The original material came from DrNic's + * ChocTop project: + * + * https://github.com/drnic/choctop + * + * Copyright © 2009 Dr Nic Williams, drnicwilliams@gmail.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ‘Software’), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to do + * so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + *) +-- Clean up if a previous run of this script aborted +do shell script "if [ -f tw_tmp.dmg ]; then rm tw_tmp.dmg; fi" + +-- Make package DMG writable and mount it +do shell script "hdiutil convert -format UDRW -o tw_tmp.dmg @CPACK_PACKAGE_FILE_NAME@.dmg" +do shell script "hdiutil attach tw_tmp.dmg" +do shell script "touch /Volumes/@CPACK_PACKAGE_FILE_NAME@/.DS_Store" +do shell script "chmod +w /Volumes/@CPACK_PACKAGE_FILE_NAME@/.DS_Store" +do shell script "SetFile -a -v /Volumes/@CPACK_PACKAGE_FILE_NAME@/background.png" + +-- Setup Drag N' Drop installer window layout +tell application "Finder" + tell disk "@CPACK_PACKAGE_FILE_NAME@" + open + tell container window + set toolbar visible to false + set statusbar visible to false -- doesn't do anything at DMG open time + set current view to icon view + set the bounds to {50, 100, 450, 400} + end tell + + set icon size of the icon view options of container window to 104 + set text size of the icon view options of container window to 12 + set arrangement of the icon view options of container window to not arranged + + close + + -- Get localized name of applications folder + set applications_folder to displayed name of (path to applications folder) -- i18n + + -- Position icons. All points are measured in pixels from the upper + -- left corner of the window and anchor the *center* of the icon (even + -- though the documentation says "upper left corner") + -- + -- So, to position the upper left corner of an icon: + -- + -- (x, y) + 1/2 * icon size + -- + -- Caveats: cannot place icons within 13 pixels of the left edge or 10 + -- pixels of the top + set position of item applications_folder to {298, 158} + set position of item "TeXworks.app" to {102, 158} + + open + set the bounds of the container window to {50, 100, 450, 400} + set background picture of the icon view options of container window to file "background.png" + update without registering applications + close + + end tell + + -- Allow some time for the Finder to update .DS_Store + delay 5 +end tell + +-- Unmount package and make read-only again +do shell script "SetFile -a -V /Volumes/@CPACK_PACKAGE_FILE_NAME@/background.png" +do shell script "chmod -w /Volumes/@CPACK_PACKAGE_FILE_NAME@/.DS_Store" +do shell script "hdiutil detach /Volumes/@CPACK_PACKAGE_FILE_NAME@" +do shell script "rm @CPACK_PACKAGE_FILE_NAME@.dmg" +do shell script "hdiutil convert -format UDBZ -imagekey zlib-level=9 -o @CPACK_PACKAGE_FILE_NAME@.dmg tw_tmp.dmg" +do shell script "rm tw_tmp.dmg" + Binary files /tmp/TnV4_0f88n/texworks-0.4.3~svn858~natty1/CMake/packaging/mac/texworks_dmg_background.png and /tmp/M6EhOURYVb/texworks-0.4.4~svn1004~natty1/CMake/packaging/mac/texworks_dmg_background.png differ diff -Nru texworks-0.4.3~svn858~natty1/CMake/packaging/mac/texworks_dmg_background.svg texworks-0.4.4~svn1004~natty1/CMake/packaging/mac/texworks_dmg_background.svg --- texworks-0.4.3~svn858~natty1/CMake/packaging/mac/texworks_dmg_background.svg 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/packaging/mac/texworks_dmg_background.svg 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + TEXworks + + + + + + + + + + 0.5 + + diff -Nru texworks-0.4.3~svn858~natty1/CMakeLists.txt texworks-0.4.4~svn1004~natty1/CMakeLists.txt --- texworks-0.4.3~svn858~natty1/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMakeLists.txt 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,363 @@ +# Top-level build file for [TeXworks][tw], a simple editor for TeX and friends. +# +# This buildsystem uses [CMake][cmake] and consists of the following files: +# +#
+#   TeXworks
+#   ├── CMakeLists.txt
+#   ├── src
+#   │   └── CMakeLists.txt
+#   ├── plugins-src
+#   │   ├── TWLuaPlugin
+#   │   │   └── CMakeLists.txt
+#   │   └── TWPythonPlugin
+#   │       └── CMakeLists.txt
+#   └── CMake
+#       └── packaging
+#           ├── CMakeLists.html
+#           └── mac
+#               └── MacPackagingTasks.cmake.in
+# 
+# +# Using CMake as a buildsystem offers some nice advantages: +# +# * Supports component discovery and configuration for all three major +# operating systems and can set TeXworks up to be built using GNU +# Makefiles, XCode or Visual Studio. +# +# * Includes CPack, a tool which simplifies the task of packaging the +# TeXworks app for release after it has been built. CPack can generate +# Drag N' Drop installers for the Mac, Nullsoft installers for Windows and +# `.deb` or `.rpm` packages for Linux. +# +# Comments in the CMake files follow [Markdown][md] formatting conventions. +# This convention allows the `CMakeLists.txt` files to be passed through a tool +# such as [Docco][docco] to create a nicely annotated README for the benefit of +# future developers and maintainers. +# +# [cmake]: http://www.cmake.org +# [docco]: http://jashkenas.github.com/docco +# [md]: http://daringfireball.net/projects/markdown/ +# [tw]: http://code.google.com/p/texworks + + +# Setup and User Options +# ====================== + +# Set project name. +PROJECT(TeXworks) + +# We require CMake v2.8 or greater because it is the first version that +# provides support for certain parts of Qt, such as the ScriptTools. +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +SET(CMAKE_COLOR_MAKEFILE ON) +# Always add the current source and binary directories to the header include +# path when compiling. +SET(CMAKE_INCLUDE_CURRENT_DIR ON) + +IF ( WIN32 ) + MESSAGE( WARNING + "The CMake build system has only been tested on Mac OS X and Linux." + "\nIt probably won't work on Windows. Patches containing fixes are" + "\nwelcomed at:" + "\n https://github.com/Sharpie/TeXworks" + ) +ENDIF () + +# Determine Version Numbers +# ------------------------- + +# The values recovered here are used in the filenames of packaged builds and +# influence parts of the application such as the "About" dialog. + +# Recover canonical (x.y.z) version number from `src/TWVersion.h`. +FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_MAJOR REGEX "VER_MAJOR") +STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_MAJOR ${TeXworks_VER_MAJOR}) +FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_MINOR REGEX "VER_MINOR") +STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_MINOR ${TeXworks_VER_MINOR}) +FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_PATCH REGEX "VER_BUGFIX") +STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_PATCH ${TeXworks_VER_PATCH}) +SET(TeXworks_VERSION ${TeXworks_VER_MAJOR}.${TeXworks_VER_MINOR}.${TeXworks_VER_PATCH}) + +# Recover SVN revision from `src/SvnRev.h`. +FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/SvnRev.h TeXworks_SVN_REV LIMIT_COUNT 1) +STRING(REGEX MATCH "([0-9]+)" TeXworks_SVN_REV ${TeXworks_SVN_REV}) + + +# Declare Project Options +# ----------------------- + +# These are options that users can set at configure-time to determine how the +# application is built and what functionalities it will have. Here we declare +# these options by setting default values. + +SET(TW_BUILD_ID "personal" CACHE STRING "A distribution-specific identifier for TeXworks") + +# On UNIX, CMake installs to `/usr/local` by default. However, Mac users +# will probably find `/Applications` a more convenient default. +IF( APPLE AND CMAKE_INSTALL_PREFIX MATCHES "/usr/local" ) + SET( CMAKE_INSTALL_PREFIX "/Applications" ) +ENDIF() + +# Do an optimized release build by default +IF ( NOT CMAKE_BUILD_TYPE ) + SET(CMAKE_BUILD_TYPE "Release") +ENDIF () + +# Options controlling the creation of scripting language plugins. +OPTION(WITH_LUA "Build TeXworks Lua plugin?" ON) +OPTION(WITH_PYTHON "Build TeXworks Python plugin?" ON) + +# On OS X we default to linking against the Python libraries provided by Apple +# even if other Pythons are available. This helps when building +# re-distributable `.app` packages. By disabling this option, a Mac user can +# link against whatever Python they wish for a personal build. +IF ( APPLE ) + OPTION(USE_SYSTEM_PYTHON "Link against Python Framework distributed with OS X?" ON) +ENDIF () + + +# Dependency Configuration +# ======================== + +# Make the contents of `CMake/Modules` available. Among other things, this +# directory contains scripts that locate project components such as Poppler. +SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules ${CMAKE_MODULE_PATH}) + +# Declare Qt libraries required by this project. +SET (QT_COMPONENTS + QtCore + QtGui + QtUiTools + QtScript + QtScriptTools + QtXML +) + +IF ( UNIX AND NOT APPLE ) + LIST(APPEND QT_COMPONENTS QtDbus) +ENDIF () + +# Locate Qt. `INCLUDE(UseQt4)` brings in a set of macros that helps us deal +# with Qt-specific tasks such as compiling resources or running `moc`. +FIND_PACKAGE(Qt4 COMPONENTS ${QT_COMPONENTS} REQUIRED) +INCLUDE(UseQt4) + +FIND_PACKAGE(ZLIB REQUIRED) +FIND_PACKAGE(Hunspell REQUIRED) +FIND_PACKAGE(Poppler REQUIRED) + +# The only thing Poppler should need is the location of the include directories +# in order to access header files. The library loader should be able to find +# libfontconfig on standard search paths. +IF ( POPPLER_NEEDS_FONTCONFIG ) + FIND_PACKAGE(Fontconfig REQUIRED) +ENDIF () + +# Aggregate library names and include directories into variables for easy +# access. +SET(TeXworks_INCLUDE_DIRS + ${QT_INCLUDE_DIR} + ${HUNSPELL_INCLUDE_DIR} + ${POPPLER_QT4_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIR} +) +IF ( POPPLER_NEEDS_FONTCONFIG ) + LIST(APPEND TeXworks_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR}) +ENDIF () + +SET(TeXworks_LIB_DIRS ${QT_LIBRARY_DIR}) + +SET(TeXworks_LIBS + ${QT_LIBRARIES} + ${POPPLER_LIBRARIES} + ${HUNSPELL_LIBRARIES} + ${ZLIB_LIBRARIES} +) + +# Configure Optional Dependencies +# ------------------------------- + +# CMake 2.8 has separate find scripts for Lua 5.1 and Lua 5.0. We assume that +# the most recent Lua version is installed. +IF ( WITH_LUA ) + FIND_PACKAGE(Lua51) +ENDIF() + +IF ( WITH_PYTHON ) + IF ( USE_SYSTEM_PYTHON ) + SET(PYTHON_LIBRARIES "-F/System/Library/Frameworks -framework Python" CACHE PATH "Python library.") + SET(PYTHON_INCLUDE_DIR "/System/Library/Framework/Python.framework/Headers" CACHE PATH "Python framework.") + MARK_AS_ADVANCED(PYTHON_LIBRARIES) + MARK_AS_ADVANCED(PYTHON_INCLUDE_DIR) + SET(PYTHONLIBS_FOUND TRUE) + ELSE () + # **NOTE** For some reason, FindPythonLibs.cmake always seems to default to + # `/System/Library/Frameworks/Python.framework/Headers` as the include path + # on OS X. + FIND_PACKAGE(PythonLibs) + ENDIF () +ENDIF() + +# Update Header Templates +# ----------------------- + +# Some header files contain components that must be dynamically generated. For +# example, `getDefaultBinPaths.sh` is a script that tries to figure out the +# appropriate path to TeX binaries on UNIX-like systems. +IF ( UNIX ) + IF ( NOT EXISTS ${TeXworks_SOURCE_DIR}/src/DefaultBinaryPaths.h ) + MESSAGE(STATUS "Generating DefaultBinaryPaths.h") + + EXECUTE_PROCESS( + COMMAND ${TeXworks_SOURCE_DIR}/getDefaultBinPaths.sh + WORKING_DIRECTORY ${TeXworks_SOURCE_DIR} + ) + ENDIF () +ENDIF () + + +# Building +# ======== + +# Build main TeXworks application +# ------------------------------- +ADD_SUBDIRECTORY(src) + +# Build Plugins +# ------------- + +# Set the plugin installation path. This is a good default for UNIX-like +# systems, but is not appropriate for Windows. +SET(TeXworks_PLUGIN_DIR lib) + +# On OS X, the plugins should live inside the application bundle. +IF ( APPLE ) + SET(TeXworks_PLUGIN_DIR ${PROJECT_NAME}.app/Contents/PlugIns) + # Plugins are build as shared libraries that contain undefined symbols. + # Pass `-undefined dynamic_lookup` so that the Apple linker does not + # freak out about this. + SET(CMAKE_MODULE_LINKER_FLAGS + "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS} -undefined dynamic_lookup") +ENDIF () + + +# Build scripting language plugins if the required libraries are available. +IF ( LUA51_FOUND ) + ADD_SUBDIRECTORY(${TeXworks_SOURCE_DIR}/plugins-src/TWLuaPlugin) +ENDIF () + +IF ( PYTHONLIBS_FOUND ) + ADD_SUBDIRECTORY(${TeXworks_SOURCE_DIR}/plugins-src/TWPythonPlugin) +ENDIF () + + +# Packaging +# ========= + +# This section is responsible for executing all tasks that run when a user +# invokes `cpack` or `make package` after executing their platform's equivalent +# of of `make`. The packaging tasks are responsible for two things: +# +# * Applying transformations to the compiled binaries such that they can be +# distributed to another machine. +# +# * Gathering all binaries and libraries and packaging them into an archive +# suitable for distribution such as a Windows installer or Mac disk image +# file. + +# Gather all libraries related to Qt plugins used by TeXworks so that they can +# be bundled into packages. +SET(QT_PLUGINS + ${QT_QTACCESSIBLEWIDGETS_PLUGIN_RELEASE} + ${QT_QCNCODECS_PLUGIN_RELEASE} + ${QT_QJPCODECS_PLUGIN_RELEASE} + ${QT_QKRCODECS_PLUGIN_RELEASE} + ${QT_QTWCODECS_PLUGIN_RELEASE} + ${QT_QGIF_PLUGIN_RELEASE} + ${QT_QJPEG_PLUGIN_RELEASE} + ${QT_QTIFF_PLUGIN_RELEASE} +) + +# The file `CMake/packaging/CMakeLists.txt` controls the execution of tasks +# specific to preparing binaries for packaging on a given platform. This script +# is invoked via `ADD_SUBDIRECTORY` so that it executes after TeXworks and its +# components are built and installed. You cannot fixup an application bundle +# before it has been created... +ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/CMake/packaging) + +# Set CPack variables. +SET(CPACK_PACKAGE_VERSION_MAJOR ${TeXworks_VER_MAJOR}) +SET(CPACK_PACKAGE_VERSION_MINOR ${TeXworks_VER_MINOR}) +SET(CPACK_PACKAGE_VERSION_PATCH ${TeXworks_VER_PATCH}) +SET(CPACK_PACKAGE_VERSION ${TeXworks_VERSION}) + +SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) +SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}.${CPACK_PACKAGE_VERSION}-${TeXworks_SVN_REV}") + +# Configure Drag N' Drop installer. +IF ( APPLE ) + SET(MAC_PACK_BITS "${CMAKE_SOURCE_DIR}/cmake/packaging/mac") + SET(CPACK_GENERATOR DragNDrop) + SET( CPACK_DMG_BACKGROUND_IMAGE "${MAC_PACK_BITS}/texworks_dmg_background.png" ) + + # Configure an AppleScript for applying a nice window layout to Drag N' Drop disk + # image. + CONFIGURE_FILE( ${MAC_PACK_BITS}/set_dmg_layout.scpt.in + ${PROJECT_BINARY_DIR}/set_dmg_layout.scpt + @ONLY + ) +ENDIF () + +INCLUDE(CPack) + + +# Summary +# ======= + +# This section displays a nice configuration summary for the user. + +# These macros borrowed from the Poppler CMake scripts. They add some nice +# formatting to configuration info. +MACRO(CONFIG_INFO what value) + STRING(LENGTH ${what} length_what) + MATH(EXPR left_char "35 - ${length_what}") + SET(blanks) + FOREACH(_i RANGE 1 ${left_char}) + SET(blanks "${blanks} ") + ENDFOREACH() + + MESSAGE(" ${what}:${blanks} ${value}") +ENDMACRO() + +MACRO(CONFIG_YESNO what enabled) + IF(${enabled}) + SET(enabled_string "yes") + ELSE(${enabled}) + SET(enabled_string "no") + ENDIF() + + CONFIG_INFO("${what}" "${enabled_string}") +ENDMACRO() + +# Print out configuration summary. +MESSAGE("TeXworks has been configured:\n") + +CONFIG_INFO("Version" ${TeXworks_VERSION}) +CONFIG_INFO("SVN Revision" ${TeXworks_SVN_REV}) +CONFIG_INFO("Build ID" ${TW_BUILD_ID}) +CONFIG_INFO("Compiler optimization" ${CMAKE_BUILD_TYPE}) +MESSAGE("") + +CONFIG_YESNO("Lua scripting plugin" LUA51_FOUND) +CONFIG_YESNO("Python scripting plugin" PYTHONLIBS_FOUND) +IF( APPLE ) + CONFIG_YESNO(" OS X system python" USE_SYSTEM_PYTHON) +ENDIF() +MESSAGE("") + +MESSAGE(" TeXworks will be installed to:") +MESSAGE(" ${CMAKE_INSTALL_PREFIX}") +MESSAGE("") + + diff -Nru texworks-0.4.3~svn858~natty1/debian/changelog texworks-0.4.4~svn1004~natty1/debian/changelog --- texworks-0.4.3~svn858~natty1/debian/changelog 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/debian/changelog 2012-04-29 16:24:01.000000000 +0000 @@ -1,5 +1,31 @@ -texworks (0.4.3~svn858~natty1) natty; urgency=low +texworks (0.4.4~svn1004~natty1) natty; urgency=low - * Fix bug in autocompletion that could cause data loss + * Fix crash caused by Qt when adding lines at the beginning of a document + * Fix search/replace for multi-line strings + * Work around layout issues which cause lines to disappear + * Fix building with BSD make + * Fix block selection of last paragraph + * Fix overwrite of "Find all occurrences" option + * Improve "Unable to execute..." error dialog + * Rename "Show/Hide Output Panel" to "Show/Hide Console Output" in the menu + and the preferences dialog + * Remove subject and add instructions to body of the "email to mailinglist" + * Bring the window running TeX to the top at the beginning of typesetting to + ensure that the console output is visible + * Allow symlinks and display only folders in "path for programs" in the + preferences dialog + * Add "Clear Recent Files" to "Open Recent" menu + * Add an autocompletion entry to the preferences dialog + * Add Lua(La)TeX to the default tools (and drop LaTeXmk by default) + * Add an option to open log files + * Add CMake support (experimental) + * Update SyncTeX to version 1.17 + * Update URLs to http://www.tug.org/texworks/ + * Some enhancements to functions available to scripting + * Avoid showing an empty message box for script results + * Resolve symlinks when looking for scripts + * Expose the scripts' titles, authors, filenames, etc. to scripting + * Update/improve scripts: open pdf in default viewer, derive spellchecking + language from babel package, log parser - -- Stefan Löffler Wed, 29 Jun 2011 19:08:48 +0200 + -- Stefan Löffler Sun, 29 Apr 2012 18:18:56 +0200 diff -Nru texworks-0.4.3~svn858~natty1/debian/control texworks-0.4.4~svn1004~natty1/debian/control --- texworks-0.4.3~svn858~natty1/debian/control 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/debian/control 2012-04-29 16:24:01.000000000 +0000 @@ -2,7 +2,7 @@ Section: tex Priority: optional Maintainer: Stefan Löffler -Build-Depends: debhelper (>= 6), libpoppler-qt4-dev, libhunspell-dev, libqt4-dev, liblua5.1-0-dev, python-dev +Build-Depends: debhelper (>= 6), pkg-config, libpoppler-qt4-dev, libhunspell-dev, libqt4-dev, liblua5.1-0-dev, python-dev Standards-Version: 3.8.0 Homepage: http://code.google.com/p/texworks/ @@ -32,14 +32,6 @@ . For further information, see http://tug.org/texworks/ -Package: texworks-scripting-python -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: texworks -Description: Plugin to bring Python scripting to TeXworks - . - For further information, see http://tug.org/texworks/ - Package: texworks-help-en Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends} diff -Nru texworks-0.4.3~svn858~natty1/debian/copyright texworks-0.4.4~svn1004~natty1/debian/copyright --- texworks-0.4.3~svn858~natty1/debian/copyright 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/debian/copyright 2012-04-29 16:24:01.000000000 +0000 @@ -1,15 +1,15 @@ This package was debianized by Stefan Löffler on -Wed, 29 Jun 2011 19:08:48 +0200 +Sun, 29 Apr 2012 18:18:56 +0200 It was downloaded from http://code.google.com/p/texworks/ Upstream Authors: - Jonathan Kew, Stefan Löffer, and others + Jonathan Kew, Stefan Löffer, Charlie Sharpsteen, and others Copyright: - Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler + Copyright (C) 2007-2012 Jonathan Kew, Stefan Löffler, Charlie Sharpsteen License: @@ -19,6 +19,6 @@ On Debian systems, the complete text of the GNU General Public License v2 can be found in the file `/usr/share/common-licenses/GPL-2'. -The Debian packaging is copyright 2011, Stefan Löffler and +The Debian packaging is copyright 2012, Stefan Löffler and is licensed under the GPLv2, see `/usr/share/common-licenses/GPL-2'. diff -Nru texworks-0.4.3~svn858~natty1/debian/rules texworks-0.4.4~svn1004~natty1/debian/rules --- texworks-0.4.3~svn858~natty1/debian/rules 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/debian/rules 2012-04-29 16:24:01.000000000 +0000 @@ -31,9 +31,10 @@ # Build Lua plugin qmake-qt4 'TW_BUILD_ID=launchpad' 'INSTALL_PREFIX=/usr' 'TW_HELPPATH=/usr/share/doc/texworks-help' \ plugins-src/TWLuaPlugin/TWLuaPlugin.pro && $(MAKE) - # Build Python plugin - qmake-qt4 'TW_BUILD_ID=launchpad' 'INSTALL_PREFIX=/usr' 'TW_HELPPATH=/usr/share/doc/texworks-help' \ - plugins-src/TWPythonPlugin/TWPythonPlugin.pro && $(MAKE) + # NOTE: Support for python is discontinued until further notice +# # Build Python plugin +# qmake-qt4 'TW_BUILD_ID=launchpad' 'INSTALL_PREFIX=/usr' 'TW_HELPPATH=/usr/share/doc/texworks-help' \ +# plugins-src/TWPythonPlugin/TWPythonPlugin.pro && $(MAKE) # Build main app qmake-qt4 'TW_BUILD_ID=launchpad' 'INSTALL_PREFIX=/usr' 'TW_HELPPATH=/usr/share/doc/texworks-help' \ TeXworks.pro && $(MAKE) @@ -62,9 +63,10 @@ # Install Lua plugin qmake-qt4 'TW_BUILD_ID=launchpad' 'INSTALL_PREFIX=/usr' 'TW_HELPPATH=/usr/share/doc/texworks-help' \ plugins-src/TWLuaPlugin/TWLuaPlugin.pro && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install - # Install Python plugin - qmake-qt4 'TW_BUILD_ID=launchpad' 'INSTALL_PREFIX=/usr' 'TW_HELPPATH=/usr/share/doc/texworks-help' \ - plugins-src/TWPythonPlugin/TWPythonPlugin.pro && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install + # NOTE: Support for python is discontinued until further notice +# # Install Python plugin +# qmake-qt4 'TW_BUILD_ID=launchpad' 'INSTALL_PREFIX=/usr' 'TW_HELPPATH=/usr/share/doc/texworks-help' \ +# plugins-src/TWPythonPlugin/TWPythonPlugin.pro && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install # Install main app qmake-qt4 'TW_BUILD_ID=launchpad' 'INSTALL_PREFIX=/usr' 'TW_HELPPATH=/usr/share/doc/texworks-help' \ TeXworks.pro && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install @@ -73,6 +75,14 @@ mkdir --parents $(CURDIR)/debian/tmp/usr/share/doc/texworks-help/ cp -r manual $(CURDIR)/debian/tmp/usr/share/doc/texworks-help/TeXworks-manual + # Install the icon + #dh_install texworks.xpm usr/share/pixmaps +# cp "res/images/TeXworks.png" "texworks.png" +# dh_install texworks.png usr/share/pixmaps + # Install the .desktop file +# dh_install texworks.desktop usr/share/applications + # Install man page +# dh_installman texworks.1 dh_install dh_icons diff -Nru texworks-0.4.3~svn858~natty1/debian/texworks.install texworks-0.4.4~svn1004~natty1/debian/texworks.install --- texworks-0.4.3~svn858~natty1/debian/texworks.install 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/debian/texworks.install 2012-04-29 16:24:01.000000000 +0000 @@ -1,5 +1,2 @@ debian/tmp/usr/bin* -debian/tmp/usr/share/applications/* -debian/tmp/usr/share/man/* -debian/tmp/usr/share/doc/texworks/* -debian/tmp/usr/share/pixmaps/* +debian/tmp/usr/share* diff -Nru texworks-0.4.3~svn858~natty1/debian/texworks-scripting-python.install texworks-0.4.4~svn1004~natty1/debian/texworks-scripting-python.install --- texworks-0.4.3~svn858~natty1/debian/texworks-scripting-python.install 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/debian/texworks-scripting-python.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/texworks/libTWPythonPlugin.so diff -Nru texworks-0.4.3~svn858~natty1/getDefaultBinPaths.sh texworks-0.4.4~svn1004~natty1/getDefaultBinPaths.sh --- texworks-0.4.3~svn858~natty1/getDefaultBinPaths.sh 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/getDefaultBinPaths.sh 2012-04-29 16:24:01.000000000 +0000 @@ -22,6 +22,12 @@ appendPath() { NEWPATH="$1" + # Don't append common system directories here (they are added elsewhere) + # to ensure that they are always at the end of the list + if [ "$NEWPATH" = "/usr/bin" -o "$NEWPATH" = "/usr/local/bin" ]; then + echo "$NEWPATH ignored" + return + fi case "$BINPATHS" in *:"$NEWPATH":*) echo $NEWPATH already present;; *) # note that BINPATHS already ends with colon @@ -68,6 +74,7 @@ *) OS=`echo $PLATFORM | sed 's/.*-//'` esac +appendPath "/usr/local/texlive/2012/bin/$ARCH-$OS" appendPath "/usr/local/texlive/2011/bin/$ARCH-$OS" appendPath "/usr/local/texlive/2010/bin/$ARCH-$OS" appendPath "/usr/local/texlive/2009/bin/$ARCH-$OS" @@ -89,8 +96,7 @@ # (3) append default paths that we should always check -appendPath "/usr/local/bin" -appendPath "/usr/bin" +BINPATHS="$BINPATHS/usr/local/bin:/usr/bin" # strip leading and trailing colons from the list BINPATHS=`echo $BINPATHS | sed 's/^://;s/:$//'` diff -Nru texworks-0.4.3~svn858~natty1/getSvnRev.sh texworks-0.4.4~svn1004~natty1/getSvnRev.sh --- texworks-0.4.3~svn858~natty1/getSvnRev.sh 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/getSvnRev.sh 2012-04-29 16:24:01.000000000 +0000 @@ -6,7 +6,7 @@ svn update # get the current revision number -REV=`svn info | fgrep Revision: | cut -d ' ' -f 2` +REV=`LANG=C svn info | fgrep Revision: | cut -d ' ' -f 2` if [ `svn status | grep -c "^[^?]"` == 0 ]; then # make a new SvnRev.h file diff -Nru texworks-0.4.3~svn858~natty1/man/texworks.1 texworks-0.4.4~svn1004~natty1/man/texworks.1 --- texworks-0.4.3~svn858~natty1/man/texworks.1 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/man/texworks.1 2012-04-29 16:24:01.000000000 +0000 @@ -66,10 +66,10 @@ If you find a bug, please report it at \%http://code.google.com/p/texworks/issues/list .SH AUTHORS -Jonathan Kew, Stefan Löffler, and others +Jonathan Kew, Stefan Löffler, Charlie Sharpsteen, and others .SH COPYRIGHT -Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler +Copyright (C) 2007-2012 Jonathan Kew, Stefan Löffler, Charlie Sharpsteen License GPLv2+: GNU GPL (version 2 or later) diff -Nru texworks-0.4.3~svn858~natty1/manual/en/Acknowledgements.html texworks-0.4.4~svn1004~natty1/manual/en/Acknowledgements.html --- texworks-0.4.3~svn858~natty1/manual/en/Acknowledgements.html 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/manual/en/Acknowledgements.html 2012-04-29 16:24:01.000000000 +0000 @@ -16,7 +16,7 @@ "TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> - + @@ -38,7 +38,7 @@

-

Acknowledgements

+

Acknowledgements

Microsoft, Windows, and the Windows logo are diff -Nru texworks-0.4.3~svn858~natty1/manual/en/AdvanceduseScripting.html texworks-0.4.4~svn1004~natty1/manual/en/AdvanceduseScripting.html --- texworks-0.4.3~svn858~natty1/manual/en/AdvanceduseScripting.html 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/manual/en/AdvanceduseScripting.html 2012-04-29 16:24:01.000000000 +0000 @@ -16,7 +16,7 @@ "TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> - +