Remove unused and unmaintained OSX build scripts.

This commit is contained in:
Wayne Stambaugh 2016-06-13 15:49:01 -04:00
parent c4b22b55a0
commit 571206aa07
2 changed files with 0 additions and 295 deletions

View File

@ -1,166 +0,0 @@
#!/bin/bash
#
# Small helper script for patching/compiling wxWidgets/wxPython on OSX
#
# Params
# $1 wxWidgets/wxPython source folder (relative to current dir)
# $2 Target bin folder
# $3 KiCad source folder (relative to current dir)
# $4 OSX target version (e.g., "10.8")
# $5 Extra make options (e.g., "-j4")
createPaths() {
echo "*** Creating/wiping build and bin folder..."
rm -rf wx-build
rm -rf $1
mkdir wx-build
mkdir $1
}
doPatch() {
cwd=$(pwd)
cd $1
patchcmd="patch -p0 -RN --dry-run < $cwd/$2"
eval $patchcmd &> /dev/null
if [ $? -eq 0 ];
then
echo "*** Patch '$2' already applied, skipping..."
else
echo "*** Applying patch '$2'..."
patch -p0 < $cwd/$2
if [ $? -ne 0 ];
then
cd $cwd
exit 1
fi
fi
cd $cwd
}
wxWidgets_configure() {
echo "*** Configuring wxWidgets..."
cwd=$(pwd)
cd wx-build
../$1/configure \
--prefix=$cwd/$2 \
--with-opengl \
--enable-aui \
--enable-utf8 \
--enable-html \
--enable-stl \
--with-libjpeg=builtin \
--with-libpng=builtin \
--with-regex=builtin \
--with-libtiff=builtin \
--with-zlib=builtin \
--with-expat=builtin \
--without-liblzma \
--with-macosx-version-min=$3 \
--enable-universal-binary=i386,x86_64 \
CC=clang \
CXX=clang++
if [ $? -ne 0 ];
then
cd ..
exit 1
fi
cd ..
}
wxWidgets_buildInst() {
echo "*** Building wxWidgets..."
cd wx-build
make $1 install
if [ $? -ne 0 ];
then
cd ..
exit 1
fi
cd ..
}
wxPython_buildInst() {
cwd=$(pwd)
cd $1/wxPython
# build params
WXPYTHON_BUILD_OPTS="WX_CONFIG=$cwd/$2/bin/wx-config \
BUILD_BASE=$cwd/wx-build \
UNICODE=1 \
WXPORT=osx_cocoa"
# build
python setup.py build_ext $WXPYTHON_BUILD_OPTS
if [ $? -ne 0 ];
then
cd $cwd
exit 1
fi
# install
python setup.py install --prefix=$cwd/$2 $WXPYTHON_BUILD_OPTS
if [ $? -ne 0 ];
then
cd $cwd
exit 1
fi
cd $cwd
}
# check parameters
if [ "$#" -lt 4 ];
then
echo "OSX wxWidgets/wxPython build script"
echo
echo "Usage:"
echo " osx_build_wx.sh <src> <bin> <kicad> <osxtarget> [makeopts]"
echo " <src> wxWidgets/wxPython source folder"
echo " <bin> Destination folder"
echo " <kicad> KiCad folder"
echo " <osxtarget> OSX target (e.g., 10.7)"
echo " [makeopts] Optional: make options for building wxWidgets (e.g., -j4)"
exit 1
fi
# create build paths
createPaths "$2"
# patch wxWidgets sources
echo "*** Patching wxWidgets..."
doPatch "$1" "$3/patches/wxwidgets-3.0.0_macosx.patch"
doPatch "$1" "$3/patches/wxwidgets-3.0.0_macosx_bug_15908.patch"
doPatch "$1" "$3/patches/wxwidgets-3.0.0_macosx_soname.patch"
# high resolution in OpenGL canvas: http://trac.wxwidgets.org/ticket/15700
doPatch "$1" "$3/patches/wxwidgets-3.0.2_macosx_retina_opengl.patch"
# patch to support pinch-to-zoom on trackpads
doPatch "$1" "$3/patches/wxwidgets-3.0.2_macosx_magnify_event.patch"
# configure and build wxWidgets
wxWidgets_configure "$1" "$2" "$4"
wxWidgets_buildInst "$5"
# check if source is wxPython
if [ -d $1/wxPython ];
then
echo "*** Source is wxPython, now building wxPython stuff..."
wxPython_buildInst "$1" "$2"
fi
# remove build dir
echo "*** Removing build folder"
rm -rf wx-build
# done
echo "*** Finished building!"

View File

@ -1,129 +0,0 @@
#!/bin/bash
# v 1.1 Supports migration of links (limited to the same directory) - I should add checks..
# usage osx_fixbundle.sh <bundle-name> <bzr_root>
if [[ ! -f version.h ]]; then
echo "**"
echo "** ERROR: $0 doesn't seems to be launched from the kicad's bzr root !!!"
echo "** Go in the bzr root directory and launch: scripts/osx_fixbundle.sh"
echo "**"
exit 1
fi
EXECUTABLES="`find . -name '*.app'`"
#
# Copies libraries under <bzr_root> in the bundle and relocates them in the binary
#
function fixbundle() {
exec="$1"
bzroot="$2"
execpath="$3"
binary="$4"
LIBRARIES="`otool -L ${binary} | cut -d' ' -f1`"
for library in $LIBRARIES; do
mkdir -p ${execpath}${exec}.app/Contents/Frameworks
if [[ "$library" =~ "$bzroot" ]]; then
echo "${exec}: Migrating `basename $library` in the bundle"
if [ ! -f ${exec}.app/Contents/Frameworks/`basename $library` ]; then
if [ ! -L $library ]; then
cp -f $library ${execpath}${exec}.app/Contents/Frameworks
else
resolvelink "$library" "`dirname $library`" "${execpath}/${exec}.app/Contents/Frameworks"
fi
fi
install_name_tool -change $library @executable_path/../Frameworks/`basename $library` ${binary}
fi
done
# Resolve issue in python modules (.so)
cd ${execpath}
MODULES="`find ${exec}.app -name '*.so'`"
for module in $MODULES; do
LIBRARIES="`otool -L $module | cut -d' ' -f1`"
mkdir -p ${exec}.app/Contents/Frameworks
for library in $LIBRARIES; do
if [[ "$library" =~ "$bzroot" ]]; then
if [ ! -f ${exec}.app/Contents/Frameworks/`basename $library` ]; then
if [ ! -L $library ]; then
cp -f $library ${exec}.app/Contents/Frameworks
else
resolvelink "$library" "`dirname $library`" "${execpath}/${exec}.app/Contents/Frameworks"
fi
fi
install_name_tool -change $library @executable_path/../Frameworks/`basename $library` $module
fi
done
echo "${exec}: elaborated module `basename ${module}`"
done
# Resolve issue between DYNLIBS
dynlib_migrate="1";
dynlib_cycle="0";
while [ $dynlib_migrate -gt 0 ]; do
dynlib_migrate="0";
(( dynlib_cycle += 1 ))
DYNLIBS="`find ${exec}.app -name '*.dylib'`"
for dynlib in $DYNLIBS; do
LIBRARIES="`otool -L $dynlib | cut -d' ' -f1`"
mkdir -p ${exec}.app/Contents/Frameworks
for library in $LIBRARIES; do
if [[ "$library" =~ "$bzroot" ]]; then
if [ ! -f ${exec}.app/Contents/Frameworks/`basename $library` ]; then
if [ ! -L $library ]; then
cp -f $library ${exec}.app/Contents/Frameworks
else
resolvelink "$library" "`dirname $library`" "${execpath}/${exec}.app/Contents/Frameworks"
fi
echo "copied `basename $library` into bundle"
(( dynlib_migrate += 1))
fi
install_name_tool -change $library @executable_path/../Frameworks/`basename $library` $dynlib
fi
done
done
echo "${exec}: bundle dynlib dependencies migration Pass $dynlib_cycle: Migrated $dynlib_migrate libraries in bundle"
done
cd - >/dev/null
}
#
# This supports only links on the same dir (TODO ?)
#
function resolvelink() {
local srclib="`basename $1`"
local srcpath="$2"
local destpath="$3"
#if is a file i expect a pointed ""
local pointed="`readlink ${srcpath}/${srclib}`"
if [ ! -f ${pointed} ]; then
resolvelink "${pointed}" "${srcpath}" "${destpath}"
echo "Link ${srclib} -> ${pointed} "
(cd "${destpath}"; ln -s "${pointed}" "${srclib}" )
else
echo "Copy ${srcpath}/${srclib} -> ${destpath} "
cp "${srcpath}/${srclib}" ${destpath}
fi
}
for executable in $EXECUTABLES;
do
myexecpath="`dirname ${executable}`/"
myexec="`basename ${executable}|sed -e 's/\.app//'`"
fixbundle "${myexec}" "$1" "${myexecpath}" "${myexecpath}${myexec}.app/Contents/MacOS/${myexec}"
fixbundle "${myexec}" "$1" "${myexecpath}" "${myexecpath}${myexec}.app/Contents/MacOS/_${myexec}.kiface"
done