Print this page
Remove Python 2.6
| Split |
Close |
| Expand all |
| Collapse all |
--- old/build/python27/build.sh
+++ new/build/python27/build.sh
1 1 #!/usr/bin/bash
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License, Version 1.0 only
7 7 # (the "License"). You may not use this file except in compliance
8 8 # with the License.
9 9 #
10 10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 11 # or http://www.opensolaris.org/os/licensing.
12 12 # See the License for the specific language governing permissions
13 13 # and limitations under the License.
14 14 #
15 15 # When distributing Covered Code, include this CDDL HEADER in each
16 16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 17 # If applicable, add the following below this CDDL HEADER, with the
18 18 # fields enclosed by brackets "[]" replaced with your own identifying
19 19 # information: Portions Copyright [yyyy] [name of copyright owner]
20 20 #
21 21 # CDDL HEADER END
22 22 #
23 23 #
24 24 # Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 27 # Load support functions
28 28 . ../../lib/functions.sh
29 29
30 30 CC=gcc
31 31 CXX=g++
32 32
33 33 PROG=Python
34 34 VER=2.7.13
35 35 PKG=runtime/python-27
36 36 SUMMARY="$PROG"
37 37 DESC="$SUMMARY"
38 38
39 39 BUILD_DEPENDS_IPS="developer/build/autoconf"
40 40 DEPENDS_IPS="system/library/gcc-5-runtime library/zlib library/libffi@$FFIVERS
41 41 library/readline database/sqlite-3 compress/bzip2 library/libxml2
42 42 library/ncurses library/security/openssl"
43 43
44 44 export CCSHARED="-fPIC"
45 45 CFLAGS="$CFLAGS -std=c99"
46 46 LDFLAGS32="-L/usr/gnu/lib -R/usr/gnu/lib"
47 47 LDFLAGS64="-L/usr/gnu/lib/amd64 -R/usr/gnu/lib/amd64"
48 48 CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses -D_LARGEFILE64_SOURCE"
49 49 CPPFLAGS32="-I/usr/lib/libffi-$FFIVERS/include"
50 50 CPPFLAGS64="-I/usr/lib/amd64/libffi-$FFIVERS/include"
51 51 CONFIGURE_OPTS="--enable-shared
52 52 --with-system-ffi
53 53 ac_cv_opt_olimit_ok=no
54 54 ac_cv_olimit_ok=no"
55 55
56 56 preprep_build() {
57 57 pushd $TMPDIR/$BUILDDIR > /dev/null || logerr "Cannot change to build directory"
58 58 /usr/bin/autoheader || logerr "autoheaer failed"
59 59 /usr/bin/autoconf || logerr "autoreconf failed"
60 60 popd > /dev/null
61 61 }
62 62
63 63 post_config() {
64 64 pushd $TMPDIR/$BUILDDIR > /dev/null || logerr "Cannot change to build directory"
65 65 perl -pi -e 's/(^\#define _POSIX_C_SOURCE.*)/\/* $$1 *\//' pyconfig.h
66 66 perl -pi -e 's/^(\#define _XOPEN_SOURCE.*)/\/* $$1 *\//' pyconfig.h
67 67 perl -pi -e 's/^(\#define _XOPEN_SOURCE_EXTENDED.*)/\/* $$1 *\//' pyconfig.h
68 68 popd > /dev/null
69 69 }
70 70
71 71 configure64() {
72 72 logmsg "--- configure (64-bit)"
73 73 CFLAGS="$CFLAGS $CFLAGS64" \
74 74 CXXFLAGS="$CXXFLAGS $CXXFLAGS64" \
75 75 CPPFLAGS="$CPPFLAGS $CPPFLAGS64" \
76 76 LDFLAGS="$LDFLAGS $LDFLAGS64" \
77 77 CC="$CC -m64" CXX=$CXX \
78 78 logcmd $CONFIGURE_CMD $CONFIGURE_OPTS_64 \
79 79 $CONFIGURE_OPTS || \
80 80 logerr "--- Configure failed"
81 81 }
82 82
83 83 make_prog32() {
84 84 post_config
85 85 [[ -n $NO_PARALLEL_MAKE ]] && MAKE_JOBS=""
86 86 logmsg "--- make"
87 87 logcmd $MAKE $MAKE_JOBS DFLAGS=-32 || \
88 88 logerr "--- Make failed"
89 89 }
90 90
91 91 make_prog64() {
92 92 post_config
93 93 [[ -n $NO_PARALLEL_MAKE ]] && MAKE_JOBS=""
94 94 logmsg "--- make"
95 95 logcmd $MAKE $MAKE_JOBS DFLAGS=-64 DESTSHARED=/usr/lib/python2.7/lib-dynload || \
96 96 logerr "--- Make failed"
97 97 }
98 98
99 99 make_install32() {
100 100 make_install
101 101 rm $DESTDIR/usr/bin/i386/python || logerr "--- cannot remove arch hardlink"
102 102 # Copy off _sysconfigdata.py
103 103 sed 's/^/ /g' < $DESTDIR/usr/lib/python2.7/_sysconfigdata.py > \
104 104 /tmp/_sysconfigdata-32-$$.py
105 105
106 106
|
↓ open down ↓ |
106 lines elided |
↑ open up ↑ |
107 107 # Move pyconfig.h header to 32-bit-specific version.
108 108 mv $DESTDIR/usr/include/python2.7/pyconfig.h \
109 109 $DESTDIR/usr/include/python2.7/pyconfig-32.h
110 110 }
111 111 make_install64() {
112 112 logmsg "--- make install"
113 113 logcmd $MAKE DESTDIR=${DESTDIR} install DESTSHARED=/usr/lib/python2.7/lib-dynload || \
114 114 logerr "--- Make install failed"
115 115 rm $DESTDIR/usr/bin/amd64/python || logerr "--- cannot remove arch hardlink"
116 116 rm $DESTDIR/usr/lib/python2.7/config/libpython2.7.a || logerr "--- cannot remove static lib"
117 - # XXX KEBE SAYS Uncomment me eventually...
118 - # (cd $DESTDIR/usr/bin && ln -s python2.7 python) || logerr "--- could not setup python softlink"
117 + (cd $DESTDIR/usr/bin && ln -s python2.7 python) || logerr "--- could not setup python softlink"
119 118 # Copy off _sysconfigdata.py
120 119 sed 's/^/ /g' < $DESTDIR/usr/lib/python2.7/_sysconfigdata.py > \
121 120 /tmp/_sysconfigdata-64-$$.py
122 121 # Generate 32/64-bit agile _sysconfigdata.py
123 122 echo "import sys" > $DESTDIR/usr/lib/python2.7/_sysconfigdata.py
124 123 echo "" >> $DESTDIR/usr/lib/python2.7/_sysconfigdata.py
125 124 echo "if sys.maxsize > 2**32:" >> \
126 125 $DESTDIR/usr/lib/python2.7/_sysconfigdata.py
127 126 cat /tmp/_sysconfigdata-64-$$.py \
128 127 >> $DESTDIR/usr/lib/python2.7/_sysconfigdata.py
129 128 echo "else:" >> $DESTDIR/usr/lib/python2.7/_sysconfigdata.py
130 129 cat /tmp/_sysconfigdata-32-$$.py \
131 130 >> $DESTDIR/usr/lib/python2.7/_sysconfigdata.py
132 131 # Clean up the 32/64 stragglers.
133 132 rm -f /tmp/_sysconfigdata-*-$$.py
134 133 # Postprocessing steps in either IPS or the omnios-build system create
135 134 # the .pyo and .pyc files.
136 135
137 136 # Move pyconfig.h header to 64-bit-specific version.
138 137 mv $DESTDIR/usr/include/python2.7/pyconfig.h \
139 138 $DESTDIR/usr/include/python2.7/pyconfig-64.h
140 139
141 140 logcmd cp $SRCDIR/files/pyconfig.h $DESTDIR/usr/include/python2.7/pyconfig.h
142 141 }
143 142
144 143 install_license(){
145 144 logcmd cp $TMPDIR/$BUILDDIR/LICENSE $DESTDIR/license
146 145 }
147 146
148 147 init
149 148 download_source $PROG $PROG $VER
150 149 patch_source
151 150 preprep_build
152 151 prep_build
153 152 build
154 153 make_isa_stub
155 154 strip_install -x
156 155 install_license
157 156 make_package
158 157 clean_up
|
↓ open down ↓ |
30 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX