Blame 200.coreutils.build

lalbornoz 340f4c
export CFLAGS="${CFLAGS_PACKAGES}";
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
parse_with_pkg_name "${2}"								\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"ftp://ftp.gnu.org/gnu/coreutils/coreutils-${COREUTILS_VERSION}.tar.xz" ""	\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"ftp://ftp.gnu.org/gnu/diffutils/diffutils-${DIFFUTILS_VERSION}.tar.xz" ""	\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"http://alpha.gnu.org/gnu/findutils/findutils-${FINDUTILS_VERSION}.tar.gz"	\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
		"CFLAGS=${CFLAGS:+${CFLAGS} }-Dendpwent=setpwent"			\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"ftp://ftp.gnu.org/gnu/patch/patch-${PATCH_VERSION}.tar.gz" ""			\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"ftp://ftp.gnu.org/gnu/gawk/gawk-${GAWK_VERSION}.tar.xz" ""			\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"ftp://ftp.gnu.org/gnu/bash/bash-${BASH_VERSION}.tar.gz"			\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
		"_configure_extra_args=--without-bash-malloc"				\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"ftp://ftp.gnu.org/gnu/make/make-${MAKE_VERSION}.tar.bz2" ""			\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"ftp://ftp.gnu.org/gnu/grep/grep-${GREP_VERSION}.tar.xz" ""			\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"ftp://ftp.gnu.org/gnu/grep/grep-${GREP_VERSION}.tar.xz" ""			\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"ftp://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" ""			\
lalbornoz 340f4c
	"ftp://sourceware.org/pub/binutils/snapshots/binutils-${BINUTILS_VERSION}.tar.bz2" "";
lalbornoz 340f4c
lalbornoz 340f4c
if is_build_script_done finished; then
lalbornoz 340f4c
        exit 212;
lalbornoz 340f4c
else
lalbornoz 340f4c
	fetch "${_pkg_url}";
lalbornoz 340f4c
	if [ "${_pkg_name}" = "binutils" ]\
lalbornoz 340f4c
	&& [ "${3}" = "host" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
		_configure_extra_args="--disable-werror,--prefix=${PREFIX},--with-sysroot=${PREFIX_TARGET}";
lalbornoz 340f4c
		_no_config_cache=${_no_prefix:=1}; _target="${TARGET}";
lalbornoz 340f4c
	fi;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done extracted; then
lalbornoz 340f4c
	rm_if_exists "${_pkg_subdir}";
lalbornoz 340f4c
	tar -axf "${_pkg_fname}";
lalbornoz 340f4c
	set_build_script_done extracted -patched;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done patched; then
lalbornoz 340f4c
	patch -d "${_pkg_subdir}" -p1			\
lalbornoz 340f4c
		< "portage/${_pkg_subdir}.midipix.patch";
lalbornoz 340f4c
	set_build_script_done patched -configured;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done configured; then
lalbornoz 340f4c
	rm_if_exists -c -m "${_pkg_subdir}-build-${_target:-native}";
lalbornoz 340f4c
	[ ${_no_config_cache:-0} -eq 0 ] &&\
lalbornoz 340f4c
		cp -a "../portage/config.cache" .;
lalbornoz 340f4c
	run_configure_with_extra_args			\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
		"../${_pkg_subdir}/configure"		\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
		"${_configure_extra_args}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
		-C					\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
		--host="${HOST_NATIVE}"			\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
		--prefix=				\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
		--target="${TARGET}";
lalbornoz 340f4c
	set_build_script_done configured -built;
lalbornoz 340f4c
else
lalbornoz 340f4c
	cd "${_pkg_subdir}-build-${_target:-native}";
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done built; then
lalbornoz 340f4c
	make ${MAKEFLAGS};
lalbornoz 340f4c
	set_build_script_done built -installed;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done installed; then
lalbornoz 340f4c
	if [ ${_no_prefix:-0} -eq 0 ]; then
lalbornoz 340f4c
		make ${MAKEFLAGS} DESTDIR="${PREFIX_NATIVE}" install;
lalbornoz 340f4c
	else
lalbornoz 340f4c
		make ${MAKEFLAGS} install;
lalbornoz 340f4c
	fi;
lalbornoz 340f4c
	set_build_script_done installed finished;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
lalbornoz 340f4c
# vim:filetype=sh