summaryrefslogtreecommitdiffstats
path: root/packaging/macosx/ScriptExec
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-10-17 20:03:14 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-10-17 20:03:14 +0000
commit4fc13b246c0c03c26c10c421c63c33331aa57d85 (patch)
tree82f8ceea42ace9c0512b6073935e4bd9c3d14f7a /packaging/macosx/ScriptExec
parentSmall warning cleanup (diff)
parentPort inkscape to librevenge framework for WPG, CDR and VSD imports (diff)
downloadinkscape-4fc13b246c0c03c26c10c421c63c33331aa57d85.tar.gz
inkscape-4fc13b246c0c03c26c10c421c63c33331aa57d85.zip
Update to trunk r13621
(bzr r13341.1.278)
Diffstat (limited to 'packaging/macosx/ScriptExec')
-rw-r--r--packaging/macosx/ScriptExec/ScriptExec.xcode/project.pbxproj451
-rw-r--r--packaging/macosx/ScriptExec/ScriptExec.xcodeproj/project.pbxproj24
-rwxr-xr-xpackaging/macosx/ScriptExec/launcher-quartz-no-macintegration.sh169
-rw-r--r--packaging/macosx/ScriptExec/main.c274
4 files changed, 220 insertions, 698 deletions
diff --git a/packaging/macosx/ScriptExec/ScriptExec.xcode/project.pbxproj b/packaging/macosx/ScriptExec/ScriptExec.xcode/project.pbxproj
deleted file mode 100644
index bc081d5ef..000000000
--- a/packaging/macosx/ScriptExec/ScriptExec.xcode/project.pbxproj
+++ /dev/null
@@ -1,451 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 39;
- objects = {
- 0249A66BFF388E3F11CA2CEA = {
- isa = PBXFileReference;
- lastKnownFileType = archive.ar;
- name = "libstdc++.a";
- path = "/usr/lib/libstdc++.a";
- refType = 0;
- sourceTree = "<absolute>";
- };
-//020
-//021
-//022
-//023
-//024
-//080
-//081
-//082
-//083
-//084
- 0867D6AAFE840B52C02AAC07 = {
- children = (
- 0867D6ABFE840B52C02AAC07,
- );
- isa = PBXVariantGroup;
- name = InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- 0867D6ABFE840B52C02AAC07 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = English;
- path = English.lproj/InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
-//080
-//081
-//082
-//083
-//084
-//190
-//191
-//192
-//193
-//194
- 195DF8CFFE9D517E11CA2CBB = {
- children = (
- 8D0C4E970486CD37000505A6,
- );
- isa = PBXGroup;
- name = Products;
- refType = 4;
- sourceTree = "<group>";
- };
-//190
-//191
-//192
-//193
-//194
-//200
-//201
-//202
-//203
-//204
- 20286C28FDCF999611CA2CEA = {
- buildSettings = {
- };
- buildStyles = (
- 4A9504C5FFE6A39111CA0CBA,
- 4A9504C6FFE6A39111CA0CBA,
- );
- hasScannedForEncodings = 1;
- isa = PBXProject;
- mainGroup = 20286C29FDCF999611CA2CEA;
- projectDirPath = "";
- targets = (
- 8D0C4E890486CD37000505A6,
- );
- };
- 20286C29FDCF999611CA2CEA = {
- children = (
- 20286C2AFDCF999611CA2CEA,
- 20286C2CFDCF999611CA2CEA,
- 20286C32FDCF999611CA2CEA,
- 195DF8CFFE9D517E11CA2CBB,
- );
- isa = PBXGroup;
- name = ScriptExec;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 20286C2AFDCF999611CA2CEA = {
- children = (
- 32DBCF6D0370B57F00C91783,
- 20286C2BFDCF999611CA2CEA,
- );
- isa = PBXGroup;
- name = Sources;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 20286C2BFDCF999611CA2CEA = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = main.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 20286C2CFDCF999611CA2CEA = {
- children = (
- 664C29F0060ECDC4006EC560,
- B8DCE042056DAC3500C390B0,
- 8D0C4E960486CD37000505A6,
- B8DCE048056DAC5000C390B0,
- 0867D6AAFE840B52C02AAC07,
- );
- isa = PBXGroup;
- name = Resources;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 20286C32FDCF999611CA2CEA = {
- children = (
- 20286C33FDCF999611CA2CEA,
- 4A9504CAFFE6A41611CA0CBA,
- 4A9504C8FFE6A3BC11CA0CBA,
- 0249A66BFF388E3F11CA2CEA,
- B8DCE04E056DACAE00C390B0,
- );
- isa = PBXGroup;
- name = "External Frameworks and Libraries";
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 20286C33FDCF999611CA2CEA = {
- fallbackIsa = PBXFileReference;
- isa = PBXFrameworkReference;
- lastKnownFileType = wrapper.framework;
- name = Carbon.framework;
- path = /System/Library/Frameworks/Carbon.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
-//200
-//201
-//202
-//203
-//204
-//320
-//321
-//322
-//323
-//324
- 32DBCF6D0370B57F00C91783 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = ScriptExec_Prefix.pch;
- refType = 4;
- sourceTree = "<group>";
- };
-//320
-//321
-//322
-//323
-//324
-//4A0
-//4A1
-//4A2
-//4A3
-//4A4
- 4A9504C5FFE6A39111CA0CBA = {
- buildRules = (
- );
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- DEBUGGING_SYMBOLS = YES;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- OPTIMIZATION_CFLAGS = "-O0";
- ZERO_LINK = YES;
- };
- isa = PBXBuildStyle;
- name = Development;
- };
- 4A9504C6FFE6A39111CA0CBA = {
- buildRules = (
- );
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- GCC_OPTIMIZATION_LEVEL = s;
- ZERO_LINK = NO;
- };
- isa = PBXBuildStyle;
- name = Deployment;
- };
- 4A9504C8FFE6A3BC11CA0CBA = {
- fallbackIsa = PBXFileReference;
- isa = PBXFrameworkReference;
- lastKnownFileType = wrapper.framework;
- name = ApplicationServices.framework;
- path = /System/Library/Frameworks/ApplicationServices.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- 4A9504CAFFE6A41611CA0CBA = {
- fallbackIsa = PBXFileReference;
- isa = PBXFrameworkReference;
- lastKnownFileType = wrapper.framework;
- name = CoreServices.framework;
- path = /System/Library/Frameworks/CoreServices.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
-//4A0
-//4A1
-//4A2
-//4A3
-//4A4
-//660
-//661
-//662
-//663
-//664
- 664C29F0060ECDC4006EC560 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.script.sh;
- path = openDoc;
- refType = 4;
- sourceTree = "<group>";
- };
- 664C29F1060ECDC4006EC560 = {
- fileRef = 664C29F0060ECDC4006EC560;
- isa = PBXBuildFile;
- settings = {
- };
- };
-//660
-//661
-//662
-//663
-//664
-//8D0
-//8D1
-//8D2
-//8D3
-//8D4
- 8D0C4E890486CD37000505A6 = {
- buildPhases = (
- 8D0C4E8A0486CD37000505A6,
- 8D0C4E8C0486CD37000505A6,
- 8D0C4E8F0486CD37000505A6,
- 8D0C4E910486CD37000505A6,
- 8D0C4E940486CD37000505A6,
- );
- buildRules = (
- );
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = "";
- GCC_ENABLE_TRIGRAPHS = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = ScriptExec_Prefix.pch;
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
- GCC_WARN_UNKNOWN_PRAGMAS = NO;
- HEADER_SEARCH_PATHS = "";
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "$(HOME)/Applications";
- LIBRARY_SEARCH_PATHS = "";
- LIBRARY_STYLE = Static;
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = ScriptExec;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = app;
- };
- dependencies = (
- );
- isa = PBXNativeTarget;
- name = ScriptExec;
- productInstallPath = "$(HOME)/Applications";
- productName = ScriptExec;
- productReference = 8D0C4E970486CD37000505A6;
- productType = "com.apple.product-type.application";
- };
- 8D0C4E8A0486CD37000505A6 = {
- buildActionMask = 2147483647;
- files = (
- 8D0C4E8B0486CD37000505A6,
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 8D0C4E8B0486CD37000505A6 = {
- fileRef = 32DBCF6D0370B57F00C91783;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 8D0C4E8C0486CD37000505A6 = {
- buildActionMask = 2147483647;
- files = (
- 8D0C4E8D0486CD37000505A6,
- B8DCE045056DAC3500C390B0,
- B8DCE049056DAC5000C390B0,
- 664C29F1060ECDC4006EC560,
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 8D0C4E8D0486CD37000505A6 = {
- fileRef = 0867D6AAFE840B52C02AAC07;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 8D0C4E8F0486CD37000505A6 = {
- buildActionMask = 2147483647;
- files = (
- 8D0C4E900486CD37000505A6,
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 8D0C4E900486CD37000505A6 = {
- fileRef = 20286C2BFDCF999611CA2CEA;
- isa = PBXBuildFile;
- settings = {
- ATTRIBUTES = (
- );
- };
- };
- 8D0C4E910486CD37000505A6 = {
- buildActionMask = 2147483647;
- files = (
- 8D0C4E920486CD37000505A6,
- 8D0C4E930486CD37000505A6,
- B8DCE04F056DACAE00C390B0,
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 8D0C4E920486CD37000505A6 = {
- fileRef = 20286C33FDCF999611CA2CEA;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 8D0C4E930486CD37000505A6 = {
- fileRef = 0249A66BFF388E3F11CA2CEA;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 8D0C4E940486CD37000505A6 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 8D0C4E960486CD37000505A6 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = text.plist;
- path = Info.plist;
- refType = 4;
- sourceTree = "<group>";
- };
- 8D0C4E970486CD37000505A6 = {
- explicitFileType = wrapper.application;
- includeInIndex = 0;
- isa = PBXFileReference;
- path = ScriptExec.app;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
-//8D0
-//8D1
-//8D2
-//8D3
-//8D4
-//B80
-//B81
-//B82
-//B83
-//B84
- B8DCE042056DAC3500C390B0 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.nib;
- path = MenuBar.nib;
- refType = 4;
- sourceTree = "<group>";
- };
- B8DCE045056DAC3500C390B0 = {
- fileRef = B8DCE042056DAC3500C390B0;
- isa = PBXBuildFile;
- settings = {
- };
- };
- B8DCE048056DAC5000C390B0 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.script.sh;
- path = script;
- refType = 4;
- sourceTree = "<group>";
- };
- B8DCE049056DAC5000C390B0 = {
- fileRef = B8DCE048056DAC5000C390B0;
- isa = PBXBuildFile;
- settings = {
- };
- };
- B8DCE04E056DACAE00C390B0 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = Security.framework;
- path = /System/Library/Frameworks/Security.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- B8DCE04F056DACAE00C390B0 = {
- fileRef = B8DCE04E056DACAE00C390B0;
- isa = PBXBuildFile;
- settings = {
- };
- };
- };
- rootObject = 20286C28FDCF999611CA2CEA;
-}
diff --git a/packaging/macosx/ScriptExec/ScriptExec.xcodeproj/project.pbxproj b/packaging/macosx/ScriptExec/ScriptExec.xcodeproj/project.pbxproj
index 3d0fe0120..0443dd764 100644
--- a/packaging/macosx/ScriptExec/ScriptExec.xcodeproj/project.pbxproj
+++ b/packaging/macosx/ScriptExec/ScriptExec.xcodeproj/project.pbxproj
@@ -12,14 +12,12 @@
8D0C4E8D0486CD37000505A6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */; };
8D0C4E900486CD37000505A6 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 20286C2BFDCF999611CA2CEA /* main.c */; settings = {ATTRIBUTES = (); }; };
8D0C4E920486CD37000505A6 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; };
- 8D0C4E930486CD37000505A6 /* libstdc++.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0249A66BFF388E3F11CA2CEA /* libstdc++.a */; };
B8DCE045056DAC3500C390B0 /* MenuBar.nib in Resources */ = {isa = PBXBuildFile; fileRef = B8DCE042056DAC3500C390B0 /* MenuBar.nib */; };
B8DCE049056DAC5000C390B0 /* script in Resources */ = {isa = PBXBuildFile; fileRef = B8DCE048056DAC5000C390B0 /* script */; };
B8DCE04F056DACAE00C390B0 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8DCE04E056DACAE00C390B0 /* Security.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- 0249A66BFF388E3F11CA2CEA /* libstdc++.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libstdc++.a"; path = "/usr/lib/libstdc++.a"; sourceTree = "<absolute>"; };
0867D6ABFE840B52C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
20286C2BFDCF999611CA2CEA /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
20286C33FDCF999611CA2CEA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
@@ -40,7 +38,6 @@
buildActionMask = 2147483647;
files = (
8D0C4E920486CD37000505A6 /* Carbon.framework in Frameworks */,
- 8D0C4E930486CD37000505A6 /* libstdc++.a in Frameworks */,
B8DCE04F056DACAE00C390B0 /* Security.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -94,7 +91,6 @@
20286C33FDCF999611CA2CEA /* Carbon.framework */,
4A9504CAFFE6A41611CA0CBA /* CoreServices.framework */,
4A9504C8FFE6A3BC11CA0CBA /* ApplicationServices.framework */,
- 0249A66BFF388E3F11CA2CEA /* libstdc++.a */,
B8DCE04E056DACAE00C390B0 /* Security.framework */,
);
name = "External Frameworks and Libraries";
@@ -140,9 +136,15 @@
20286C28FDCF999611CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 78E9AE1A0A36A8E3000D76A8 /* Build configuration list for PBXProject "ScriptExec" */;
+ compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ en,
+ );
mainGroup = 20286C29FDCF999611CA2CEA /* ScriptExec */;
projectDirPath = "";
+ projectRoot = "";
targets = (
8D0C4E890486CD37000505A6 /* ScriptExec */,
);
@@ -199,6 +201,8 @@
78E9AE170A36A8E3000D76A8 /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
COPY_PHASE_STRIP = NO;
DEBUGGING_SYMBOLS = YES;
FRAMEWORK_SEARCH_PATHS = "";
@@ -217,7 +221,6 @@
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = "";
LIBRARY_STYLE = Static;
- OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
@@ -236,6 +239,8 @@
78E9AE180A36A8E3000D76A8 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -270,6 +275,8 @@
78E9AE190A36A8E3000D76A8 /* Default */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_TRIGRAPHS = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
@@ -300,25 +307,18 @@
78E9AE1B0A36A8E3000D76A8 /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
- SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
};
name = Development;
};
78E9AE1C0A36A8E3000D76A8 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc,
- i386,
- );
- SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
};
name = Deployment;
};
78E9AE1D0A36A8E3000D76A8 /* Default */ = {
isa = XCBuildConfiguration;
buildSettings = {
- SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
};
name = Default;
};
diff --git a/packaging/macosx/ScriptExec/launcher-quartz-no-macintegration.sh b/packaging/macosx/ScriptExec/launcher-quartz-no-macintegration.sh
new file mode 100755
index 000000000..d449b5121
--- /dev/null
+++ b/packaging/macosx/ScriptExec/launcher-quartz-no-macintegration.sh
@@ -0,0 +1,169 @@
+#!/bin/sh
+#
+# Author: Aaron Voisine <aaron@voisine.org>
+# Inkscape Modifications:
+# Michael Wybrow <mjwybrow@users.sourceforge.net>
+# Jean-Olivier Irisson <jo.irisson@gmail.com>
+# ~suv <suv-sf@users.sourceforge.net>
+#
+
+[ -n "$INK_DEBUG_LAUNCHER" ] && set -x
+
+CWD="$(cd "$(dirname "$0")" && pwd)"
+# e.g. /Applications/Inkscape.app/Contents/MacOS
+TOP="$(dirname "$CWD")/Resources"
+# e.g. /Applications/Inkscape.app/Contents/Resources
+BASE="$(echo "$TOP" | sed -e 's/\/Contents\/Resources.*$//')"
+# e.g. /Applications/Inkscape.app
+
+source "${TOP}/xdg_setup.sh"
+source "${TOP}/alert_fccache.sh"
+
+# FIXME: Inkscape needs better relocation support for OS X (get rid of the relative
+# path hack in src/path-prefix.h for osxapp-enabled builds). Until then, below change
+# of working directory is required:
+#
+# Due to changes after 0.48, we have change working directory in the script named 'inkscape':
+# recursive calls to inkscape from python-based extensions otherwise cause the app to hang or
+# fail (for python-based extensions, inkscape changes the working directory to the
+# script's directory, and inkscape launched by python script thus can't find resources
+# like the now essential 'units.xml' in INKSCAPE_UIDIR relative to the working directory).
+cd "$BASE" || exit 1
+
+# don't prepend to $PATH in recursive calls:
+if [ -z "$INK_PATH_ORIG" ]; then
+
+ # Brutally add many things to the PATH. If the directories do not exist, they won't be used anyway.
+ # the 'classic' PATH additions:
+ # /usr/local/bin which, though standard, doesn't seem to be in the PATH
+ # Fink
+ # MacPorts (former DarwinPorts)
+ # LaTeX distribution for Mac OS X
+ PATH_OTHER="/usr/texbin:/opt/local/bin:/sw/bin/:/usr/local/bin"
+
+ # Put /usr/bin at beginning of path so we make sure we use Apple's python
+ # over one that may be installed be Macports, Fink or some other means.
+ PATH_PYTHON="/usr/bin"
+
+ # Put $TOP/bin at beginning of path so we make sure that recursive calls
+ # to inkscape don't pull in other inkscape binaries with different setup.
+ # Also allows to override system python with custom wrapper script, and
+ # e.g. to support GIMP.app or gimp for external editing and GIMP XCF export.
+ PATH_pkgbin="$CWD:$TOP/bin"
+
+ # save orig, new PATH
+ export INK_PATH_ORIG="$PATH"
+ export PATH="$PATH_pkgbin:$PATH_PYTHON:$PATH_OTHER:$INK_PATH_ORIG"
+fi
+
+# Setup PYTHONPATH to use python modules shipped with Inkscape
+OSXMINORNO="$(/usr/bin/sw_vers -productVersion | cut -d. -f2)"
+build_arch=__build_arch__
+if [ $OSXMINORNO -gt "5" ]; then
+ if [ $OSXMINORNO -eq "6" ]; then
+ export VERSIONER_PYTHON_VERSION=2.6
+ else # if [ $OSXMINORNO -ge "7" ]; then
+ export VERSIONER_PYTHON_VERSION=2.7
+ fi
+ if [ $build_arch = "i386" ]; then
+ export VERSIONER_PYTHON_PREFER_32_BIT=yes
+ else # build & runtime arch x86_64
+ export VERSIONER_PYTHON_PREFER_32_BIT=no
+ fi
+fi
+PYTHON_VERS="$(python -V 2>&1 | cut -c 8-10)"
+export PYTHONPATH="$TOP/lib/python$PYTHON_VERS/site-packages/"
+
+export FONTCONFIG_PATH="$TOP/etc/fonts"
+export PANGO_RC_FILE="$TOP/etc/pango/pangorc"
+export PANGO_SYSCONFDIR="$TOP/etc"
+export GTK_IM_MODULE_FILE="$TOP/lib/gtk-2.0/__gtk_version__/immodules.cache"
+export GDK_PIXBUF_MODULE_FILE="$TOP/lib/gdk-pixbuf-2.0/__gtk_version__/loaders.cache"
+export GTK_DATA_PREFIX="$TOP"
+export GTK_EXE_PREFIX="$TOP"
+export GTK_PATH="$TOP"
+export GNOME_VFS_MODULE_CONFIG_PATH="$TOP/etc/gnome-vfs-2.0/modules"
+export GNOME_VFS_MODULE_PATH="$TOP/lib/gnome-vfs-2.0/modules"
+export GIO_USE_VFS="local"
+export GVFS_REMOTE_VOLUME_MONITOR_IGNORE=1
+export GVFS_DISABLE_FUSE=1
+export XDG_DATA_DIRS="$TOP/share"
+export ASPELL_CONF="prefix $TOP;"
+export POPPLER_DATADIR="$TOP/share/poppler"
+
+# no DBUS for now
+unset DBUS_LAUNCHD_SESSION_BUS_SOCKET
+unset DBUS_SESSION_BUS_ADDRESS
+
+# Note: This requires the path with the exact ImageMagic version number.
+# The actual version is inserted by the packaging script.
+export MAGICK_CONFIGURE_PATH="$TOP/lib/ImageMagick-IMAGEMAGICKVER/config:$TOP/share/ImageMagick-IMAGEMAGICKVER_MAJOR/config"
+export MAGICK_CODER_FILTER_PATH="$TOP/lib/ImageMagick-IMAGEMAGICKVER/modules-Q16/filters"
+export MAGICK_CODER_MODULE_PATH="$TOP/lib/ImageMagick-IMAGEMAGICKVER/modules-Q16/coders"
+
+export INKSCAPE_SHAREDIR="$TOP/share/inkscape"
+export INKSCAPE_PLUGINDIR="$TOP/lib/inkscape"
+export INKSCAPE_LOCALEDIR="$TOP/share/locale"
+
+# Handle the case where the directory storing Inkscape has special characters
+# ('#', '&', '|') in the name. These need to be escaped to work properly for
+# various configuration files.
+ESCAPEDTOP=`echo "$TOP" | sed 's/#/\\\\\\\\#/' | sed 's/&/\\\\\\&/g' | sed 's/|/\\\\\\|/g'`
+
+# Set GTK theme (only if there is no .gtkrc-2.0 in the user's home)
+if [[ ! -e "$HOME/.gtkrc-2.0" ]]; then
+ export GTK2_RC_FILES="$ESCAPEDTOP/etc/gtk-2.0/gtkrc"
+fi
+
+# If the AppleCollationOrder preference doesn't exist, we fall back to using
+# the AppleLocale preference.
+LANGSTR=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null`
+if [ "x$LANGSTR" == "x" -o "x$LANGSTR" == "xroot" ]
+then
+ LANGSTR=`defaults read .GlobalPreferences AppleLocale 2>/dev/null | \
+ sed 's/_.*//'`
+ [ $_DEBUG ] && echo "Setting LANGSTR from AppleLocale: $LANGSTR" 1>&2
+else
+ [ $_DEBUG ] && echo "Setting LANGSTR from AppleCollationOrder: $LANGSTR" 1>&2
+fi
+
+# NOTE: Have to add ".UTF-8" to the LANG since omitting causes Inkscape
+# to crash on startup in locale_from_utf8().
+if [ "x$LANGSTR" == "x" ]
+then
+ # override broken script
+ [ $_DEBUG ] && echo "Overriding empty LANGSTR" 1>&2
+ export LANG="en_US.UTF-8"
+else
+ tmpLANG="`grep \"\`echo $LANGSTR\`_\" /usr/share/locale/locale.alias | \
+ tail -n1 | sed 's/\./ /' | awk '{print $2}'`"
+ if [ "x$tmpLANG" == "x" ]
+ then
+ # override broken script
+ [ $_DEBUG ] && echo "Overriding empty LANG from /usr/share/locale/locale.alias" 1>&2
+ export LANG="en_US.UTF-8"
+ else
+ [ $_DEBUG ] && echo "Setting LANG from /usr/share/locale/locale.alias" 1>&2
+ export LANG="$tmpLANG.UTF-8"
+ fi
+fi
+[ $_DEBUG ] && echo "Setting Language: $LANG" 1>&2
+export LC_ALL="$LANG"
+
+case "$INK_DEBUG" in
+ gdb)
+ EXEC="gdb --args" ;;
+ lldb)
+ EXEC="lldb -- " ;;
+ dtruss)
+ EXEC="dtruss" ;;
+ *)
+ EXEC="exec" ;;
+esac
+unset INK_DEBUG # ignore for recursive calls
+
+if [ "x$INK_DEBUG_SHELL" != "x" ]; then
+ exec bash
+else
+ $EXEC "$CWD/inkscape-bin" "$@"
+fi
diff --git a/packaging/macosx/ScriptExec/main.c b/packaging/macosx/ScriptExec/main.c
index f413d438a..e3f066d70 100644
--- a/packaging/macosx/ScriptExec/main.c
+++ b/packaging/macosx/ScriptExec/main.c
@@ -6,6 +6,7 @@
With modifications by Aaron Voisine for gimp.app
With modifications by Marianne gagnon for Wilber-loves-apple
With modifications by Michael Wybrow for Inkscape.app
+ With modifications by ~suv for Inkscape.app
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +28,7 @@
/*
* This app laucher basically takes care of:
- * - launching Inkscape and X11 when double-clicked
+ * - launching Inkscape when double-clicked
* - bringing X11 to the top when its icon is clicked in the dock (via a small applescript)
* - catch file dropped on icon events (and double-clicked gimp documents) and notify gimp.
* - catch quit events performed outside gimp, e.g. on the dock icon.
@@ -39,7 +40,12 @@
#pragma mark Includes
// Apple stuff
+
+// Note: including Carbon prevents building the launcher app in x86_64
+// used for StandardAlert in RequestUserAttention(),
+// RedFatalAlert()
#include <Carbon/Carbon.h>
+
#include <CoreFoundation/CoreFoundation.h>
#include <Security/Authorization.h>
#include <Security/AuthorizationTags.h>
@@ -67,7 +73,6 @@
#define kEventClassRedFatalAlert 911
// custom carbon event types
-#define kEventKindX11Failed 911
#define kEventKindFCCacheFailed 912
//maximum arguments the script accepts
@@ -83,15 +88,14 @@ static void *OpenDoc(void *arg);
static OSErr ExecuteScript(char *script, pid_t *pid);
static void GetParameters(void);
-static char* GetScript(void);
-static char* GetOpenDoc(void);
+static unsigned char* GetScript(void);
+static unsigned char* GetOpenDoc(void);
OSErr LoadMenuBar(char *appName);
-static OSStatus FSMakePath(FSSpec file, char *path, long maxPathSize);
+static OSStatus FSMakePath(FSRef fileRef, unsigned char *path, long maxPathSize);
static void RedFatalAlert(Str255 errorString, Str255 expStr);
-static short DoesFileExist(char *path);
-static OSStatus FixFCCache(void);
+static short DoesFileExist(unsigned char *path);
static OSErr AppQuitAEHandler(const AppleEvent *theAppleEvent,
AppleEvent *reply, long refCon);
@@ -99,8 +103,6 @@ static OSErr AppOpenDocAEHandler(const AppleEvent *theAppleEvent,
AppleEvent *reply, long refCon);
static OSErr AppOpenAppAEHandler(const AppleEvent *theAppleEvent,
AppleEvent *reply, long refCon);
-static OSStatus X11FailedHandler(EventHandlerCallRef theHandlerCall,
- EventRef theEvent, void *userData);
static OSStatus FCCacheFailedHandler(EventHandlerCallRef theHandlerCall,
EventRef theEvent, void *userData);
static OSErr AppReopenAppAEHandler(const AppleEvent *theAppleEvent,
@@ -109,7 +111,7 @@ static OSErr AppReopenAppAEHandler(const AppleEvent *theAppleEvent,
static OSStatus CompileAppleScript(const void* text, long textLength,
AEDesc *resultData);
static OSStatus SimpleCompileAppleScript(const char* theScript);
-static void runScript();
+static OSErr runScript();
///////////////////////////////////////
// Globals
@@ -144,7 +146,6 @@ extern char **environ;
int main(int argc, char* argv[])
{
OSErr err = noErr;
- EventTypeSpec X11events = { kEventClassRedFatalAlert, kEventKindX11Failed };
EventTypeSpec FCCacheEvents = { kEventClassRedFatalAlert, kEventKindFCCacheFailed };
InitCursor();
@@ -165,9 +166,6 @@ int main(int argc, char* argv[])
0, false);
err += InstallEventHandler(GetApplicationEventTarget(),
- NewEventHandlerUPP(X11FailedHandler), 1,
- &X11events, NULL, NULL);
- err += InstallEventHandler(GetApplicationEventTarget(),
NewEventHandlerUPP(FCCacheFailedHandler), 1,
&FCCacheEvents, NULL, NULL);
@@ -181,7 +179,7 @@ int main(int argc, char* argv[])
GetParameters(); //load data from files containing exec settings
// compile "icon clicked" script so it's ready to execute
- SimpleCompileAppleScript("tell application \"X11\" to activate");
+ SimpleCompileAppleScript("tell application \"XQuartz\" to activate");
RunApplicationEventLoop(); //Run the event loop
return 0;
@@ -229,6 +227,7 @@ static void ShowFirstStartWarningDialog(void)
//////////////////////////////////
// Handler for when fontconfig caches need to be generated
+// TODO: remove (alert and touch moved to launcher script)
//////////////////////////////////
static OSStatus FCCacheFailedHandler(EventHandlerCallRef theHandlerCall,
EventRef theEvent, void *userData)
@@ -243,8 +242,8 @@ static OSStatus FCCacheFailedHandler(EventHandlerCallRef theHandlerCall,
ShowFirstStartWarningDialog();
// Note that we've seen the warning.
- system("test -d \"$HOME/.inkscape-etc\" || mkdir -p \"$HOME/.inkscape-etc\"; "
- "touch \"$HOME/.inkscape-etc/.fccache-new\"");
+ system("test -d \"$HOME/.cache/inkscape\" || mkdir -p \"$HOME/.cache/inkscape\"; "
+ "touch \"$HOME/.cache/inkscape/.fccache-new\"");
// Rerun now.
OSErr err = ExecuteScript(scriptPath, &pid);
ExitToShell();
@@ -253,116 +252,6 @@ static OSStatus FCCacheFailedHandler(EventHandlerCallRef theHandlerCall,
}
-static size_t safeRead(int d, void *buf, size_t nbytes)
-{
- ssize_t bytesToRead = nbytes;
- ssize_t bytesRead = 0;
- char *offset = (char *) buf;
-
- while ((bytesToRead > 0))
- {
- bytesRead = read(d, offset, bytesToRead);
- if (bytesRead > 0)
- {
- offset += bytesRead;
- bytesToRead -= bytesRead;
- }
- else if (bytesRead == 0)
- {
- // Reached EOF.
- break;
- }
- else if (bytesRead == -1)
- {
- if ((errno == EINTR) || (errno == EAGAIN))
- {
- // Try again.
- continue;
- }
- return 0;
- }
- }
- return bytesRead;
-}
-
-
-/////////////////////////////////////
-// Code to run fc-cache on first run
-/////////////////////////////////////
-static OSStatus FixFCCache (void)
-{
- FILE *fileConnToChild = NULL;
- int fdConnToChild = 0;
- pid_t childPID = WAIT_ANY;
- size_t bytesChildPID;
- size_t bytesRead;
- int status;
-
- char commandStr[] = "/usr/X11R6/bin/fc-cache";
- char *commandArgs[] = { "-f", NULL };
-
- // Run fc-cache
- AuthorizationItem authItems[] =
- {
- {
- kAuthorizationRightExecute,
- strlen(commandStr),
- commandStr,
- 0
- }
- };
- AuthorizationItemSet authItemSet =
- {
- 1,
- authItems
- };
- AuthorizationRef authRef = NULL;
- OSStatus err = AuthorizationCreate (NULL, &authItemSet,
- kAuthorizationFlagInteractionAllowed |
- kAuthorizationFlagExtendRights, &authRef);
-
- if (err == errAuthorizationSuccess)
- {
- err = AuthorizationExecuteWithPrivileges(authRef, commandStr,
- kAuthorizationFlagDefaults, commandArgs,
- &fileConnToChild);
-
- if (err == errAuthorizationSuccess)
- {
- // Unfortunately, AuthorizationExecuteWithPrivileges
- // does not return the process ID associated with the
- // process it runs. The best solution we have it to
- // try and get the process ID from the file descriptor.
- // This is based on example code from Apple's
- // MoreAuthSample.
-
- fdConnToChild = fileno(fileConnToChild);
-
- // Try an get the process ID of the fc-cache command
- bytesChildPID = sizeof(childPID);
- bytesRead = safeRead(fdConnToChild, &childPID,
- bytesChildPID);
- if (bytesRead != bytesChildPID)
- {
- // If we can't get it the best alternative
- // is to wait for any child to finish.
- childPID = WAIT_ANY;
- }
-
- if (fileConnToChild != NULL) {
- fclose(fileConnToChild);
- }
-
- // Wait for child process to finish.
- waitpid(childPID, &status, 0);
- }
- }
- AuthorizationFree(authRef, kAuthorizationFlagDestroyRights);
-
- return err;
-}
-
-
///////////////////////////////////
// Execution thread starts here
///////////////////////////////////
@@ -373,12 +262,7 @@ static void *Execute (void *arg)
taskDone = false;
OSErr err = ExecuteScript(scriptPath, &pid);
- if (err == (OSErr)11) {
- CreateEvent(NULL, kEventClassRedFatalAlert, kEventKindX11Failed, 0,
- kEventAttributeNone, &event);
- PostEventToQueue(GetMainEventQueue(), event, kEventPriorityStandard);
- }
- else if (err == (OSErr)12) {
+ if (err == (OSErr)12) {
CreateEvent(NULL, kEventClassRedFatalAlert, kEventKindFCCacheFailed, 0,
kEventAttributeNone, &event);
PostEventToQueue(GetMainEventQueue(), event, kEventPriorityHigh);
@@ -448,14 +332,13 @@ static void GetParameters (void)
///////////////////////////////////////
// Get path to the script in Resources folder
///////////////////////////////////////
-static char* GetScript (void)
+static unsigned char* GetScript (void)
{
CFStringRef fileName;
CFBundleRef appBundle;
CFURLRef scriptFileURL;
FSRef fileRef;
- FSSpec fileSpec;
- char *path;
+ unsigned char *path;
//get CF URL for script
if (! (appBundle = CFBundleGetMainBundle())) return NULL;
@@ -472,13 +355,9 @@ static char* GetScript (void)
CFRelease(scriptFileURL);
CFRelease(fileName);
- //convert FSRef to FSSpec
- if (FSGetCatalogInfo(&fileRef, kFSCatInfoNone, NULL, NULL, &fileSpec,
- NULL)) return NULL;
-
//create path string
if (! (path = malloc(kMaxPathLength))) return NULL;
- if (FSMakePath(fileSpec, path, kMaxPathLength)) return NULL;
+ if (FSMakePath(fileRef, path, kMaxPathLength)) return NULL;
if (! DoesFileExist(path)) return NULL;
return path;
@@ -487,14 +366,13 @@ static char* GetScript (void)
///////////////////////////////////////
// Gets the path to openDoc in Resources folder
///////////////////////////////////////
-static char* GetOpenDoc (void)
+static unsigned char* GetOpenDoc (void)
{
CFStringRef fileName;
CFBundleRef appBundle;
CFURLRef openDocFileURL;
FSRef fileRef;
- FSSpec fileSpec;
- char *path;
+ unsigned char *path;
//get CF URL for openDoc
if (! (appBundle = CFBundleGetMainBundle())) return NULL;
@@ -511,13 +389,9 @@ static char* GetOpenDoc (void)
CFRelease(openDocFileURL);
CFRelease(fileName);
- //convert FSRef to FSSpec
- if (FSGetCatalogInfo(&fileRef, kFSCatInfoNone, NULL, NULL, &fileSpec,
- NULL)) return NULL;
-
//create path string
if (! (path = malloc(kMaxPathLength))) return NULL;
- if (FSMakePath(fileSpec, path, kMaxPathLength)) return NULL;
+ if (FSMakePath(fileRef, path, kMaxPathLength)) return NULL;
if (! DoesFileExist(path)) return NULL;
return path;
@@ -545,14 +419,8 @@ OSErr LoadMenuBar (char *appName)
///////////////////////////////////////
// Generate path string from FSSpec record
///////////////////////////////////////
-static OSStatus FSMakePath(FSSpec file, char *path, long maxPathSize)
+static OSStatus FSMakePath(FSRef fileRef, unsigned char *path, long maxPathSize)
{
- OSErr err = noErr;
- FSRef fileRef;
-
- //create file reference from file spec
- if (err = FSpMakeFSRef(&file, &fileRef)) return err;
-
// and then convert the FSRef to a path
return FSRefMakePath(&fileRef, path, maxPathSize);
}
@@ -569,9 +437,9 @@ static void RedFatalAlert (Str255 errorString, Str255 expStr)
///////////////////////////////////////
// Determines whether file exists at path or not
///////////////////////////////////////
-static short DoesFileExist (char *path)
+static short DoesFileExist (unsigned char *path)
{
- if (access(path, F_OK) == -1) return false;
+ if (access((char *)path, F_OK) == -1) return false;
return true;
}
@@ -590,7 +458,7 @@ static OSErr AppQuitAEHandler(const AppleEvent *theAppleEvent,
if (! taskDone && pid) { //kill the script process brutally
kill(pid, 9);
- printf("Platypus App: PID %d killed brutally\n", pid);
+ printf("Inkscape.app: PID %d killed brutally\n", pid);
}
pthread_cancel(tid);
@@ -610,31 +478,31 @@ static OSErr AppOpenDocAEHandler(const AppleEvent *theAppleEvent,
#pragma unused (reply, refCon)
OSErr err = noErr;
- AEDescList fileSpecList;
+ AEDescList fileRefList;
AEKeyword keyword;
DescType type;
short i;
long count, actualSize;
- FSSpec fileSpec;
- char path[kMaxPathLength];
+ FSRef fileRef;
+ unsigned char path[kMaxPathLength];
while (numArgs > 0) free(fileArgs[numArgs--]);
//Read the AppleEvent
err = AEGetParamDesc(theAppleEvent, keyDirectObject, typeAEList,
- &fileSpecList);
+ &fileRefList);
- err = AECountItems(&fileSpecList, &count); //Count number of files
+ err = AECountItems(&fileRefList, &count); //Count number of files
for (i = 1; i <= count; i++) { //iteratively process each file
- //get fsspec from apple event
- if (! (err = AEGetNthPtr(&fileSpecList, i, typeFSS, &keyword, &type,
- (Ptr)&fileSpec, sizeof(FSSpec), &actualSize)))
+ //get fsref from apple event
+ if (! (err = AEGetNthPtr(&fileRefList, i, typeFSRef, &keyword, &type,
+ (Ptr)&fileRef, sizeof(FSRef), &actualSize)))
{
- //get path from file spec
- if ((err = FSMakePath(fileSpec, (unsigned char *)&path,
+ //get path from file ref
+ if ((err = FSMakePath(fileRef, (unsigned char *)&path,
kMaxPathLength))) return err;
if (numArgs == kMaxArgumentsToScript) break;
@@ -659,7 +527,7 @@ static OSErr AppOpenDocAEHandler(const AppleEvent *theAppleEvent,
static OSErr AppReopenAppAEHandler(const AppleEvent *theAppleEvent,
AppleEvent *reply, long refCon)
{
- runScript();
+ return runScript();
}
// if app is being opened
@@ -675,70 +543,6 @@ static OSErr AppOpenAppAEHandler(const AppleEvent *theAppleEvent,
}
-static void OpenURL(Str255 url)
-{
- // Use Internet Config to hand the URL to the appropriate application, as
- // set by the user in the Internet Preferences pane.
- ICInstance icInstance;
- // Applications creator code:
- OSType signature = 'Inks';
- OSStatus error = ICStart( &icInstance, signature );
- if ( error == noErr )
- {
- ConstStr255Param hint = 0x0;
- const char* data = url;
- long length = strlen(url);
- long start = 0;
- long end = length;
- // Don't bother testing return value (error); launched application will
- // report problems.
- ICLaunchURL( icInstance, hint, data, length, &start, &end );
- ICStop( icInstance );
- }
-}
-
-
-//////////////////////////////////
-// Handler for when X11 fails to start
-//////////////////////////////////
-static OSStatus X11FailedHandler(EventHandlerCallRef theHandlerCall,
- EventRef theEvent, void *userData)
-{
- #pragma unused(theHanderCall, theEvent, userData)
-
- pthread_join(tid, NULL);
- if (odtid) pthread_join(odtid, NULL);
-
- SInt16 itemHit;
- const char *getX11 = "\pGet X11 for Panther";
-
- AlertStdAlertParamRec params;
- params.movable = true;
- params.helpButton = false;
- params.filterProc = NULL;
- params.defaultText = (StringPtr) kAlertDefaultOKText;
- params.cancelText = getX11;
- params.otherText = NULL;
- params.defaultButton = kAlertStdAlertOKButton;
- params.cancelButton = kAlertStdAlertCancelButton;
- params.position = kWindowDefaultPosition;
-
- StandardAlert(kAlertStopAlert, "\pFailed to start X11",
- "\pInkscape.app requires Apple's X11, which is freely downloadable from Apple's website for Panther (10.3.x) users and available as an optional install from the installation DVD for Tiger (10.4.x) users.\n\nPlease install X11 and restart Inkscape.",
- &params, &itemHit);
-
- if (itemHit == kAlertStdAlertCancelButton)
- {
- OpenURL("http://www.apple.com/downloads/macosx/apple/macosx_updates/x11formacosx.html");
- }
-
- ExitToShell();
-
-
- return noErr;
-}
-
-
// Compile and run a small AppleScript. The code below does no cleanup and no proper error checks
// but since it's there until the app is shut down, and since we know the script is okay,
// there should not be any problems.
@@ -774,7 +578,7 @@ static OSStatus CompileAppleScript(const void* text, long textLength,
}
/* runs the compiled applescript */
-static void runScript()
+static OSErr runScript()
{
/* run the script */
err = OSAExecute(theComponent, scriptID, kOSANullScript,