56 lines
1.5 KiB
Bash
Executable file
56 lines
1.5 KiB
Bash
Executable file
#!/bin/bash
|
|
cd `dirname $0`
|
|
set -e
|
|
|
|
brew=$HOME/.local
|
|
prefix=$HOME/python
|
|
|
|
export PATH="$brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin"
|
|
export HOMEBREW_CACHE="$HOME/Library/Caches/Homebrew"
|
|
|
|
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
|
|
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
|
|
|
|
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
|
|
|
|
export PATH="$prefix/bin:$PATH"
|
|
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
|
|
|
|
./configure \
|
|
--prefix=$prefix \
|
|
--enable-ipv6 \
|
|
--datarootdir=$prefix/share \
|
|
--datadir=$prefix/share \
|
|
--without-gcc MACOSX_DEPLOYMENT_TARGET=10.11
|
|
|
|
make
|
|
make install PYTHONAPPSDIR=$prefix
|