summaryrefslogtreecommitdiffstats
path: root/packaging/macos/120-python3.sh
blob: 3d5b31528fa4eb7cb108ad4ef93f5a97ed3a7849 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This file is part of the build pipeline for Inkscape on macOS.
#
# ### 120-python3.sh ###
# Install a dedicated Python 3 for JHBuild because it fails to install
# a working Python by itself.

### load settings and functions ################################################

SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
for script in $SELF_DIR/0??-*.sh; do source $script; done

run_annotated

### install Python 3 ###########################################################

get_source $URL_PYTHON36_BIN $WRK_DIR
get_source $URL_PYTHON36_SRC

sed -i "" "/^WRK_DIR/s/.*/WRK_DIR=$(escape_sed $WRK_DIR)/" 020-vars.sh
sed -i "" '/^FRA_DIR/s/.*/FRA_DIR=$WRK_DIR/' 020-vars.sh

# Using the relocatable version of the framework as starting point,
# we're going to turn the link paths into fixed (non-relocatable) ones.
grep -v "cp " 310-package-fixed.sh > 311-package-fixed-nocp.sh
chmod 755 311-package-fixed-nocp.sh
./311-package-fixed-nocp.sh

ln -sf $WRK_DIR/Python.framework/Versions/Current/bin/python3 $BIN_DIR