Blame 200.coreutils.build

lalbornoz 340f4c
export CFLAGS="${CFLAGS_PACKAGES}";
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
parse_with_pkg_name ${2}								\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	https://ftp.gnu.org/gnu/coreutils/coreutils-${PKG_COREUTILS_VERSION}.tar.xz ""	\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	https://ftp.gnu.org/gnu/diffutils/diffutils-${PKG_DIFFUTILS_VERSION}.tar.xz ""	\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	http://alpha.gnu.org/gnu/findutils/findutils-${PKG_FINDUTILS_VERSION}.tar.gz	\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
		"CFLAGS=${CFLAGS:+${CFLAGS} }-Dendpwent=setpwent"			\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	https://ftp.gnu.org/gnu/patch/patch-${PKG_PATCH_VERSION}.tar.gz ""		\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	https://ftp.gnu.org/gnu/gawk/gawk-${PKG_GAWK_VERSION}.tar.xz ""			\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	https://ftp.gnu.org/gnu/bash/bash-${PKG_BASH_VERSION}.tar.gz			\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
		_configure_extra_args=--without-bash-malloc				\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	https://ftp.gnu.org/gnu/make/make-${PKG_MAKE_VERSION}.tar.bz2 ""		\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	https://ftp.gnu.org/gnu/grep/grep-${PKG_GREP_VERSION}.tar.xz ""			\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	https://ftp.gnu.org/gnu/sed/sed-${PKG_SED_VERSION}.tar.bz2 ""			\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_VERSION}.tar.bz2 "";
lalbornoz 340f4c
lalbornoz 340f4c
if is_build_script_done finished; then
lalbornoz 340f4c
        exit 212;
lalbornoz 340f4c
else
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	fetch ${_pkg_url} ${_pkg_sha256sum};
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	if [ "x${_pkg_name}" = "xbinutils" ]\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	&& [ "x${3}" = "xhost" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) fa26ee
		_configure_args="--disable-werror,--prefix=${PREFIX},--with-sysroot=${PREFIX_TARGET}";
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
		_no_config_cache=${_no_prefix:=1}; _target=${TARGET};
Lucio Andrés Illanes Albornoz (arab, vxp) fa26ee
	else
Lucio Andrés Illanes Albornoz (arab, vxp) fa26ee
		_configure_args="-C,--host=${HOST_NATIVE},--prefix=${_configure_extra_args:+,${_configure_extra_args}}";
lalbornoz 340f4c
	fi;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done extracted; then
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	rm_if_exists ${_pkg_subdir};
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	tar -axf ${_pkg_fname};
lalbornoz 340f4c
	set_build_script_done extracted -patched;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done patched; then
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	patch -d ${_pkg_subdir} -p1			\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
		< 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
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	rm_if_exists -c -m ${_pkg_subdir}-build-${_target:-native};
lalbornoz 340f4c
	[ ${_no_config_cache:-0} -eq 0 ] &&\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
		cp -a ../portage/config.cache .;
lalbornoz 340f4c
	run_configure_with_extra_args			\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
		../${_pkg_subdir}/configure		\
Lucio Andrés Illanes Albornoz (arab, vxp) fa26ee
		"${_configure_args}"			\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
		--target=${TARGET};
lalbornoz 340f4c
	set_build_script_done configured -built;
lalbornoz 340f4c
else
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	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
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
		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