summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2014-09-02 02:46:25 +0000
committer~suv <suv-sf@users.sourceforge.net>2014-09-02 02:46:25 +0000
commit17b5820427aba6feef34f27e1134c9c32f1a54bf (patch)
tree1b46143ac9184fb7ea92d0a1844f91264fcf944c /packaging
parentadd more custom portfiles for Leopard and Python 2.5 (diff)
downloadinkscape-17b5820427aba6feef34f27e1134c9c32f1a54bf.tar.gz
inkscape-17b5820427aba6feef34f27e1134c9c32f1a54bf.zip
Fix python module bundling for Python 2.5 and 2.6. Support custom location for python modules (default is from MacPorts)
(bzr r13506.1.50)
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/macosx/osx-app.sh53
-rwxr-xr-xpackaging/macosx/osx-build.sh4
2 files changed, 40 insertions, 17 deletions
diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh
index 87e6391e1..ea9c3a4d2 100755
--- a/packaging/macosx/osx-app.sh
+++ b/packaging/macosx/osx-app.sh
@@ -35,7 +35,7 @@
# Defaults
strip=false
-add_python=true #false
+add_python=true
python_dir=""
# If LIBPREFIX is not already set (by osx-build.sh for example) set it to blank (one should use the command line argument to set it correctly)
@@ -136,15 +136,20 @@ if [ ! -f "$plist" ]; then
fi
if [ ${add_python} = "true" ]; then
- if [ "x$python_dir" == "x" ]; then
+ if [ -z "$python_dir" ]; then
echo "Python modules will be copied from MacPorts tree."
else
if [ ! -e "$python_dir" ]; then
echo "Python modules directory \""$python_dir"\" not found." >&2
exit 1
else
- # TODO: check directoy structure and reject old one based on ppc/i386
- echo "Python modules will be copied from $python_dir."
+ if [ -e "$python_dir/i386" -o -e "$python_dir/ppc" ]; then
+ echo "Outdated structure in custom python modules detected,"
+ echo "not compatible with current packaging."
+ exit 1
+ else
+ echo "Python modules will be copied from $python_dir."
+ fi
fi
fi
fi
@@ -332,9 +337,16 @@ if [ ${add_python} = "true" ]; then
# lxml
$cp_cmd -RL "$packages_path/lxml" "$pkgpython"
# numpy
- $cp_cmd -RL "$packages_path/numpy" "$pkgpython"
$cp_cmd -RL "$packages_path/nose" "$pkgpython"
+ $cp_cmd -RL "$packages_path/numpy" "$pkgpython"
# UniConvertor
+ $cp_cmd -RL "$packages_path/PIL" "$pkgpython"
+ if [ "$PYTHON_VER" == "2.5" ]; then
+ $cp_cmd -RL "$packages_path/_imaging.so" "$pkgpython"
+ $cp_cmd -RL "$packages_path/_imagingcms.so" "$pkgpython"
+ $cp_cmd -RL "$packages_path/_imagingft.so" "$pkgpython"
+ $cp_cmd -RL "$packages_path/_imagingmath.so" "$pkgpython"
+ fi
$cp_cmd -RL "$packages_path/sk1libs" "$pkgpython"
$cp_cmd -RL "$packages_path/uniconvertor" "$pkgpython"
# cleanup python modules
@@ -348,19 +360,30 @@ if [ ${add_python} = "true" ]; then
}
if [ $OSXMINORNO -eq "5" ]; then
- PYTHON_VERSIONS=("2.5" "2.6" "2.7")
+ PYTHON_VERSIONS="2.5 2.6 2.7"
elif [ $OSXMINORNO -eq "6" ]; then
- PYTHON_VERSIONS=("2.6" "2.7")
+ PYTHON_VERSIONS="2.6 2.7"
else # if [ $OSXMINORNO -ge "7" ]; then
- PYTHON_VERSIONS=("2.7")
+ PYTHON_VERSIONS="2.7"
+ fi
+ if [ -z "$python_dir" ]; then
+ for PYTHON_VER in $PYTHON_VERSIONS; do
+ python_dir="$(${LIBPREFIX}/bin/python${PYTHON_VER}-config --prefix)"
+ packages_path="${python_dir}/lib/python${PYTHON_VER}/site-packages"
+ pkgpython="${pkglib}/python${PYTHON_VER}/site-packages"
+ mkdir -p $pkgpython
+ install_py_modules
+ done
+ else
+ # copy custom python site-packages.
+ # They need to be organized in a hierarchical set of directories by python major+minor version:
+ # - ${python_dir}/python2.5/site-packages/lxml
+ # - ${python_dir}/python2.5/site-packages/nose
+ # - ${python_dir}/python2.5/site-packages/numpy
+ # - ${python_dir}/python2.6/site-packages/lxml
+ # - ...
+ cp -rvf "$python_dir"/* "$pkglib"
fi
- for PYTHON_VER in $PYTHON_VERSIONS; do
- python_dir="$(${LIBPREFIX}/bin/python${PYTHON_VER}-config --prefix)"
- packages_path="${python_dir}/lib/python${PYTHON_VER}/site-packages"
- pkgpython="${pkglib}/python${PYTHON_VER}/site-packages"
- mkdir -p $pkgpython
- install_py_modules
- done
fi
sed -e "s,__build_arch__,$ARCH,g" -i "" $pkgbin/inkscape
diff --git a/packaging/macosx/osx-build.sh b/packaging/macosx/osx-build.sh
index 8c759b6e1..961a90d2d 100755
--- a/packaging/macosx/osx-build.sh
+++ b/packaging/macosx/osx-build.sh
@@ -70,11 +70,11 @@ Compilation script for Inkscape on Mac OS X.
\033[1m$0 conf build install\033[0m
configure, build and install a dowloaded version of Inkscape in the default
directory, keeping debugging information.
- \033[1m$0 u a c b -p ~ i -s -py ~/site-packages/ p d\033[0m
+ \033[1m$0 u a c b -p ~ i -s -py ~/python_modules/ p d\033[0m
update an bzr checkout, prepare configure script, configure,
build and install Inkscape in the user home directory (~).
Then package Inkscape without debugging information,
- with python packages from ~/site-packages/ and prepare
+ with python packages from ~/python_modules/ and prepare
a dmg for distribution."
}