midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame 101.gmp.build

Lucio Andrés Illanes Albornoz (arab, vxp) c49754
parse_with_pkg_name ${2} gmp mpfr mpc libelf binutils;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
[ -n "${_pkg_CC}" ] && export CC="${_pkg_CC}";
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
[ -n "${_pkg_CFLAGS}" ] && export CFLAGS="${_pkg_CFLAGS}";
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) c49754
	set_build_dir ${_pkg_subdir} native;
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;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
	if [ ${_pkg_no_libtool_midipix:-0} -eq 0 ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
		cp -a portage/libtool.midipix ${_pkg_subdir}/;
lalbornoz 340f4c
	fi;
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) c49754
	rm_if_exists -m -c ${_build_dir};
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	../${_pkg_subdir}/configure		\
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
		${_pkg_configure_extra_args}	\
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
		--host=${HOST_NATIVE}		\
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
		--prefix=${_pkg_prefix:-/}	\
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) c49754
	cd ${_build_dir};
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done built; then
lalbornoz 340f4c
	make;
lalbornoz 340f4c
	set_build_script_done configured built -installed1;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done installed1; then
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	make DESTDIR=${PREFIX_NATIVE} install;
lalbornoz 340f4c
	set_build_script_done configured installed1 -installed2 -finished;
lalbornoz 340f4c
fi;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
if [ -n "${_pkg_prefix_extra}" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
	if ! is_build_script_done installed2; then
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
		make DESTDIR=${_pkg_prefix_extra} install;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
		set_build_script_done configured installed2 -finished;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
elif [ "x${_pkg_name}" = "xlibelf" ]; then
lalbornoz 340f4c
	if ! is_build_script_done installed2; then
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
		rm -f lib/libelf.def;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
		echo EXPORTS > lib/libelf.def;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
		perk -e lib/libelf.so >> lib/libelf.def;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
		${HOST_NATIVE}-dlltool			\
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
			--output-lib lib/libelf.lib.a	\
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
			--dllname libelf.so		\
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
			--input-def lib/libelf.def;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
		cp lib/libelf.lib.a ${PREFIX}/lib;
lalbornoz 340f4c
		set_build_script_done configured installed2 -finished;
lalbornoz 340f4c
	fi;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
set_build_script_done finished;
lalbornoz 340f4c
lalbornoz 340f4c
# vim:filetype=sh