From e511c67fa74162308c6986d05487fd633ff37da0 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 9 Jun 2013 21:03:53 -0400 Subject: New makefile 'osx-app' rule for building Textadept.app. Also added some OSX scripts from the bundle to the repository. Requires the latest "GTK+ for OSX bundle". --- scripts/gen_plist.lua | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100755 scripts/gen_plist.lua (limited to 'scripts/gen_plist.lua') diff --git a/scripts/gen_plist.lua b/scripts/gen_plist.lua new file mode 100755 index 00000000..fc47203c --- /dev/null +++ b/scripts/gen_plist.lua @@ -0,0 +1,93 @@ +#!/usr/bin/lua +-- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE. + +-- This script generates the "Info.plist" file for the Mac OSX App bundle. + +local lang, exts +local languages, extensions = {}, {} + +-- Read languages and extensions. +local f = io.open('../modules/textadept/mime_types.conf') +for line in f:lines() do + if line:find('^%%') then + lang, exts = line:match('^%%%s*(.+)$'), {} + if lang then languages[#languages + 1], extensions[lang] = lang, exts end + elseif line:find('^%a') then + exts[#exts + 1] = line:match('^%S+') + end +end +f:close() + +-- Generate and write the XML. +local xml = {[[ + + + + + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + ]]} +for i = 1, #languages do + lang, exts = languages[i], extensions[languages[i]] + if #exts > 0 then + xml[#xml + 1] = "\t\t" + xml[#xml + 1] = "\t\t\tCFBundleTypeExtensions" + xml[#xml + 1] = "\t\t\t" + for j = 1, #exts do + xml[#xml + 1] = "\t\t\t\t"..exts[j].."" + end + xml[#xml + 1] = "\t\t\t" + xml[#xml + 1] = "\t\t\tCFBundleTypeName" + xml[#xml + 1] = "\t\t\t"..lang.." source" + xml[#xml + 1] = "\t\t\tCFBundleTypeRole" + xml[#xml + 1] = "\t\t\tEditor" + xml[#xml + 1] = "\t\t" + end +end +xml[#xml + 1] = [[ + + CFBundleTypeExtensions + + * + + CFBundleTypeName + Document + CFBundleTypeRole + Editor + + + CFBundleTypeName + Document + CFBundleTypeOSTypes + + **** + + CFBundleTypeRole + Editor + + + CFBundleExecutable + textadept + CFBundleIconFile + textadept.icns + CFBundleIdentifier + com.textadept + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Textadept + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 7.0 alpha + NSHighResolutionCapable + + + +]] +f = io.open('../src/Info.plist', 'w') +f:write(table.concat(xml, '\n')) +f:close() -- cgit v1.2.3