openmedialibrary_platform_d.../prepare.sh

57 lines
1.5 KiB
Bash
Raw Normal View History

2015-11-25 13:58:17 +00:00
#!/bin/bash
cd `dirname $0`
set -e
2015-11-25 15:30:57 +00:00
brew=$HOME/.local
prefix=$HOME/python
export PATH="$brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin"
2015-11-25 13:58:17 +00:00
export HOMEBREW_CACHE="$HOME/Library/Caches/Homebrew"
2015-11-25 15:30:57 +00:00
if [ ! -e $brew ]; then
mkdir -p $brew
curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C $brew
mkdir -p $brew
mkdir homebrew && curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C $brew
2015-11-25 13:58:17 +00:00
brew update
fi
brew install openssl
brew install sqlite
brew install xz
brew install python3
pip3 install --upgrade pip setuptools
brew install libxml2
brew install libxslt
brew link libxml2 --force
brew link libxslt --force
curl https://git.0x2620.org/openmedialibrary.git/blob_plain/HEAD:/requirements.txt > requirements.txt
pip3 install -r requirements.txt
2015-11-25 15:30:57 +00:00
name=Python-3.5.0
rm -rf $name
tar xf $HOMEBREW_CACHE/python3-3.5.0.tar.xz
cd $name
patch -p1 < $HOMEBREW_CACHE/python3--patch-029cc0dc72b1bcf4ddc5f913cc4a3fd970378073c6355921891f041aca2f8b12.diff
2015-11-25 13:58:17 +00:00
2015-11-25 15:30:57 +00:00
export PATH="$prefix/bin:$PATH"
2015-11-25 13:58:17 +00:00
CPPFLAGS="-I$brew/opt/openssl/include/openssl"
LDFLAGS=""
for pkg in openssl sqlite readline gdbm xz; do
CPPFLAGS="$CPPFLAGS -I$brew/opt/$pkg/include"
LDFLAGS="$LDFLAGS -L$brew/opt/$pkg/lib"
done
export CPPFLAGS
export LDFLAGS
2015-11-25 15:30:57 +00:00
./configure \
--prefix=$prefix \
--enable-ipv6 \
--datarootdir=$prefix/share \
--datadir=$prefix/share \
--without-gcc MACOSX_DEPLOYMENT_TARGET=10.11
2015-11-25 13:58:17 +00:00
make
make install PYTHONAPPSDIR=$prefix