midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame 207.libz.build

lalbornoz 340f4c
if is_build_script_done finished; then
lalbornoz 340f4c
        exit 212;
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
elif [ "x${2}" = "xlibz" ]; then
lalbornoz 340f4c
	_pkg_url="https://sortix.org/libz/release/libz-${LIBZ_VERSION}.tar.gz";
lalbornoz 340f4c
	_pkg_fname="${_pkg_url##*/}";
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	_pkg_subdir="${2}-${LIBZ_VERSION}";
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
elif [ "x${2}" = "xgzip" ]; then
lalbornoz 340f4c
	_pkg_url="ftp://ftp.gnu.org/gnu/gzip/gzip-${GZIP_VERSION}.tar.gz";
lalbornoz 340f4c
	_pkg_fname="${_pkg_url##*/}";
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	_pkg_subdir="${2}-${GZIP_VERSION}";
lalbornoz 340f4c
fi;
lalbornoz 340f4c
fetch "${_pkg_url}";
lalbornoz 340f4c
if ! is_build_script_done extracted; then
lalbornoz 340f4c
	rm_if_exists "${_pkg_fname%%.tar*}";
lalbornoz 340f4c
	tar -axf "${_pkg_fname}";
lalbornoz 340f4c
	set_build_script_done extracted -patched;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done configured; then
lalbornoz 340f4c
	set_build_dir "${_pkg_fname%%-*}" "${TARGET}";
lalbornoz 340f4c
	rm_if_exists -c -m "${_build_dir}";
lalbornoz 340f4c
	cp -a "../portage/config.cache" .;
lalbornoz 340f4c
	CFLAGS="${CFLAGS_PACKAGES}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) f5eeee
	"../${_pkg_subdir}/configure"		\
lalbornoz 340f4c
		--host="${HOST_NATIVE}"		\
lalbornoz 340f4c
		--prefix=""			\
lalbornoz 340f4c
		--target="${TARGET}";
lalbornoz 340f4c
	set_build_script_done configured -built;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done built; then
lalbornoz 340f4c
	if [ "x${3}" = "xlibz" ]; then
lalbornoz 340f4c
		make -j18;
lalbornoz 340f4c
	elif [ "x${3}" = "xgzip" ]; then
lalbornoz 340f4c
		make clean;
lalbornoz 340f4c
		make CFLAGS="-g3 -O0 -I${PREFIX_NATIVE}/include" LDFLAGS="--sysroot=${PREFIX_NATIVE}";
lalbornoz 340f4c
	fi;
lalbornoz 340f4c
	set_build_script_done built -installed;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
if ! is_build_script_done installed; then
lalbornoz 340f4c
	if [ "x${3}" = "xlibz" ]; then
lalbornoz 340f4c
		make -j18 DESTDIR="${PREFIX_NATIVE}" install;
lalbornoz 340f4c
	elif [ "x${3}" = "xgzip" ]; then
lalbornoz 340f4c
		cp -a gunzip gzip zcat "${PREFIX_NATIVE}/bin";
lalbornoz 340f4c
	fi;
lalbornoz 340f4c
	set_build_script_done installed finished;
lalbornoz 340f4c
fi;
lalbornoz 340f4c
lalbornoz 340f4c
# vim:filetype=sh