]> sjero.net Git - linphone/commitdiff
start implementing a macos bundle
authorSimon Morlat <simon.morlat@linphone.org>
Wed, 23 Mar 2011 17:21:37 +0000 (18:21 +0100)
committerSimon Morlat <simon.morlat@linphone.org>
Wed, 23 Mar 2011 17:21:37 +0000 (18:21 +0100)
Makefile.am
README.macos
build/Makefile.am [new file with mode: 0644]
build/macos/Info-linphone.plist.in [new file with mode: 0644]
build/macos/Makefile.am [new file with mode: 0644]
build/macos/environment.sh [new file with mode: 0644]
build/macos/linphone.bundle [new file with mode: 0644]
configure.ac
gtk/main.c

index 66d01711dd89c2b2cee09cfff096700dbeab99e2..cef6503c605304e48cd9ecfb14c3d05301413148 100644 (file)
@@ -16,7 +16,7 @@ ORTP_DIR=oRTP
 endif
 
 
-SUBDIRS = m4 pixmaps po $(ORTP_DIR) $(MS2_DIR) \
+SUBDIRS = build m4 pixmaps po $(ORTP_DIR) $(MS2_DIR) \
                coreapi console gtk share scripts
 
 
@@ -59,6 +59,7 @@ ISS_SCRIPT_PATH=$(shell cd $(top_srcdir) && pwd)/$(ISS_SCRIPT)
 #path to Inno Setup 5 compiler
 ISCC=ISCC.exe
 PACKAGE_WIN32_FILELIST=$(PACKAGE)-win32.filelist
+PACKAGE_BUNDLE_FILE=$(top_srcdir)/build/macos/reltime.bundle
 
 EXTRA_DIST = config.rpath  BUGS linphone.kdevelop  \
                                intltool-extract.in     \
@@ -186,3 +187,13 @@ Portfile-devel:    $(top_srcdir)/scripts/Portfile-devel.tmpl dist
        sed -e 's/\@VERSION\@/$(LINPHONE_VERSION)/g' \
          -e 's/\@LINPHONE_MD5\@/$(shell md5sum linphone-$(VERSION).tar.gz | awk {'print $$1'})/' < $< > $@
 
+bundle:
+       rm -rf $(INSTALLDIR)
+       mkdir -p $(INSTALLDIR)
+       make install DESTDIR=$(INSTALLDIR)
+       LINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
+       LIBLINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
+       ige-mac-bundler $(PACKAGE_BUNDLE_FILE)
+
+
+
index 9531aca9585acc996c9305af233f03c12fa284b5..251b622751bf559b67dd8275cb6251a7079d0e34 100644 (file)
@@ -37,7 +37,7 @@ After installing jhbuild and get gtk built,
 
 $ jhbuild shell
 
-$ PKG_CONFIG_PATH=/Users/smorlat/gtk/inst/lib/pkgconfig:/opt/local/lib/pkgconfig/ ./configure --disable-video --disable-gtk_ui --disable-strict
+$ PKG_CONFIG_PATH=$HOME/gtk/inst/lib/pkgconfig:/opt/local/lib/pkgconfig/ ./configure --disable-video --disable-strict
 
 
 
diff --git a/build/Makefile.am b/build/Makefile.am
new file mode 100644 (file)
index 0000000..84ac3e9
--- /dev/null
@@ -0,0 +1,2 @@
+SUBDIRS=macos
+
diff --git a/build/macos/Info-linphone.plist.in b/build/macos/Info-linphone.plist.in
new file mode 100644 (file)
index 0000000..8023a27
--- /dev/null
@@ -0,0 +1,31 @@
+<?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>@PACKAGE_VERSION@, (C) 2011 The linphone team http://www.linphone.org</string>
+    <key>CFBundleIconFile</key>
+    <string>linphone_logo.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>@PACKAGE_VERSION@</string>
+    <key>CFBundleSignature</key>
+    <string>????</string>
+    <key>CFBundleVersion</key>
+    <string>@PACKAGE_VERSION@</string>
+    <key>NSHumanReadableCopyright</key>
+    <string>Copyright 2011 Belledonne Communications</string>
+    <key>LSMinimumSystemVersion</key>
+    <string>10.4</string>
+</dict>
+</plist>
+
diff --git a/build/macos/Makefile.am b/build/macos/Makefile.am
new file mode 100644 (file)
index 0000000..5e2f376
--- /dev/null
@@ -0,0 +1,3 @@
+EXTRA_DIST=linphone.bundle.in environment.sh
+
+
diff --git a/build/macos/environment.sh b/build/macos/environment.sh
new file mode 100644 (file)
index 0000000..f331e77
--- /dev/null
@@ -0,0 +1,3 @@
+export EXTRA_ARGS="--workdir $bundle_res"
+unset GDK_PIXBUF_MODULE_FILE
+
diff --git a/build/macos/linphone.bundle b/build/macos/linphone.bundle
new file mode 100644 (file)
index 0000000..0777945
--- /dev/null
@@ -0,0 +1,160 @@
+<?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:JHBUILD_PREFIX}</prefix>
+    <prefix name="linphone">${env:LINPHONE_INSTALL_PREFIX}</prefix>
+    <prefix name="liblinphone">${env:LINPHONE_INSTALL_PREFIX}</prefix>
+    <prefix name="macports">/opt/local</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:HOME}/Desktop</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>
+
+  <!-- Liblinphone shared libraries -->
+  <binary>
+       ${prefix:liblinphone}/lib/*.*.dylib
+  </binary>
+  
+  <binary>
+    ${prefix:macports}/lib/libspeex.*.dylib
+  </binary>
+  
+  <binary>
+    ${prefix:macports}/lib/libosip.*.dylib
+  </binary>
+  
+  <binary>
+    ${prefix:macports}/lib/libeXosip.*.dylib
+  </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}/lib/gdk-pixbuf-2.0/*
+  </binary>
+
+  <!-- Copy in GTK+ theme engines. 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>
+
+  <!-- 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 dest="${bundle}/Contents/Resources/share/linphone">
+    ${prefix:linphone}/share/*
+  </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}/../../pixmaps/linphone_logo.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. -->
+
+  <!--data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">
+    ${project}/src/gtkrc
+  </data-->
+
+  <data dest="${bundle}/Contents/Resources/share/sounds/linphone">
+      ${prefix:linphone}/share/sounds/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>
+
index c4198463dbad3a5a14eef92d232b7bc938ee6e1d..66e65a12faee6f170a60b6d53454083e7763e5f1 100644 (file)
@@ -464,7 +464,10 @@ AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
 
 
 AC_OUTPUT([ 
-Makefile 
+Makefile
+build/Makefile
+build/macos/Makefile
+build/macos/Info-linphone.plist
 m4/Makefile
 po/Makefile.in
 pixmaps/Makefile
index 77689b39778150bb6463bffc94112b165ee7ab85..b35b8f4c49aa5a79148f4cac4e4b9aad62be7b28 100644 (file)
@@ -34,6 +34,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <sys/stat.h>
 #include <unistd.h>
 
+#ifdef WIN32
+#define chdir _chdir
+#endif
+
 #define LINPHONE_ICON "linphone.png"
 
 const char *this_program_ident_string="linphone_ident_string=" LINPHONE_VERSION;
@@ -60,9 +64,7 @@ static gboolean verbose=0;
 static gboolean auto_answer = 0;
 static gchar * addr_to_call = NULL;
 static gboolean iconified=FALSE;
-#ifdef WIN32
 static gchar *workingdir=NULL;
-#endif
 static char *progpath=NULL;
 
 static GOptionEntry linphone_options[]={
@@ -94,7 +96,6 @@ static GOptionEntry linphone_options[]={
            .arg_data = (gpointer) & auto_answer,
            .description = N_("if set automatically answer incoming calls")
        },
-#ifdef WIN32
        {
            .long_name = "workdir",
            .short_name = '\0',
@@ -102,7 +103,6 @@ static GOptionEntry linphone_options[]={
            .arg_data = (gpointer) & workingdir,
            .description = N_("Specifiy a working directory (should be the base of the installation, eg: c:\\Program Files\\Linphone)")
        },
-#endif
        {0}
 };
 
@@ -1331,9 +1331,9 @@ void linphone_gtk_log_handler(OrtpLogLevel lev, const char *fmt, va_list args){
        if (verbose){
                const char *lname="undef";
                char *msg;
-       #if defined(__linux) || defined(__APPLE__)
+#if defined(__linux) || defined(__APPLE__)
                va_list cap;/*copy of our argument list: a va_list cannot be re-used (SIGSEGV on linux 64 bits)*/
-               #endif
+#endif
                switch(lev){
                        case ORTP_DEBUG:
                                lname="debug";
@@ -1449,10 +1449,10 @@ int main(int argc, char *argv[]){
        g_type_class_unref (g_type_class_ref (GTK_TYPE_BUTTON));
        g_object_set(settings, "gtk-menu-images", TRUE, NULL);
        g_object_set(settings, "gtk-button-images", TRUE, NULL);
-#ifdef WIN32
+
        if (workingdir!=NULL)
-               _chdir(workingdir);
-#endif
+               chdir(workingdir);
+
        /* Now, look for the factory configuration file, we do it this late
                 since we want to have had time to change directory and to parse
                 the options, in case we needed to access the working directory */
@@ -1505,3 +1505,4 @@ int main(int argc, char *argv[]){
        free(progpath);
        return 0;
 }
+