Package: fpc-xcode-syntax-coloring Version: 1.0 Revision: 2 Description: FreePascal syntax coloring for Xcode Suggests: fpc License: GPL # Unpack Phase: Source: mirror:sourceforge:fink/XcodePascalSyntaxColoring-%v.zip Source-MD5: 41bb1cae6595646a61156ef398a3ebbf SourceDirectory: Xcode Pascal Syntax Coloring CompileScript: echo Nothing to compile. # Install Phase: InstallScript: << #!/bin/sh -ev ls -alh # create the file tmp.plist OBJP_VERSION="1.0" cat >'%b'/tmp.plist < Xcode.SourceCodeLanguage.Pascal conformsTo identifier Xcode.SourceCodeLanguage.Generic documentationAbbreviation pascal fileDataType identifier public.pascal-source id Xcode.SourceCodeLanguage.Pascal languageName Pascal languageSpecification xcode.lang.pascal name The Pascal Programming Language point Xcode.SourceCodeLanguage version $OBJP_VERSION EOFCFG mkdir -p %i/share/fpc-xcode-syntax-coloring mv tmp.plist %i/share/fpc-xcode-syntax-coloring mv Pascal.xclangspec %i/share/fpc-xcode-syntax-coloring << DocFiles: Pascal-READ-ME.txt PostInstScript: << if [ -x /usr/bin/xcode-select ]; then XCODE_PATH=`xcode-select -print-path`/.. else echo Error: could not find the tool xcode-select exit 1 fi if [ -z "$XCODE_PATH" ]; then echo Error: XCODE_PATH is empty exit 1 else echo found: $XCODE_PATH fi DVTFOUNDATION_DIR=`find $XCODE_PATH/SharedFrameworks -name DVTFoundation.framework` if [ -z "$DVTFOUNDATION_DIR" ]; then echo Error: DVTFOUNDATION_DIR is empty exit 1 else echo found: $DVTFOUNDATION_DIR fi PLUGINDATA_FILE=`find $DVTFOUNDATION_DIR -name DVTFoundation.xcplugindata` if [ -z "$PLUGINDATA_FILE" ]; then echo Error: PLUGINDATA_FILE is empty exit 1 else echo found: $PLUGINDATA_FILE fi cp -p $PLUGINDATA_FILE $PLUGINDATA_FILE.bak if [ -x /usr/libexec/PlistBuddy ]; then echo Adding Pascal language specification entry. /usr/libexec/PlistBuddy -c "Merge %p/share/fpc-xcode-syntax-coloring/tmp.plist :plug-in:extensions" $PLUGINDATA_FILE else echo Error: could not find the tool PlistBuddy exit 1 fi echo Adding link to Pascal language specification file. cp %p/share/fpc-xcode-syntax-coloring/Pascal.xclangspec $DVTFOUNDATION_DIR/Versions/A/Resources/ echo echo "*** Restart Xcode to update the changes. ***" << PostRmScript: << if [ -x /usr/bin/xcode-select ]; then XCODE_PATH=`xcode-select -print-path`/.. else echo Error: could not find the tool xcode-select exit 1 fi if [ -z "$XCODE_PATH" ]; then echo Error: XCODE_PATH is empty exit 1 else echo found: $XCODE_PATH fi DVTFOUNDATION_DIR=`find $XCODE_PATH/SharedFrameworks -name DVTFoundation.framework` if [ -z "$DVTFOUNDATION_DIR" ]; then echo Error: DVTFOUNDATION_DIR is empty exit 1 else echo found: $DVTFOUNDATION_DIR fi PLUGINDATA_FILE=`find $DVTFOUNDATION_DIR -name DVTFoundation.xcplugindata` if [ -z "$PLUGINDATA_FILE" ]; then echo Error: PLUGINDATA_FILE is empty exit 1 else echo found: $PLUGINDATA_FILE fi if [ -x /usr/libexec/PlistBuddy ]; then CHECK_ENTRY=`grep Xcode.SourceCodeLanguage.Pascal $PLUGINDATA_FILE` echo entry found: $CHECK_ENTRY if [ -n "$CHECK_ENTRY" ]; then echo Removing Pascal language specification entry. /usr/libexec/PlistBuddy -c "Delete :plug-in:extensions:Xcode.SourceCodeLanguage.Pascal" $PLUGINDATA_FILE fi else echo Error: could not find the tool PlistBuddy exit 1 fi echo Removing Pascal language specification file. if [ -e $DVTFOUNDATION_DIR/Versions/A/Resources/Pascal.xclangspec ] then rm -f $DVTFOUNDATION_DIR/Versions/A/Resources/Pascal.xclangspec fi echo echo "*** Restart Xcode to update the changes. ***" echo << DescDetail: << This package enables Pascal source code highlighting in Xcode. << DescUsage: << After installation, Pascal files should have syntax coloring in Xcode. << DescPort: << The package is derived from Andy Hall's message on the Macintosh Pascal Mailing List from 03-FEB-2017. The scripts are derived from the installation script in the package. << Maintainer: Karl-Michael Schindler