blob: ac7bd852205c200aa2d9d2611c0c59c26d0de346 (
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
#
# . ./build.vars and set -o errexit are assumed.
#
# Order for build level 2 (runtime:) psxtypes pemagine dalist ntapi psxscl ntcon ntctty
parse_with_pkg_name ${2} \
bash binutils binutils_host bzip2 coreutils \
dalist dash diffutils findutils gawk git gmp \
grep gzip less libelf libressl libz make mpc mpfr \
ncurses ntapi ntcon ntctty patch pemagine popt psxscl \
psxstub psxtypes rsync sed tar util_linux which xz;
case "${SCRIPT_FNAME%[0-9][0-9]*}" in
1) _configure_args="--host=${HOST_NATIVE} --prefix=${PKG_PREFIX:-/} --target=${TARGET}";
PKG_NO_CONFIG_CACHE=1; ;;
2)
_configure_args="--prefix=${PREFIX_LVL} --host=${HOST_NATIVE}";
PKG_BUILD_TYPE=cross; PKG_URL_TYPE=git;
PKG_NO_CONFIG_CACHE=${PKG_NO_DESTDIR:=${PKG_NO_EXTRACT:=${PKG_NO_LIBTOOL_MIDIPIX:=1}}};
PKG_UNSET_VARS_BUILD="CC LD CFLAGS LDFLAGS PREFIX";
export CFLAGS_PATH=-I${PREFIX_LVL}/include;
export LDFLAGS_PATH=-L${PREFIX_LVL}/lib;
;;
*) _configure_args=${PKG_CONFIGURE_ARGS:--C --host=${HOST_NATIVE} --prefix= --target=${TARGET}}; ;;
esac;
if ! is_build_script_done fetch; then
if [ "x${PKG_URL_TYPE:-wget}" = "xwget" ]; then
rm_if_exists $(get_basename ${PKG_URL});
fetch ${PKG_URL} ${PKG_SHA256SUM};
else
rm_if_exists ${PKG_SUBDIR};
fetch_git ${PKG_SUBDIR} ${PKG_URL} "${PKG_GIT_ARGS_EXTRA}";
PKG_NO_EXTRACT=1;
fi;
set_build_script_done fetch -extract;
else
[ "x${PKG_URL_TYPE:-wget}" = "xwget" ] || PKG_NO_EXTRACT=1;
fi;
if command -v pkg_${PKG_NAME}_finish >/dev/null; then
pkg_${PKG_NAME}_finish; exit 0;
elif [ ${PKG_NO_EXTRACT:-0} -eq 0 ] &&\
! is_build_script_done extract; then
rm_if_exists ${PKG_SUBDIR};
tar -axf ${PKG_FNAME};
set_build_script_done extract -build_dir;
fi;
if [ -n "${PKG_BUILD_DIR}" ]; then
BUILD_DIR=${PKG_BUILD_DIR};
else
set_build_dir ${PKG_SUBDIR} ${PKG_BUILD_TYPE:-native};
fi;
if ! is_build_script_done build_dir; then
[ ${PKG_SUBDIR} != ${BUILD_DIR} ] &&\
rm_if_exists -m ${BUILD_DIR};
set_build_script_done build_dir -patch;
fi;
if ! is_build_script_done patch; then
[ -f portage/${PKG_SUBDIR}.midipix.patch ] && \
patch -b -d ${PKG_SUBDIR} -p1 \
< portage/${PKG_SUBDIR}.midipix.patch;
[ ${PKG_NO_PATCH_LOCAL:-0} -eq 0 ] && \
[ -f ${_PWD}/${PKG_SUBDIR}.local.patch ] && \
patch -b -d ${PKG_SUBDIR} -p1 \
< ${_PWD}/${PKG_SUBDIR}.local.patch;
if [ -n "${PKG_PATCHES_EXTRA_URL}" ]; then
apply_patches ${PKG_PATCHES_EXTRA_URL} ${PKG_SUBDIR};
if [ -n "${PKG_PATCHES_EXTRA_MANIFEST}" ]; then
compare_hash_manifest ${PKG_PATCHES_EXTRA_MANIFEST};
fi;
fi;
[ ${PKG_NO_CONFIG_CACHE:-0} -eq 0 ] &&\
cp portage/config.cache ${BUILD_DIR}/;
[ ${PKG_NO_LIBTOOL_MIDIPIX:-0} -eq 0 ] && \
cp portage/libtool.midipix ${PKG_SUBDIR}/;
set_build_script_done patch -configure;
fi;
cd ${BUILD_DIR};
if [ ${PKG_NO_CONFIGURE:-0} -eq 0 ]\
&& ! is_build_script_done configure; then
../${PKG_SUBDIR}/configure \
${_configure_args} \
${PKG_CONFIGURE_ARGS_EXTRA};
set_build_script_done configure clean -build;
else
set_build_script_done clean;
fi;
if [ ${PKG_NO_CLEAN:-0} -eq 0 ]\
&& ! is_build_script_done clean; then
make ${MAKEFLAGS} clean;
set_build_script_done clean -build;
fi;
if ! is_build_script_done build; then
if [ -n "${PKG_UNSET_VARS_BUILD}" ]; then
unset ${PKG_UNSET_VARS_BUILD}
fi;
make ${PKG_MAKEFLAGS_BUILD_EXTRA:+${PKG_MAKEFLAGS_BUILD_EXTRA}}\
${MAKEFLAGS} \
${AR:+AR=${AR}} \
${CC:+CC=${CC}} ${CFLAGS:+"CFLAGS=${CFLAGS}"} \
${LD:+LD=${LD}} ${LDFLAGS:+"LDFLAGS=${LDFLAGS}"}\
${RANLIB:+RANLIB=${RANLIB}};
set_build_script_done build -install1;
fi;
if ! is_build_script_done install1; then
if command -v pkg_${PKG_NAME}_install >/dev/null; then
pkg_${PKG_NAME}_install;
elif [ ${PKG_NO_DESTDIR:-0} -eq 0 ]; then
make ${PKG_MAKEFLAGS_INSTALL_EXTRA:+${PKG_MAKEFLAGS_BUILD_EXTRA}}\
${MAKEFLAGS} \
${AR:+AR=${AR}} \
${CC:+CC=${CC}} ${CFLAGS:+"CFLAGS=${CFLAGS}"} \
${LD:+LD=${LD}} ${LDFLAGS:+"LDFLAGS=${LDFLAGS}"}\
${RANLIB:+RANLIB=${RANLIB}} \
DESTDIR=${PREFIX_LVL} install;
else
make ${PKG_MAKEFLAGS_INSTALL_EXTRA:+${PKG_MAKEFLAGS_BUILD_EXTRA}}\
${MAKEFLAGS} \
${AR:+AR=${AR}} \
${CC:+CC=${CC}} ${CFLAGS:+"CFLAGS=${CFLAGS}"} \
${LD:+LD=${LD}} ${LDFLAGS:+"LDFLAGS=${LDFLAGS}"}\
${PREFIX:+PREFIX=${PREFIX}} \
${RANLIB:+RANLIB=${RANLIB}} install;
fi;
set_build_script_done install1 -install2 -finish;
fi;
if [ -n "${PKG_PREFIX_EXTRA}" ]\
&& ! is_build_script_done install2; then
make DESTDIR=${PKG_PREFIX_EXTRA} install;
set_build_script_done install2 -install3 -finish;
fi;
if command -v pkg_${PKG_NAME}_install_post >/dev/null\
&& ! is_build_script_done install3; then
pkg_${PKG_NAME}_install_post;
set_build_script_done install3 -finish;
fi;
set_build_script_done finish;
# vim:filetype=sh
|