<commit_before>#!/bin/sh
# Copy Qt frameworks to marble bundle
# and make search paths for them relative to bundle

PREFIX=${HOME}/apps/Marble.app/Contents/MacOS

# Edit version when any library is upgraded
LIBJPEG=libjpeg.dylib
LNKJPEG=libjpeg.dylib
LIBPNG=libpng.dylib
LNKPNG=libpng.dylib

QTVER=4.2.3
QTPREFIX=/Library/Frameworks
QTFRAMEWORKS="QtCore QtGui QtNetwork QtSql QtSvg QtXml Qt3Support QtDesigner QtTest"

# Copy supporting frameworks to application bundle
cd $PREFIX/lib

for FRAMEWORK in $QTFRAMEWORKS
do
	LIBFRAMEWORK=$FRAMEWORK.framework/Versions/4/$FRAMEWORK
	if test ! -f $LIBFRAMEWORK; then
		mkdir -p $FRAMEWORK.framework/Versions/4
		cp $QTPREFIX/$LIBFRAMEWORK $LIBFRAMEWORK
		install_name_tool -id @executable_path/libs/$LIBFRAMEWORK $LIBFRAMEWORK
	fi
done

# Update path to supporting frameworks
for FRAMEWORK in QtGui QtNetwork QtSql QtSvg QtXml Qt3Support QtDesigner QtTest
do
	install_name_tool -change QtCore.framework/Versions/4/QtCore \
		@executable_path/lib/QtCore.framework/Versions/4/QtCore \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
done
for FRAMEWORK in QtSvg Qt3Support QtDesigner
do
	install_name_tool -change QtGui.framework/Versions/4/QtGui \
		@executable_path/lib/QtGui.framework/Versions/4/QtGui \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
	install_name_tool -change QtXml.framework/Versions/4/QtXml \
		@executable_path/lib/QtXml.framework/Versions/4/QtXml \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
done
for FRAMEWORK in Qt3Support
do
	install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork \
		@executable_path/lib/QtNetwork.framework/Versions/4/QtNetwork \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
	install_name_tool -change QtSql.framework/Versions/4/QtSql \
		@executable_path/lib/QtSql.framework/Versions/4/QtSql \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
done
for FRAMEWORK in QtGui QtSvg Qt3Support QtDesigner
do
	install_name_tool -change $LNKPNG @executable_path/lib/$LNKPNG \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
done
cd ../
LIBQJPEG=/Developer/Applications/Qt/plugins/imageformats/libqjpeg.dylib
if test ! -f $LIBQJPEG; then
	mkdir imageformats
	cp $QTPREFIX/plugins/$LIBQJPEG $LIBQJPEG
	# Update path to supporting libraries
	install_name_tool -change QtCore.framework/Versions/4/QtCore \
		@executable_path/lib/QtCore.framework/Versions/4/QtCore \
		$LIBQJPEG
	install_name_tool -change QtGui.framework/Versions/4/QtGui \
		@executable_path/lib/QtGui.framework/Versions/4/QtGui \
		$LIBQJPEG
	install_name_tool -change $LNKJPEG @executable_path/lib/$LNKJPEG $LIBQJPEG
	install_name_tool -change $LNKPNG @executable_path/lib/$LNKPNG $LIBQJPEG
fi
cd ../../../

for FILE in \
	marble \
	lib/libmarblewidget.5.0.0.dylib
do
	for FRAMEWORK in QtCore QtGui QtNetwork QtSql QtSvg QtXml Qt3Support QtDesigner QtTest
	do
		install_name_tool -change $FRAMEWORK.framework/Versions/4/$FRAMEWORK \
			@executable_path/lib/$FRAMEWORK.framework/Versions/4/$FRAMEWORK \
			$PREFIX/$FILE
	done
done<commit_msg>In progres: furtherwork on mac bundle support<commit_after>#!/bin/sh
set -x
# Copy Qt frameworks to marble bundle
# and make search paths for them relative to bundle

PREFIX=${HOME}/apps/Marble.app/Contents/MacOS
FRAMEWORKPREFIX=${HOME}/apps/Marble.app/Contents/Frameworks
LIBPREFIX=${HOME}/apps/Marble.app/Contents/lib
PLUGINPREFIX=${HOME}/apps/Marble.app/Contents/plugins

QTPREFIX=/Library/Frameworks
QTFRAMEWORKS="QtCore QtGui QtNetwork QtSql QtSvg QtXml Qt3Support QtDesigner QtTest"

# Copy supporting frameworks to application bundle
mkdir -p $FRAMEWORKPREFIX
cd $FRAMEWORKPREFIX
for FRAMEWORK in $QTFRAMEWORKS
do
	LIBFRAMEWORK=$FRAMEWORK.framework/Versions/4/$FRAMEWORK
	if test ! -f $LIBFRAMEWORK; then
		mkdir -p $FRAMEWORK.framework/Versions/4
		cp $QTPREFIX/$LIBFRAMEWORK $LIBFRAMEWORK
		install_name_tool -id @executable_path/../Frameworks/$LIBFRAMEWORK $LIBFRAMEWORK
	fi
done

# Update path to supporting frameworks
for FRAMEWORK in QtGui QtNetwork QtSql QtSvg QtXml Qt3Support QtDesigner QtTest
do
	install_name_tool -change QtCore.framework/Versions/4/QtCore \
		@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
done
for FRAMEWORK in QtSvg Qt3Support QtDesigner
do
	install_name_tool -change QtGui.framework/Versions/4/QtGui \
		@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
	install_name_tool -change QtXml.framework/Versions/4/QtXml \
		@executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
done
for FRAMEWORK in Qt3Support
do
	install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork \
		@executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
	install_name_tool -change QtSql.framework/Versions/4/QtSql \
		@executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql \
		$FRAMEWORK.framework/Versions/4/$FRAMEWORK
done
cd ../
mkdir -p plugins/imageformats
cd plugins/imageformats
LIBJPEG=libjpeg.dylib
LIBPNG=libpng.dylib
LIBQJPEG=/Developer/Applications/Qt/plugins/imageformats/libqjpeg.dylib
LIBQPNG=/Developer/Applications/Qt/plugins/imageformats/libqpng.dylib
if test ! -f $LIBJPEG; then
	cp $LIBQJPEG $LIBJPEG
	cp $LIBQPNG $LIBPNG
	# Update path to supporting libraries
	install_name_tool -change QtCore.framework/Versions/4/QtCore \
		@executable_path/lib/QtCore.framework/Versions/4/QtCore \
		$LIBJPEG
	install_name_tool -change QtGui.framework/Versions/4/QtGui \
		@executable_path/../Framework/QtGui.framework/Versions/4/QtGui \
		$LIBJPEG
	install_name_tool -change $LNKJPEG @executable_path/lib/$LIBJPEG $LIBQJPEG
	install_name_tool -change $LNKPNG @executable_path/lib/$LIBPNG $LIBQJPEG
fi

cd ../../MacOS
echo `pwd`
for FILE in \
	marble \
	lib/libmarblewidget.5.0.0.dylib
do
	for FRAMEWORK in QtCore QtGui QtNetwork QtSql QtSvg QtXml Qt3Support QtDesigner QtTest
	do
		install_name_tool -change $FRAMEWORK.framework/Versions/4/$FRAMEWORK \
			@executable_path/../Frameworks/$FRAMEWORK.framework/Versions/4/$FRAMEWORK \
			$PREFIX/$FILE
	done
done
{'fraction_non_alphanumeric': 0.09880971791945214, 'fraction_numerical': 0.010924506766672101, 'mean_word_length': 4.9437984496124034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1654206', 'n_tokens_mistral': 2302, 'n_tokens_neox': 2151, 'n_words': 411}