Commit d719c349 authored by François Grisez's avatar François Grisez
Browse files

Make TARGET_linphone genarates a bundle of Linphone GTK for Mac

parent 60aeca41
......@@ -52,68 +52,79 @@ if(WIN32)
COMMAND ${7Z_PROGRAM} a -tzip ${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-win32.zip @${CMAKE_SOURCE_DIR}/linphone-sdk.list
WORKING_DIRECTORY ${LINPHONE_OUTPUT_DIR}
)
elseif(APPLE)
find_program(ZIP_PROGRAM zip)
execute_process(
COMMAND rm -rf ${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-mac.zip
COMMAND ${ZIP_PROGRAM} -ry ${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-mac.zip . -i @${CMAKE_SOURCE_DIR}/linphone-sdk-mac.list
WORKING_DIRECTORY ${LINPHONE_OUTPUT_DIR}
)
#elseif(APPLE)
# find_program(ZIP_PROGRAM zip)
# execute_process(
# COMMAND rm -rf ${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-mac.zip
# COMMAND ${ZIP_PROGRAM} -ry ${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-mac.zip . -i @${CMAKE_SOURCE_DIR}/linphone-sdk-mac.list
# WORKING_DIRECTORY ${LINPHONE_OUTPUT_DIR}
# )
endif()
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/"
DESTINATION "."
COMPONENT "linphone_base"
PATTERN "doc" EXCLUDE
PATTERN "etc" EXCLUDE
PATTERN "include" EXCLUDE
PATTERN "lib/cmake" EXCLUDE
PATTERN "lib/gdk-pixbuf-2.0" EXCLUDE
PATTERN "lib/glib-2.0" EXCLUDE
PATTERN "lib/mediastreamer" EXCLUDE
PATTERN "lib/pkgconfig" EXCLUDE
PATTERN "lib/*.a" EXCLUDE
PATTERN "lib/*.def" EXCLUDE
PATTERN "lib/*.exp" EXCLUDE
PATTERN "lib/*.la" EXCLUDE
PATTERN "lib/*.lib" EXCLUDE
PATTERN "man" EXCLUDE
PATTERN "manifest" EXCLUDE
PATTERN "share/aclocal" EXCLUDE
PATTERN "share/CUnit" EXCLUDE
PATTERN "share/glib-2.0" EXCLUDE
PATTERN "share/gtk-2.0" EXCLUDE
PATTERN "share/gtk-doc" EXCLUDE
PATTERN "share/intltool" EXCLUDE
PATTERN "share/java" EXCLUDE
PATTERN "src" EXCLUDE
PATTERN "gtk+-bundle_*" EXCLUDE
PATTERN "linphone.lnk" EXCLUDE
PATTERN "bin/envsubst.exe" EXCLUDE
PATTERN "bin/fc-*" EXCLUDE
PATTERN "bin/freetype-config" EXCLUDE
PATTERN "bin/g*.exe" EXCLUDE
PATTERN "bin/gettext.sh" EXCLUDE
PATTERN "bin/glib*" EXCLUDE
PATTERN "bin/gtk-*" EXCLUDE
PATTERN "bin/intltool*" EXCLUDE
PATTERN "bin/ngettext.exe" EXCLUDE
PATTERN "bin/pango*.exe" EXCLUDE
PATTERN "bin/pkg-config.exe" EXCLUDE
PATTERN "bin/xmlwf.exe" EXCLUDE
PATTERN "bin/openh264.dll" EXCLUDE
)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib/mediastreamer/plugins/"
DESTINATION "lib/mediastreamer/plugins"
COMPONENT "msopenh264"
FILES_MATCHING PATTERN "libmsopenh264.*"
)
if(WIN32)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/"
DESTINATION "."
COMPONENT "linphone_base"
PATTERN "doc" EXCLUDE
PATTERN "etc" EXCLUDE
PATTERN "include" EXCLUDE
PATTERN "lib/cmake" EXCLUDE
PATTERN "lib/gdk-pixbuf-2.0" EXCLUDE
PATTERN "lib/glib-2.0" EXCLUDE
PATTERN "lib/mediastreamer" EXCLUDE
PATTERN "lib/pkgconfig" EXCLUDE
PATTERN "lib/*.a" EXCLUDE
PATTERN "lib/*.def" EXCLUDE
PATTERN "lib/*.exp" EXCLUDE
PATTERN "lib/*.la" EXCLUDE
PATTERN "lib/*.lib" EXCLUDE
PATTERN "man" EXCLUDE
PATTERN "manifest" EXCLUDE
PATTERN "share/aclocal" EXCLUDE
PATTERN "share/CUnit" EXCLUDE
PATTERN "share/glib-2.0" EXCLUDE
PATTERN "share/gtk-2.0" EXCLUDE
PATTERN "share/gtk-doc" EXCLUDE
PATTERN "share/intltool" EXCLUDE
PATTERN "share/java" EXCLUDE
PATTERN "src" EXCLUDE
PATTERN "gtk+-bundle_*" EXCLUDE
PATTERN "linphone.lnk" EXCLUDE
PATTERN "bin/envsubst.exe" EXCLUDE
PATTERN "bin/fc-*" EXCLUDE
PATTERN "bin/freetype-config" EXCLUDE
PATTERN "bin/g*.exe" EXCLUDE
PATTERN "bin/gettext.sh" EXCLUDE
PATTERN "bin/glib*" EXCLUDE
PATTERN "bin/gtk-*" EXCLUDE
PATTERN "bin/intltool*" EXCLUDE
PATTERN "bin/ngettext.exe" EXCLUDE
PATTERN "bin/pango*.exe" EXCLUDE
PATTERN "bin/pkg-config.exe" EXCLUDE
PATTERN "bin/xmlwf.exe" EXCLUDE
PATTERN "bin/openh264.dll" EXCLUDE
)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib/mediastreamer/plugins/"
DESTINATION "lib/mediastreamer/plugins"
FILES_MATCHING PATTERN "libmssilk.*" PATTERN "libmsilbc.*"
)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib/mediastreamer/plugins/"
DESTINATION "lib/mediastreamer/plugins"
COMPONENT "msopenh264"
FILES_MATCHING PATTERN "libmsopenh264.*"
)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib/mediastreamer/plugins/"
DESTINATION "lib/mediastreamer/plugins"
FILES_MATCHING PATTERN "libmssilk.*" PATTERN "libmsilbc.*"
)
elseif(APPLE)
find_program(MAC_BUNDLER gtk-mac-bundler)
configure_file(mac-bundler/Info-linphone.plist.in mac-bundler/Info-linphone.plist @ONLY)
configure_file(mac-bundler/call-bundler.cmake.in mac-bundler/call-bundler.cmake @ONLY)
configure_file(mac-bundler/environment.sh mac-bundler/environment.sh COPYONLY)
configure_file(mac-bundler/gtkrc mac-bundler/gtkrc COPYONLY)
configure_file(mac-bundler/linphone.bundle mac-bundler/linphone.bundle COPYONLY)
configure_file(mac-bundler/linphone.icns mac-bundler/linphone.icns COPYONLY)
install(SCRIPT ${CMAKE_BINARY_DIR}/mac-bundler/call-bundler.cmake)
endif()
if(MSVC)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib/mediastreamer/plugins/"
......@@ -138,12 +149,14 @@ set(CPACK_PACKAGE_EXECUTABLES "linphone;Linphone")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Linphone")
set(CPACK_RESOURCE_FILE_LICENSE "${LINPHONE_SOURCE_DIR}/COPYING")
set(CPACK_COMPONENT_LINPHONE_BASE_DISPLAY_NAME "Linphone")
set(CPACK_COMPONENT_LINPHONE_BASE_DESCRIPTION "Minimal installation of Linphone")
set(CPACK_COMPONENT_LINPHONE_BASE_REQUIRED True)
set(CPACK_COMPONENT_MSOPENH264_DISPLAY_NAME "Cisco's OpenH264 codec")
set(CPACK_COMPONENT_MSOPENH264_DESCRIPTION "Download OpenH264 Video Codec provided by Cisco Systems, Inc.")
set(CPACK_COMPONENT_MSOPENH264_DISABLED True)
if(WIN32)
set(CPACK_COMPONENT_LINPHONE_BASE_DISPLAY_NAME "Linphone")
set(CPACK_COMPONENT_LINPHONE_BASE_DESCRIPTION "Minimal installation of Linphone")
set(CPACK_COMPONENT_LINPHONE_BASE_REQUIRED True)
set(CPACK_COMPONENT_MSOPENH264_DISPLAY_NAME "Cisco's OpenH264 codec")
set(CPACK_COMPONENT_MSOPENH264_DESCRIPTION "Download OpenH264 Video Codec provided by Cisco Systems, Inc.")
set(CPACK_COMPONENT_MSOPENH264_DISABLED True)
endif()
if(WIN32)
set(CPACK_GENERATOR "NSIS")
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Linphone</string>
<key>CFBundleGetInfoString</key>
<string>@LINPHONE_VERSION@, (C) 2011 The linphone team http://www.linphone.org</string>
<key>CFBundleIconFile</key>
<string>linphone.icns</string>
<key>CFBundleIdentifier</key>
<string>org.linphone.linphone</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@LINPHONE_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>@LINPHONE_VERSION@</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2011 Belledonne Communications</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<key>NSAppSleepDisabled</key>
<string>YES</string>
</dict>
</plist>
############################################################################
# call-bundler.cmake
# Copyright (C) 2015 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
set(ENV{DEFAULT_PREFIX} /opt/local)
set(ENV{LINPHONE_PREFIX} @LINPHONE_OUTPUT_DIR@)
set(ENV{BUNDLE_DESTINATION} @CMAKE_INSTALL_PREFIX@)
execute_process(
COMMAND @MAC_BUNDLER@ linphone.bundle
WORKING_DIRECTORY @CMAKE_BINARY_DIR@/mac-bundler
)
export LINPHONE_WORKDIR="$bundle_res"
#this is very important not to force a shared library path so that native frameworks can find their dependencies by themselves,
#and not be forced to use the few libraries we have in the bundle that have the same name as native libs (ex: libiconv)
export DYLD_LIBRARY_PATH=
#the fucking script of the gtk-mac-bundler resets LANG due to obscure bugs. Set it back.
LANG=`defaults read .GlobalPreferences AppleLocale`
case "$LANG" in
*.UTF-8)
;;
*)
if test -d /usr/share/locale/${LANG}.UTF-8 ; then
LANG=${LANG}.UTF-8
fi
;;
esac
export LANG
echo "LANG is $LANG"
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<app-bundle>
<meta>
<!-- Where to pick up the GTK+ installation, icon themes,
etc. Note that "${env:JHBUILD_PREFIX}" is evaluated to the
value of the environment variable JHBUILD_PREFIX. You can
define additional prefixes and refer to them in paths
throughout this file on the form "${prefix:name}". This is
useful for installing certain libraries or even the
application itself separately. Note that JHBUILD_PREFIX is
defined by jhbuild, so it you are not using jhbuild you can
either define your own or just hardcode the path here.
-->
<prefix name="default">${env:DEFAULT_PREFIX}</prefix>
<prefix name="linphone">${env:LINPHONE_PREFIX}</prefix>
<!-- The project directory is the default location of the created
app. If you leave out the path, the current directory is
used. Note the usage of an environment variable here again.
-->
<destination overwrite="yes">${env:BUNDLE_DESTINATION}</destination>
<image>
<!-- Not implemented yet (DMG image). -->
</image>
<!-- Comment this out to keep the install names in binaries -->
<run-install-name-tool/>
<!-- Optionally specify a launcher script to use. If the
application sets up everything needed itself, like
environment variable, linker paths, etc, a launcher script is
not needed. If the source path is left out, the default
script will be used.
-->
<!-- launcher-script>${project}/launcher.sh</launcher-script -->
<!-- Not implemented: Optional runtime, could be python or mono
for example.
-->
<!-- runtime copy="yes">/usr/bin/python</runtime -->
<!-- Indicate the active gtk version to use. This is needed only
for gtk+-3.0 projects. -->
<gtk>gtk+-2.0</gtk>
</meta>
<!-- The special macro "${project}" refers to the directory where
this bundle file is located. The application name and bundle
identifier are taken from the plist file.
-->
<plist>${project}/Info-linphone.plist</plist>
<main-binary>${prefix:linphone}/bin/linphone</main-binary>
<!-- Copy in GTK+ modules. Note the ${gtkdir} macro, which expands
to the correct library subdirectory for the specified gtk
version.
-->
<binary>
${prefix}/lib/${gtkdir}/modules/*.so
</binary>
<binary >
${prefix:linphone}/lib/mediastreamer/plugins/*.*.so
</binary>
<!-- Copy in GTK+ theme engines and print backends. Note the use of the
"${pkg:module:variable}" macro, which evaluates to a pkg-config
variable in the specified module. Note that any libraries that
binaries link to are also copied in automatically. Note also
the included ${gtk} macro, which gets the correct package name
to get. -->
<binary>
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/*.so
</binary>
<binary>
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so
</binary>
<!-- Starting with 2.24, gdk-pixbuf installs into its own directory. -->
<binary>
${prefix}/lib/gdk-pixbuf-2.0/${pkg:${gtk}:gtk_binary_version}/loaders/*.so
</binary>
<binary>
${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/
</binary>
<data>
${prefix}/etc/pango/
</data>
<!-- Translation filenames, one for each program or library that you
want to copy in to the bundle. The "dest" attribute is
optional, as usual. Bundler will find all translations of that
library/program under the indicated directory and copy them.-->
<translations name="gtk20">
${prefix}/share/locale
</translations>
<!-- Data to copy in, usually Glade/UI files, images, sounds files
etc. The destination inside the bundle can be specified if the
files should end up at a different location, by using the
"dest" property. The destination must then start with the macro
"${bundle}", which refers to the bundle root directory.
-->
<data>
${prefix:linphone}/share/linphone
</data>
<data>
${prefix:linphone}/share/pixmaps/linphone
</data>
<data>
${prefix:linphone}/share/images
</data>
<data>
${prefix:linphone}/share/icons
</data>
<!-- Copy in the themes data. You may want to trim this to save space
in your bundle. -->
<data>
${prefix}/share/themes
</data>
<!-- Copy icons. Note that the .icns file is an Apple format which
contains up to 4 sizes of icon. You can use
/Developer/Applications/Utilities/Icon Composer.app to import
artwork and create the file. -->
<data dest="${bundle}/Contents/Resources">
${project}/linphone.icns
</data>
<!-- This is where theme commands go. You can copy them in from your
theme of choice if they provide and example, or you can just
change the source path. -->
<data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">
${project}/gtkrc
</data>
<data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gdk-pixbuf.loaders">
${prefix:default}/etc/${gtkdir}/gdk-pixbuf.loaders
</data>
<data dest="${bundle}/Contents/Resources/share/mime/mime.cache">
${prefix:default}/share/mime/mime.cache
</data>
<!-- Installs a source script in order to initialize
some environment variables before calling the
launcher script. -->
<data dest="${bundle}/Contents/Resources">
${project}/environment.sh
</data>
<data dest="${bundle}/Contents/Resources/share/pixmaps/linphone">
${prefix:linphone}/share/pixmaps/linphone
</data>
<!-- Icon themes to copy. The "icons" property can be either of
"auto", "all", or "none". All or none should be
self-explanatory, while auto means that the script will try to
figure out which icons are needed. This is done by getting all
the strings from all copied binaries, and matching them against
icon names. To be safe, you should use "all". "none" is useful
if you want just the index.theme file but no icons, mostly
needed for the "hicolor" base theme.
>
<icon-theme icons="auto">
Tango
</icon-theme -->
</app-bundle>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment