Revision 3317

View differences:

makeosx.sh
1
#!/bin/sh
2

  
3
./configure --prefix=$HOME/gtk/inst \
4
  --with-localedir=Contents/Resources/share/locale \
5
  --with-themedir=Contents/Resources/share/icons \
6
  && make \
7
  && make install-strip \
8
  && (cd plugin/attachment_tool; make install-plugin)
0 9

  
src/main.c
1428 1428
			   NULL);
1429 1429
	syl_plugin_load_all(path);
1430 1430
	g_free(path);
1431
#elif defined(__APPLE__)
1432
	path = g_strconcat(get_startup_dir(), G_DIR_SEPARATOR_S,
1433
			   "Contents" G_DIR_SEPARATOR_S
1434
			   "Resources" G_DIR_SEPARATOR_S
1435
			   "lib" G_DIR_SEPARATOR_S
1436
			   "sylpheed" G_DIR_SEPARATOR_S
1437
			   PLUGIN_DIR,
1438
			   NULL);
1439
	syl_plugin_load_all(path);
1440
	g_free(path);
1431 1441
#else
1432 1442
	syl_plugin_load_all(PLUGINDIR);
1433 1443
#endif
src/manual.c
65 65
			       get_startup_dir(),
66 66
			       G_DIR_SEPARATOR_S "doc" G_DIR_SEPARATOR_S
67 67
			       "manual",
68
#elif defined(__APPLE__)
69
			       get_startup_dir(),
70
			       G_DIR_SEPARATOR_S "Contents" G_DIR_SEPARATOR_S
71
			       "Resources" G_DIR_SEPARATOR_S
72
			       "share" G_DIR_SEPARATOR_S
73
			       "sylpheed" G_DIR_SEPARATOR_S
74
			       "manual",
68 75
#else
69 76
			       MANUALDIR,
70 77
#endif
......
87 94
#ifdef G_OS_WIN32
88 95
			       get_startup_dir(),
89 96
			       G_DIR_SEPARATOR_S "doc" G_DIR_SEPARATOR_S "faq",
97
#elif defined(__APPLE__)
98
			       get_startup_dir(),
99
			       G_DIR_SEPARATOR_S "Contents" G_DIR_SEPARATOR_S
100
			       "Resources" G_DIR_SEPARATOR_S
101
			       "share" G_DIR_SEPARATOR_S
102
			       "sylpheed" G_DIR_SEPARATOR_S
103
			       "faq",
90 104
#else
91 105
			       FAQDIR,
92 106
#endif
configure.in
488 488
manual/en/Makefile
489 489
manual/ja/Makefile
490 490
nsis/Makefile
491
macosx/Makefile
492
macosx/bundle/Makefile
491 493
])
492 494

  
493 495
dnl Output the configuration summary
ChangeLog
1
2013-12-19
2

  
3
	* src/main.c
4
	  src/manual.c: OS X: modified for bundle folder structure.
5
	* makeosx.sh: OS X: added build script for OS X.
6
	* macosx/bundle: OS X: added files for gtk-mac-bundler.
7

  
1 8
2013-12-13
2 9

  
3 10
	* libsylph/utils.c: set_startup_dir(): OS X: set application bundle
macosx/Makefile.am
1
SUBDIRS = bundle
macosx/bundle/Info-sylpheed.plist
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
<plist version="1.0">
4
<dict>
5
    <key>CFBundleDevelopmentRegion</key>
6
    <string>English</string>
7
    <key>CFBundleExecutable</key>
8
    <string>Sylpheed</string>
9
    <key>CFBundleGetInfoString</key>
10
    <string>3.4beta7, (C) 1999-2013 Sylpheed Development Team http://sylpheed.sraoss.jp</string>
11
    <key>CFBundleIconFile</key>
12
    <string>sylpheed.icns</string>
13
    <key>CFBundleIdentifier</key>
14
    <string>jp.sraoss.sylpheed.sylpheed</string>
15
    <key>CFBundleInfoDictionaryVersion</key>
16
    <string>6.0</string>
17
    <key>CFBundlePackageType</key>
18
    <string>APPL</string>
19
    <key>CFBundleShortVersionString</key>
20
    <string>3.4</string>
21
    <key>CFBundleSignature</key>
22
    <string>????</string>
23
    <key>CFBundleVersion</key>
24
    <string>3.4</string>
25
    <key>NSHumanReadableCopyright</key>
26
    <string>Copyright 1999-2013 Sylpheed Development Team</string>
27
    <key>LSMinimumSystemVersion</key>
28
    <string>10.6</string>
29
</dict>
30
</plist>
macosx/bundle/sylpheed.bundle
1
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
2
<app-bundle>
3

  
4
  <meta>
5
    <!-- Where to pick up the GTK+ installation, icon themes,
6
         etc. Note that "${env:JHBUILD_PREFIX}" is evaluated to the
7
         value of the environment variable JHBUILD_PREFIX. You can
8
         define additional prefixes and refer to them in paths
9
         throughout this file on the form "${prefix:name}". This is
10
         useful for installing certain libraries or even the
11
         application itself separately. Note that JHBUILD_PREFIX is
12
         defined by jhbuild, so it you are not using jhbuild you can
13
         either define your own or just hardcode the path here.
14
    -->
15
    <prefix name="default">${env:JHBUILD_PREFIX}</prefix>
16

  
17
    <!-- The project directory is the default location of the created
18
         app. If you leave out the path, the current directory is
19
         used. Note the usage of an environment variable here again.
20
    -->
21
    <destination overwrite="yes">${env:HOME}/Desktop</destination>
22

  
23
    <image>
24
      <!-- Not implemented yet (DMG image). -->
25
    </image>
26

  
27
    <!-- Comment this out to keep the install names in binaries -->
28
    <run-install-name-tool/>
29
 
30
    <!-- Optionally specify a launcher script to use. If the
31
         application sets up everything needed itself, like
32
         environment variable, linker paths, etc, a launcher script is
33
         not needed. If the source path is left out, the default
34
         script will be used.
35
    -->
36
    <launcher-script>${project}/launcher.sh</launcher-script >
37

  
38
    <!-- Not implemented: Optional runtime, could be python or mono
39
         for example.
40
    -->
41
    <!-- runtime copy="yes">/usr/bin/python</runtime -->
42
    <!-- Indicate the active gtk version to use. This is needed only
43
         for gtk+-3.0 projects. -->
44
    <gtk>gtk+-2.0</gtk>
45
  </meta>
46

  
47
  <!-- The special macro "${project}" refers to the directory where
48
       this bundle file is located. The application name and bundle
49
       identifier are taken from the plist file.
50
  -->
51
  <plist>${project}/Info-sylpheed.plist</plist>
52

  
53
  <main-binary>${prefix}/bin/sylpheed</main-binary>
54

  
55
  <!-- Copy in GTK+ modules.  Note the ${gtkdir} macro, which expands
56
       to the correct library subdirectory for the specified gtk
57
       version.
58
  -->
59
  <binary>
60
     ${prefix}/lib/${gtkdir}/modules/*.so
61
  </binary>
62

  
63
  <!-- Copy in GTK+ theme engines and print backends. Note the use of the
64
       "${pkg:module:variable}" macro, which evaluates to a pkg-config
65
       variable in the specified module. Note that any libraries that
66
       binaries link to are also copied in automatically.  Note also
67
       the included ${gtk} macro, which gets the correct package name
68
       to get. -->
69
  <binary>
70
    ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/*.so
71
  </binary>
72
  <binary>
73
    ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so
74
  </binary>
75
  <binary>
76
    ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so
77
  </binary>
78

  
79
<!-- Starting with 2.24, gdk-pixbuf installs into its own directory. -->
80
  <binary>
81
    ${prefix}/lib/gdk-pixbuf-2.0/${pkg:${gtk}:gtk_binary_version}/loaders/*.so
82
  </binary>
83

  
84
  <binary>
85
     ${prefix}/lib/sylpheed/plugins/*.so
86
  </binary>
87

  
88
  <!-- Translation filenames, one for each program or library that you
89
       want to copy in to the bundle. The "dest" attribute is
90
       optional, as usual. Bundler will find all translations of that
91
       library/program under the indicated directory and copy them.-->
92
  <translations name="gtk20">
93
    ${prefix}/share/locale
94
  </translations>
95
  <translations name="sylpheed">
96
    ${prefix}/share/locale
97
  </translations>
98

  
99

  
100
  <!-- Data to copy in, usually Glade/UI files, images, sounds files
101
       etc. The destination inside the bundle can be specified if the
102
       files should end up at a different location, by using the
103
       "dest" property. The destination must then start with the macro
104
       "${bundle}", which refers to the bundle root directory.
105
  -->
106
  <data>
107
    ${prefix}/share/sylpheed
108
  </data>
109
  <!-- data>
110
    ${prefix}/share/pixmaps
111
  </data -->
112

  
113
  <!-- Copy in the themes data. You may want to trim this to save space
114
       in your bundle. -->
115
  <data>
116
    ${prefix}/share/themes
117
  </data>
118

  
119
  <!-- Copy icons. Note that the .icns file is an Apple format which
120
       contains up to 4 sizes of icon. You can use
121
       /Developer/Applications/Utilities/Icon Composer.app to import
122
       artwork and create the file. -->
123
  <data dest="${bundle}/Contents/Resources">
124
    ${project}/sylpheed.icns
125
  </data>
126

  
127
  <!-- This is where theme commands go. You can copy them in from your
128
       theme of choice if they provide and example, or you can just
129
       change the source path. -->
130

  
131
  <data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">
132
    ${project}/gtkrc
133
  </data>
134

  
135
  <!-- Icon themes to copy. The "icons" property can be either of
136
       "auto", "all", or "none". All or none should be
137
       self-explanatory, while auto means that the script will try to
138
       figure out which icons are needed. This is done by getting all
139
       the strings from all copied binaries, and matching them against
140
       icon names. To be safe, you should use "all". "none" is useful
141
       if you want just the index.theme file but no icons, mostly
142
       needed for the "hicolor" base theme.
143
  >
144
  <icon-theme icons="auto">
145
    Tango
146
  </icon-theme -->
147

  
148
</app-bundle>
macosx/bundle/Makefile.am
1
EXTRA_DIST = \
2
	Info-sylpheed.plist \
3
	Makefile.am \
4
	README.txt \
5
	gtkrc \
6
	launcher.sh \
7
	sylpheed.bundle \
8
	sylpheed.icns
macosx/bundle/gtkrc
1
gtk-icon-theme-name = "Tango"
2
gtk-enable-mnemonics = 0
macosx/bundle/launcher.sh
1
#!/bin/sh
2

  
3
if test "x$GTK_DEBUG_LAUNCHER" != x; then
4
    set -x
5
fi
6

  
7
if test "x$GTK_DEBUG_GDB" != x; then
8
    EXEC="gdb --args"
9
else
10
    EXEC=exec
11
fi
12

  
13
name=`basename "$0"`
14
tmp="$0"
15
tmp=`dirname "$tmp"`
16
tmp=`dirname "$tmp"`
17
bundle=`dirname "$tmp"`
18
bundle_contents="$bundle"/Contents
19
bundle_res="$bundle_contents"/Resources
20
bundle_lib="$bundle_res"/lib
21
bundle_bin="$bundle_res"/bin
22
bundle_data="$bundle_res"/share
23
bundle_etc="$bundle_res"/etc
24

  
25
export DYLD_LIBRARY_PATH="$bundle_lib"
26
export XDG_CONFIG_DIRS="$bundle_etc"/xdg
27
export XDG_DATA_DIRS="$bundle_data"
28
export GTK_DATA_PREFIX="$bundle_res"
29
export GTK_EXE_PREFIX="$bundle_res"
30
export GTK_PATH="$bundle_res"
31

  
32
export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc"
33
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
34
export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
35
export PANGO_RC_FILE="$bundle_etc/pango/pangorc"
36

  
37
APP=sylpheed
38
I18NDIR="$bundle_data/locale"
39
# Set the locale-related variables appropriately:
40
unset LANG LC_MESSAGES LC_MONETARY LC_COLLATE
41

  
42
# Has a language ordering been set?
43
# If so, set LC_MESSAGES and LANG accordingly; otherwise skip it.
44
# First step uses sed to clean off the quotes and commas, to change - to _, and change the names for the chinese scripts from "Hans" to CN and "Hant" to TW.
45
APPLELANGUAGES=`defaults read .GlobalPreferences AppleLanguages | sed -En   -e 's/\-/_/' -e 's/Hant/TW/' -e 's/Hans/CN/' -e 's/[[:space:]]*\"?([[:alnum:]_]+)\"?,?/\1/p' `
46
if test "$APPLELANGUAGES"; then
47
    # A language ordering exists.
48
    # Test, item per item, to see whether there is an corresponding locale.
49
    for L in $APPLELANGUAGES; do
50
	#test for exact matches:
51
       if test -f "$I18NDIR/${L}/LC_MESSAGES/$APP.mo"; then
52
	    export LANG=$L
53
            break
54
        fi
55
	#This is a special case, because often the original strings are in US
56
	#English and there is no translation file.
57
	if test "x$L" == "xen_US"; then
58
	    export LANG=$L
59
	    break
60
	fi
61
	#OK, now test for just the first two letters:
62
        if test -f "$I18NDIR/${L:0:2}/LC_MESSAGES/$APP.mo"; then
63
	    export LANG=${L:0:2}
64
	    break
65
	fi
66
	#Same thing, but checking for any english variant.
67
	if test "x${L:0:2}" == "xen"; then
68
	    export LANG=$L
69
	    break
70
	fi;
71
    done  
72
fi
73
unset APPLELANGUAGES L
74

  
75
# If we didn't get a language from the language list, try the Collation preference, in case it's the only setting that exists.
76
APPLECOLLATION=`defaults read .GlobalPreferences AppleCollationOrder`
77
if test -z ${LANG} -a -n $APPLECOLLATION; then
78
    if test -f "$I18NDIR/${APPLECOLLATION:0:2}/LC_MESSAGES/$APP.mo"; then
79
	export LANG=${APPLECOLLATION:0:2}
80
    fi
81
fi
82
if test ! -z $APPLECOLLATION; then
83
    export LC_COLLATE=$APPLECOLLATION
84
fi
85
unset APPLECOLLATION
86

  
87
# Continue by attempting to find the Locale preference.
88
APPLELOCALE=`defaults read .GlobalPreferences AppleLocale`
89

  
90
if test -f "$I18NDIR/${APPLELOCALE:0:5}/LC_MESSAGES/$APP.mo"; then
91
    if test -z $LANG; then 
92
        export LANG="${APPLELOCALE:0:5}"
93
    fi
94

  
95
elif test -z $LANG -a -f "$I18NDIR/${APPLELOCALE:0:2}/LC_MESSAGES/$APP.mo"; then
96
    export LANG="${APPLELOCALE:0:2}"
97
fi
98

  
99
#Next we need to set LC_MESSAGES. If at all possilbe, we want a full
100
#5-character locale to avoid the "Locale not supported by C library"
101
#warning from Gtk -- even though Gtk will translate with a
102
#two-character code.
103
if test -n $LANG; then 
104
#If the language code matches the applelocale, then that's the message
105
#locale; otherwise, if it's longer than two characters, then it's
106
#probably a good message locale and we'll go with it.
107
    if test $LANG == ${APPLELOCALE:0:5} -o $LANG != ${LANG:0:2}; then
108
	export LC_MESSAGES=$LANG
109
#Next try if the Applelocale is longer than 2 chars and the language
110
#bit matches $LANG
111
    elif test $LANG == ${APPLELOCALE:0:2} -a $APPLELOCALE > ${APPLELOCALE:0:2}; then
112
	export LC_MESSAGES=${APPLELOCALE:0:5}
113
#Fail. Get a list of the locales in $PREFIX/share/locale that match
114
#our two letter language code and pick the first one, special casing
115
#english to set en_US
116
    elif test $LANG == "en"; then
117
	export LC_MESSAGES="en_US"
118
    else
119
	LOC=`find $PREFIX/share/locale -name $LANG???`
120
	for L in $LOC; do 
121
	    export LC_MESSAGES=$L
122
	done
123
    fi
124
else
125
#All efforts have failed, so default to US english
126
    export LANG="en_US"
127
    export LC_MESSAGES="en_US"
128
fi
129
CURRENCY=`echo $APPLELOCALE |  sed -En 's/.*currency=([[:alpha:]]+).*/\1/p'`
130
if test "x$CURRENCY" != "x"; then 
131
#The user has set a special currency. Gtk doesn't install LC_MONETARY files, but Apple does in /usr/share/locale, so we're going to look there for a locale to set LC_CURRENCY to.
132
    if test -f /usr/local/share/$LC_MESSAGES/LC_MONETARY; then
133
	if test -a `cat /usr/local/share/$LC_MESSAGES/LC_MONETARY` == $CURRENCY; then
134
	    export LC_MONETARY=$LC_MESSAGES
135
	fi
136
    fi
137
    if test -z "$LC_MONETARY"; then 
138
	FILES=`find /usr/share/locale -name LC_MONETARY -exec grep -H $CURRENCY {} \;`
139
	if test -n "$FILES"; then 
140
	    export LC_MONETARY=`echo $FILES | sed -En 's%/usr/share/locale/([[:alpha:]_]+)/LC_MONETARY.*%\1%p'`
141
	fi
142
    fi
143
fi
144
#No currency value means that the AppleLocale governs:
145
if test -z "$LC_MONETARY"; then
146
    LC_MONETARY=${APPLELOCALE:0:5}
147
fi
148
#For Gtk, which only looks at LC_ALL:
149
export LC_ALL=$LC_MESSAGES
150

  
151
unset APPLELOCALE FILES LOC
152

  
153
if test -f "$bundle_lib/charset.alias"; then
154
    export CHARSETALIASDIR="$bundle_lib"
155
fi
156

  
157
# Extra arguments can be added in environment.sh.
158
EXTRA_ARGS=
159
if test -f "$bundle_res/environment.sh"; then
160
  source "$bundle_res/environment.sh"
161
fi
162

  
163
# Strip out the argument added by the OS.
164
if /bin/expr "x$1" : '^x-psn_' > /dev/null; then
165
    shift 1
166
fi
167

  
168
$EXEC "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
0 169

  
macosx/bundle/README.txt
1
Gtk Mac Bundler files to create application bundle
2
==================================================
3

  
4
1. Install GTK+ and Sylpheed with jhbuild.
5

  
6
2. Install gtk-mac-bundler.
7

  
8
3. Run the following commands in this folder:
9

  
10
$ jhbuild shell
11
$ gtk-mac-bundler sylpheed.bundle
12

  
13
4. If successful, Sylpheed.app will be created on Desktop.
Makefile.am
1
SUBDIRS = ac libsylph src plugin po manual faq nsis
1
SUBDIRS = ac libsylph src plugin po manual faq nsis macosx
2 2

  
3 3
EXTRA_DIST = config.rpath  \
4 4
	ChangeLog.ja \
......
20 20
	sylpheed-128x128.png \
21 21
	sylpheed-64x64.png \
22 22
	autogen.sh \
23
	makeosx.sh \
23 24
	makewin32.sh \
24 25
	mime.types \
25 26
	sylpheed-mailto-protocol_admin.reg \

Also available in: Unified diff