Commit 69aed638 authored by Ghislain MARY's avatar Ghislain MARY

Prevent duplicating files that are already located in linphone source code for Mac OS packaging.

parent b111c2f5
......@@ -41,6 +41,7 @@ string(REPLACE "." ";" SPLITTED_LINPHONE_VERSION ${LINPHONE_VERSION})
list(GET SPLITTED_LINPHONE_VERSION 0 LINPHONE_MAJOR_VERSION)
list(GET SPLITTED_LINPHONE_VERSION 1 LINPHONE_MINOR_VERSION)
list(GET SPLITTED_LINPHONE_VERSION 2 LINPHONE_MICRO_VERSION)
set(PACKAGE_VERSION "${LINPHONE_VERSION}")
# Translates absolute internal dependency path of FFMepeg libraries into relative path on MacOSX
if(APPLE)
......@@ -49,36 +50,36 @@ if(APPLE)
file(COPY ${LINPHONE_OUTPUT_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/OUTPUT ${LINPHONE_SDK_TMP})
set(RPATH_CHANGE_CMDS
-change ${LINPHONE_OUTPUT_DIR}/lib/libavcodec.53.61.100.dylib @rpath/libavcodec.53.61.100.dylib
-change ${LINPHONE_OUTPUT_DIR}/lib/libavutil.51.35.100.dylib @rpath/libavutil.51.35.100.dylib
-change ${LINPHONE_OUTPUT_DIR}/lib/libswscale.2.1.100.dylib @rpath/libswscale.2.1.100.dylib
-change ${LINPHONE_OUTPUT_DIR}/lib/libswresample.0.6.100.dylib @rpath/libswresample.0.6.100.dylib
-change ${LINPHONE_OUTPUT_DIR}/lib/libavcodec.53.61.100.dylib @rpath/libavcodec.53.61.100.dylib
-change ${LINPHONE_OUTPUT_DIR}/lib/libavutil.51.35.100.dylib @rpath/libavutil.51.35.100.dylib
-change ${LINPHONE_OUTPUT_DIR}/lib/libswscale.2.1.100.dylib @rpath/libswscale.2.1.100.dylib
-change ${LINPHONE_OUTPUT_DIR}/lib/libswresample.0.6.100.dylib @rpath/libswresample.0.6.100.dylib
-change ${LINPHONE_OUTPUT_DIR}/lib/libopenh264.0.dylib @rpath/libopenh264.0.dylib
-change /opt/local/lib/libintl.8.dylib @rpath/libintl.8.dylib
-change /opt/local/lib/libiconv.2.dylib @rpath/libiconv.2.dylib
-change /lib/libopenh264.0.dylib @rpath/libopenh264.0.dylib
)
set(RPATH_LIBS_TO_MODIFY
libavcodec.53.61.100.dylib
libavutil.51.35.100.dylib
liblinphone.7.dylib
libmediastreamer_voip.5.dylib
libswresample.0.6.100.dylib
libswscale.2.1.100.dylib
)
set(RPATH_LIBS_TO_MODIFY
libavcodec.53.61.100.dylib
libavutil.51.35.100.dylib
liblinphone.7.dylib
libmediastreamer_voip.5.dylib
libswresample.0.6.100.dylib
libswscale.2.1.100.dylib
mediastreamer/plugins/libmsamr.dylib
mediastreamer/plugins/libmsbcg729.dylib
mediastreamer/plugins/libmsilbc.dylib
mediastreamer/plugins/libmsopenh264.dylib
mediastreamer/plugins/libmssilk.dylib
mediastreamer/plugins/libmswebrtc.dylib
)
foreach(LIB_TO_CHANGE ${RPATH_LIBS_TO_MODIFY})
execute_process(
)
foreach(LIB_TO_CHANGE ${RPATH_LIBS_TO_MODIFY})
execute_process(
COMMAND install_name_tool ${RPATH_CHANGE_CMDS} ${LINPHONE_SDK_TMP}/lib/${LIB_TO_CHANGE}
COMMAND install_name_tool -id @rpath/${LIB_TO_CHANGE} ${LINPHONE_SDK_TMP}/lib/${LIB_TO_CHANGE}
COMMAND install_name_tool -delete_rpath ${LINPHONE_OUTPUT_DIR}/lib ${LINPHONE_SDK_TMP}/lib/${LIB_TO_CHANGE}
)
endforeach()
)
endforeach()
file(COPY /opt/local/lib/libintl.8.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib /opt/local/lib/libiconv.2.dylib DESTINATION ${LINPHONE_SDK_TMP}/lib)
execute_process(
COMMAND install_name_tool -id @rpath/libintl.8.dylib -change /opt/local/lib/libiconv.2.dylib @rpath/libiconv.2.dylib ${LINPHONE_SDK_TMP}/lib/libintl.8.dylib
......@@ -165,13 +166,13 @@ if(WIN32)
)
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)
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)
configure_file("${LINPHONE_SOURCE_DIR}/build/macos/Info-linphone.plist.in" "mac-bundler/Info-linphone.plist" @ONLY)
configure_file("${LINPHONE_SOURCE_DIR}/build/macos/environment.sh" "mac-bundler/environment.sh" COPYONLY)
configure_file("${LINPHONE_SOURCE_DIR}/gtk/gtkrc.mac" "mac-bundler/gtkrc" COPYONLY)
configure_file("${LINPHONE_SOURCE_DIR}/pixmaps/linphone.icns" "mac-bundler/linphone.icns" COPYONLY)
configure_file("mac-bundler/linphone.bundle" "mac-bundler/linphone.bundle" COPYONLY) # This file has to be different than the one in the linphone source code because of different file access paths
configure_file("mac-bundler/call-bundler.cmake.in" "mac-bundler/call-bundler.cmake")
install(SCRIPT "${CMAKE_BINARY_DIR}/mac-bundler/call-bundler.cmake")
endif()
if(MSVC)
......
<?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>
......@@ -20,27 +20,27 @@
#
############################################################################
set(ENV{DEFAULT_PREFIX} /opt/local)
set(ENV{LINPHONE_PREFIX} ${LINPHONE_OUTPUT_DIR})
set(ENV{BUNDLE_DESTINATION} ${CMAKE_INSTALL_PREFIX})
set(ENV{LINPHONE_INSTALL_PREFIX} "${LINPHONE_OUTPUT_DIR}")
set(ENV{MS2_PLUGINS_INSTALL_PREFIX} "${LINPHONE_OUTPUT_DIR}")
set(ENV{BUNDLE_PREFIX} "${CMAKE_INSTALL_PREFIX}")
execute_process(
COMMAND ${MAC_BUNDLER} linphone.bundle
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/mac-bundler
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/mac-bundler"
)
execute_process(
COMMAND install_name_tool
COMMAND install_name_tool
-delete_rpath ${LINPHONE_OUTPUT_DIR}/lib
-add_rpath @executable_path/../Resources/lib
${CMAKE_INSTALL_PREFIX}/Linphone.app/Contents/MacOS/Linphone-bin
"${CMAKE_INSTALL_PREFIX}/Linphone.app/Contents/MacOS/Linphone-bin"
)
execute_process(
COMMAND pkgbuild
COMMAND pkgbuild
--install-location /Applications
--scripts ${CMAKE_SOURCE_DIR}/mac-bundler/pkg-scripts
--component ${CMAKE_INSTALL_PREFIX}/Linphone.app
./linphone-${LINPHONE_GIT_REVISION}.pkg
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
--scripts "${CMAKE_SOURCE_DIR}/mac-bundler/pkg-scripts"
--component "${CMAKE_INSTALL_PREFIX}/Linphone.app"
"./linphone-${LINPHONE_GIT_REVISION}.pkg"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)
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"
......@@ -12,14 +12,17 @@
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>
<prefix name="default">/opt/local</prefix>
<prefix name="linphone">${env:LINPHONE_INSTALL_PREFIX}</prefix>
<prefix name="ms2plugins">${env:MS2_PLUGINS_INSTALL_PREFIX}</prefix>
<!-- This prefix definition is necessary if some dependencies are to be taken from /usr/local/lib -->
<prefix name="local">${env:LINPHONE_ADDITIONAL_DEPENDENCIES_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>
<destination overwrite="yes">${env:BUNDLE_PREFIX}</destination>
<image>
<!-- Not implemented yet (DMG image). -->
......@@ -34,7 +37,7 @@
not needed. If the source path is left out, the default
script will be used.
-->
<!-- launcher-script>${project}/launcher.sh</launcher-script -->
<!--launcher-script>${project}/launcher.sh</launcher-script -->
<!-- Not implemented: Optional runtime, could be python or mono
for example.
......@@ -53,6 +56,14 @@
<main-binary>${prefix:linphone}/bin/linphone</main-binary>
<binary >
${prefix:ms2plugins}/lib/mediastreamer/plugins/*.*.so
</binary>
<binary >
${prefix:linphone}/lib/*.*.dylib
</binary>
<!-- Copy in GTK+ modules. Note the ${gtkdir} macro, which expands
to the correct library subdirectory for the specified gtk
version.
......@@ -61,9 +72,9 @@
${prefix}/lib/${gtkdir}/modules/*.so
</binary>
<binary >
${prefix:linphone}/lib/mediastreamer/plugins/*.*.so
</binary>
<data>
${prefix}/share/mime/mime.cache
</data>
<!-- Copy in GTK+ theme engines and print backends. Note the use of the
"${pkg:module:variable}" macro, which evaluates to a pkg-config
......@@ -74,7 +85,6 @@
<binary>
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/*.so
</binary>
<binary>
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so
</binary>
......@@ -84,13 +94,14 @@
${prefix}/lib/gdk-pixbuf-2.0/${pkg:${gtk}:gtk_binary_version}/loaders/*.so
</binary>
<!-- binary>
<!--binary>
${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/
</binary -->
</binary-->
<!-- data>
<!--data>
${prefix}/etc/pango/
</data -->
</data-->
<!-- Translation filenames, one for each program or library that you
want to copy in to the bundle. The "dest" attribute is
......@@ -148,6 +159,10 @@
${project}/linphone.icns
</data>
<data dest="${bundle}/Contents/Resources">
${project}/environment.sh
</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. -->
......@@ -156,26 +171,18 @@
${project}/gtkrc
</data>
<data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gdk-pixbuf.loaders">
${prefix:default}/etc/${gtkdir}/gdk-pixbuf.loaders
<data dest="${bundle}/Contents/Resources/share/sounds/linphone/rings/oldphone.wav">
${prefix:linphone}/share/sounds/linphone/rings/oldphone.wav
</data>
<data dest="${bundle}/Contents/Resources/share/mime/mime.cache">
${prefix:default}/share/mime/mime.cache
<data dest="${bundle}/Contents/Resources/share/sounds/linphone/ringback.wav">
${prefix:linphone}/share/sounds/linphone/ringback.wav
</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 dest="${bundle}/Contents/Resources/share/sounds/linphone/incoming_chat.wav">
${prefix:linphone}/share/sounds/linphone/incoming_chat.wav
</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
......@@ -190,3 +197,4 @@
</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