summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.com>2013-05-21 19:17:00 (GMT)
committerThiago Santos <thiago.sousa.santos@collabora.com>2013-05-22 13:21:27 (GMT)
commita51230488ad79b7cd611ce6f490b0da6faaba896 (patch)
tree36d5b8ea1eeb31eb953146384ba5b3af6b48da61
parent47999f3b571897b68a13a209c257b4e3791ae96f (diff)
downloadcerbero-a51230488ad79b7cd611ce6f490b0da6faaba896.tar.gz
cerbero-a51230488ad79b7cd611ce6f490b0da6faaba896.tar.xz
xcode: modify ios base template to ship fontconfig conf and a font
adds the required files and also set a few required envvars that will allow the use of a tmp dir and fonts to be found.
-rw-r--r--data/xcode/templates/ios/GStreamer Base.xctemplate/TemplateInfo.plist60
-rw-r--r--data/xcode/templates/ios/GStreamer Base.xctemplate/fontconfig/fonts.conf126
-rw-r--r--data/xcode/templates/ios/GStreamer Base.xctemplate/fontconfig/fonts/Ubuntu-R.ttfbin0 -> 353824 bytes
-rw-r--r--data/xcode/templates/ios/GStreamer Base.xctemplate/gst_ios_init.c25
-rw-r--r--data/xcode/templates/ios/GStreamer Base.xctemplate/gst_ios_init.m47
-rw-r--r--recipes/gstreamer-ios-templates.recipe4
6 files changed, 210 insertions, 52 deletions
diff --git a/data/xcode/templates/ios/GStreamer Base.xctemplate/TemplateInfo.plist b/data/xcode/templates/ios/GStreamer Base.xctemplate/TemplateInfo.plist
index 30eff85..2a1b9fc 100644
--- a/data/xcode/templates/ios/GStreamer Base.xctemplate/TemplateInfo.plist
+++ b/data/xcode/templates/ios/GStreamer Base.xctemplate/TemplateInfo.plist
@@ -6,49 +6,59 @@
<string>com.gstreamersdk.ios.templates.base</string>
<key>Kind</key>
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
-
-<key>Definitions</key>
+ <key>Definitions</key>
<dict>
- <key>gst_ios_init.c</key>
+ <key>Ubuntu-R.ttf</key>
+ <dict>
+ <key>Path</key>
+ <string>fontconfig/fonts/Ubuntu-R.ttf</string>
+ <key>Group</key>
+ <string>Supporting Files</string>
+ </dict>
+ <key>fonts.conf</key>
+ <dict>
+ <key>Group</key>
+ <string>Supporting Files</string>
+ <key>Path</key>
+ <string>fontconfig/fonts.conf</string>
+ </dict>
+ <key>gst_ios_init.m</key>
<dict>
<key>Group</key>
- <string>Supporting Files</string>
+ <string>Supporting Files</string>
<key>Path</key>
- <string>gst_ios_init.c</string>
+ <string>gst_ios_init.m</string>
</dict>
<key>gst_ios_init.h</key>
<dict>
<key>Group</key>
- <string>Supporting Files</string>
+ <string>Supporting Files</string>
<key>Path</key>
- <string>gst_ios_init.h</string>
+ <string>gst_ios_init.h</string>
</dict>
<key>main.m</key>
<dict>
<key>Group</key>
- <string>Supporting Files</string>
+ <string>Supporting Files</string>
<key>Path</key>
- <string>main.m</string>
+ <string>main.m</string>
</dict>
</dict>
-<!-- Definitions End -->
-
-<!-- Nodes Begin -->
-<key>Nodes</key>
- <array>
- <string>gst_ios_init.c</string>
- <string>gst_ios_init.h</string>
- <string>main.m</string>
- </array>
-<!-- Nodes End -->
-
-<key>Targets</key>
+ <key>Nodes</key>
+ <array>
+ <string>fonts.conf</string>
+ <string>Ubuntu-R.ttf</string>
+ <string>gst_ios_init.m</string>
+ <string>gst_ios_init.h</string>
+ <string>main.m</string>
+ </array>
+ <key>Targets</key>
<array>
<dict>
<key>Frameworks</key>
- <array>
+ <array>
<string>GStreamer</string>
- </array>
+ </array>
<key>SharedSettings</key>
<dict>
<key>ARCHS</key>
@@ -56,9 +66,9 @@
<string>armv7</string>
</array>
<key>FRAMEWORK_SEARCH_PATHS</key>
- <string>"~/Library/Developer/GStreamer/iPhone.sdk"</string>
+ <string>&quot;~/Library/Developer/GStreamer/iPhone.sdk&quot;</string>
<key>HEADER_SEARCH_PATHS</key>
- <string>"~/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework/Headers"</string>
+ <string>&quot;~/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework/Headers&quot;</string>
<key>OTHER_LDFLAGS</key>
<string>-lresolv -lstdc++ -framework CoreFoundation -framework Foundation -framework AVFoundation -framework CoreMedia -framework CoreVideo -framework CoreAudio -framework AudioToolbox -framework OpenGLES -framework AssetsLibrary -framework QuartzCore -framework AssetsLibrary</string>
</dict>
diff --git a/data/xcode/templates/ios/GStreamer Base.xctemplate/fontconfig/fonts.conf b/data/xcode/templates/ios/GStreamer Base.xctemplate/fontconfig/fonts.conf
new file mode 100644
index 0000000..6b780ea
--- /dev/null
+++ b/data/xcode/templates/ios/GStreamer Base.xctemplate/fontconfig/fonts.conf
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- /etc/fonts/fonts.conf file to configure system font access -->
+<fontconfig>
+
+<!-- Font directory list -->
+
+ <dir prefix="xdg"></dir>
+
+<!-- Font cache directory list -->
+
+ <cachedir prefix="xdg"></cachedir>
+
+<!--
+ Accept deprecated 'mono' alias, replacing it with 'monospace'
+-->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>mono</string>
+ </test>
+ <edit name="family" mode="assign" binding="same">
+ <string>monospace</string>
+ </edit>
+ </match>
+
+<!--
+ Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
+-->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans serif</string>
+ </test>
+ <edit name="family" mode="assign" binding="same">
+ <string>sans-serif</string>
+ </edit>
+ </match>
+
+<!--
+ Accept deprecated 'sans' alias, replacing it with 'sans-serif'
+-->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans</string>
+ </test>
+ <edit name="family" mode="assign" binding="same">
+ <string>sans-serif</string>
+ </edit>
+ </match>
+
+ <config>
+<!--
+ These are the default Unicode chars that are expected to be blank
+ in fonts. All other blank chars are assumed to be broken and
+ won't appear in the resulting charsets
+ -->
+ <blank>
+ <int>0x0020</int> <!-- SPACE -->
+ <int>0x00A0</int> <!-- NO-BREAK SPACE -->
+ <int>0x00AD</int> <!-- SOFT HYPHEN -->
+ <int>0x034F</int> <!-- COMBINING GRAPHEME JOINER -->
+ <int>0x0600</int> <!-- ARABIC NUMBER SIGN -->
+ <int>0x0601</int> <!-- ARABIC SIGN SANAH -->
+ <int>0x0602</int> <!-- ARABIC FOOTNOTE MARKER -->
+ <int>0x0603</int> <!-- ARABIC SIGN SAFHA -->
+ <int>0x06DD</int> <!-- ARABIC END OF AYAH -->
+ <int>0x070F</int> <!-- SYRIAC ABBREVIATION MARK -->
+ <int>0x115F</int> <!-- HANGUL CHOSEONG FILLER -->
+ <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER -->
+ <int>0x1680</int> <!-- OGHAM SPACE MARK -->
+ <int>0x17B4</int> <!-- KHMER VOWEL INHERENT AQ -->
+ <int>0x17B5</int> <!-- KHMER VOWEL INHERENT AA -->
+ <int>0x180E</int> <!-- MONGOLIAN VOWEL SEPARATOR -->
+ <int>0x2000</int> <!-- EN QUAD -->
+ <int>0x2001</int> <!-- EM QUAD -->
+ <int>0x2002</int> <!-- EN SPACE -->
+ <int>0x2003</int> <!-- EM SPACE -->
+ <int>0x2004</int> <!-- THREE-PER-EM SPACE -->
+ <int>0x2005</int> <!-- FOUR-PER-EM SPACE -->
+ <int>0x2006</int> <!-- SIX-PER-EM SPACE -->
+ <int>0x2007</int> <!-- FIGURE SPACE -->
+ <int>0x2008</int> <!-- PUNCTUATION SPACE -->
+ <int>0x2009</int> <!-- THIN SPACE -->
+ <int>0x200A</int> <!-- HAIR SPACE -->
+ <int>0x200B</int> <!-- ZERO WIDTH SPACE -->
+ <int>0x200C</int> <!-- ZERO WIDTH NON-JOINER -->
+ <int>0x200D</int> <!-- ZERO WIDTH JOINER -->
+ <int>0x200E</int> <!-- LEFT-TO-RIGHT MARK -->
+ <int>0x200F</int> <!-- RIGHT-TO-LEFT MARK -->
+ <int>0x2028</int> <!-- LINE SEPARATOR -->
+ <int>0x2029</int> <!-- PARAGRAPH SEPARATOR -->
+ <int>0x202A</int> <!-- LEFT-TO-RIGHT EMBEDDING -->
+ <int>0x202B</int> <!-- RIGHT-TO-LEFT EMBEDDING -->
+ <int>0x202C</int> <!-- POP DIRECTIONAL FORMATTING -->
+ <int>0x202D</int> <!-- LEFT-TO-RIGHT OVERRIDE -->
+ <int>0x202E</int> <!-- RIGHT-TO-LEFT OVERRIDE -->
+ <int>0x202F</int> <!-- NARROW NO-BREAK SPACE -->
+ <int>0x205F</int> <!-- MEDIUM MATHEMATICAL SPACE -->
+ <int>0x2060</int> <!-- WORD JOINER -->
+ <int>0x2061</int> <!-- FUNCTION APPLICATION -->
+ <int>0x2062</int> <!-- INVISIBLE TIMES -->
+ <int>0x2063</int> <!-- INVISIBLE SEPARATOR -->
+ <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING -->
+ <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING -->
+ <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING -->
+ <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING -->
+ <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES -->
+ <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES -->
+ <int>0x2800</int> <!-- BRAILLE PATTERN BLANK -->
+ <int>0x3000</int> <!-- IDEOGRAPHIC SPACE -->
+ <int>0x3164</int> <!-- HANGUL FILLER -->
+ <int>0xFEFF</int> <!-- ZERO WIDTH NO-BREAK SPACE -->
+ <int>0xFFA0</int> <!-- HALFWIDTH HANGUL FILLER -->
+ <int>0xFFF9</int> <!-- INTERLINEAR ANNOTATION ANCHOR -->
+ <int>0xFFFA</int> <!-- INTERLINEAR ANNOTATION SEPARATOR -->
+ <int>0xFFFB</int> <!-- INTERLINEAR ANNOTATION TERMINATOR -->
+ </blank>
+<!--
+ Rescan configuration every 30 seconds when FcFontSetList is called
+ -->
+ <rescan>
+ <int>30</int>
+ </rescan>
+ </config>
+
+</fontconfig>
+
diff --git a/data/xcode/templates/ios/GStreamer Base.xctemplate/fontconfig/fonts/Ubuntu-R.ttf b/data/xcode/templates/ios/GStreamer Base.xctemplate/fontconfig/fonts/Ubuntu-R.ttf
new file mode 100644
index 0000000..45a038b
--- /dev/null
+++ b/data/xcode/templates/ios/GStreamer Base.xctemplate/fontconfig/fonts/Ubuntu-R.ttf
Binary files differ
diff --git a/data/xcode/templates/ios/GStreamer Base.xctemplate/gst_ios_init.c b/data/xcode/templates/ios/GStreamer Base.xctemplate/gst_ios_init.c
deleted file mode 100644
index 1fef31b..0000000
--- a/data/xcode/templates/ios/GStreamer Base.xctemplate/gst_ios_init.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "gst_ios_init.h"
-
-@GST_IOS_PLUGINS_DECLARE@
-
-void
-gst_ios_init (void)
-{
- GstPluginFeature *plugin;
- GstRegistry *reg;
-
- gst_init (NULL, NULL);
-
- @GST_IOS_PLUGINS_REGISTER@
-
-
- /* Lower the ranks of filesrc and giosrc so iosavassetsrc is
- * tried first in gst_element_make_from_uri() for file:// */
- reg = gst_registry_get_default();
- plugin = gst_registry_lookup_feature(reg, "filesrc");
- if (plugin)
- gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY);
- plugin = gst_registry_lookup_feature(reg, "giosrc");
- if (plugin)
- gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY-1);
-}
diff --git a/data/xcode/templates/ios/GStreamer Base.xctemplate/gst_ios_init.m b/data/xcode/templates/ios/GStreamer Base.xctemplate/gst_ios_init.m
new file mode 100644
index 0000000..b143264
--- /dev/null
+++ b/data/xcode/templates/ios/GStreamer Base.xctemplate/gst_ios_init.m
@@ -0,0 +1,47 @@
+#include "gst_ios_init.h"
+
+@GST_IOS_PLUGINS_DECLARE@
+
+void
+gst_ios_init (void)
+{
+ GstPluginFeature *plugin;
+ GstRegistry *reg;
+ NSString *resources = [[NSBundle mainBundle] resourcePath];
+ NSString *tmp = NSTemporaryDirectory();
+ NSString *cache = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"];
+ NSString *docs = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
+
+ const gchar *resources_dir = [resources UTF8String];
+ const gchar *tmp_dir = [tmp UTF8String];
+ const gchar *cache_dir = [cache UTF8String];
+ const gchar *docs_dir = [docs UTF8String];
+
+ g_setenv ("TMP", tmp_dir, TRUE);
+ g_setenv ("TEMP", tmp_dir, TRUE);
+ g_setenv ("TMPDIR", tmp_dir, TRUE);
+ g_setenv ("XDG_RUNTIME_DIR", resources_dir, TRUE);
+ g_setenv ("XDG_CACHE_DIR", cache_dir, TRUE);
+
+ g_setenv ("HOME", docs_dir, TRUE);
+ g_setenv ("XDG_DATA_DIRS", resources_dir, TRUE);
+ g_setenv ("XDG_CONFIG_DIRS", resources_dir, TRUE);
+ g_setenv ("XDG_CONFIG_HOME", cache_dir, TRUE);
+ g_setenv ("XDG_DATA_HOME", resources_dir, TRUE);
+ g_setenv ("FONTCONFIG_PATH", resources_dir, TRUE);
+
+ gst_init (NULL, NULL);
+
+ @GST_IOS_PLUGINS_REGISTER@
+
+
+ /* Lower the ranks of filesrc and giosrc so iosavassetsrc is
+ * tried first in gst_element_make_from_uri() for file:// */
+ reg = gst_registry_get_default();
+ plugin = gst_registry_lookup_feature(reg, "filesrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY);
+ plugin = gst_registry_lookup_feature(reg, "giosrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY-1);
+}
diff --git a/recipes/gstreamer-ios-templates.recipe b/recipes/gstreamer-ios-templates.recipe
index 8b10997..d97897a 100644
--- a/recipes/gstreamer-ios-templates.recipe
+++ b/recipes/gstreamer-ios-templates.recipe
@@ -47,9 +47,9 @@ class Recipe(recipe.Recipe):
decls.append(DEFINES_TPL % (p_up, c, DECLARE_PLUGIN_TPL % p))
regs.append(DEFINES_TPL % (p_up, c, REGISTER_PLUGIN_TPL % p))
tpl_dir = os.path.join(share_dir, 'GStreamer Base.xctemplate')
- iosinit_c = os.path.join(tpl_dir, 'gst_ios_init.c')
+ iosinit_m = os.path.join(tpl_dir, 'gst_ios_init.m')
iosinit_h = os.path.join(tpl_dir, 'gst_ios_init.h')
shell.replace (iosinit_h, {'@GST_IOS_PLUGINS_CATEGORIES@': categories})
- shell.replace (iosinit_c, {
+ shell.replace (iosinit_m, {
'@GST_IOS_PLUGINS_DECLARE@': '\n'.join(decls),
'@GST_IOS_PLUGINS_REGISTER@': '\n'.join(regs)})