midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame vars/musl.vars

Lucio Andrés Illanes Albornoz (arab, vxp) 1d0876
#
Lucio Andrés Illanes Albornoz (arab, vxp) 820be1
# . ./build.vars and set -o errexit -o noglob are assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
# Order: no_complex, native, full
Lucio Andrés Illanes Albornoz (arab, vxp) 1d0876
#
Lucio Andrés Illanes Albornoz (arab, vxp) 1d0876
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
pkgp_musl_configure() {
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	secure_rm ${PKG_BUILD_DIR};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	insecure_mkdir ${PKG_BUILD_DIR};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	secure_cd ${PKG_BUILD_DIR};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	env	lz_cflags_cmdline=""		\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		lz_debug="yes"			\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	../lazy/lazy				\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		-a ${ARCH}			\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		-c gcc				\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		-f ${PKG_PREFIX}		\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		-n musl				\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		-p ../musl-${PKG_MUSL_VERSION}	\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		-t ${lz_target}			\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		-x config;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
lalbornoz 340f4c
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
pkg_musl_no_complex_all() {
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	PKG_MUSL_VERSION="${PKG_MUSL_NO_COMPLEX_VERSION}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	# Git clone what we need.
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
	pkg_fetch -git "lazy=${GITROOT}/lazy";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	export lz_arch=${ARCH} lz_cflags_debug=-O2 lz_target=${TARGET};
lalbornoz 340f4c
	# Musl: build (no-complex)
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	_install=install_no_complex;
Lucio Andrés Illanes Albornoz (arab, vxp) 59765f
	set_build_dir musl-${PKG_MUSL_VERSION}-${2} cross;
Lucio Andrés Illanes Albornoz (arab, vxp) 1d0876
	if ! is_build_script_done fetch; then
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
		pkg_fetch http://www.musl-libc.org/releases/musl-${PKG_MUSL_VERSION}.tar.gz	\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			${PKG_MUSL_NO_COMPLEX_SHA256SUM};
Lucio Andrés Illanes Albornoz (arab, vxp) afe7b9
		secure_rm mmglue;
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
		pkg_fetch -git "mmglue=${GITROOT}/mmglue";
Lucio Andrés Illanes Albornoz (arab, vxp) 1d0876
		set_build_script_done fetch -extract;
Lucio Andrés Illanes Albornoz (arab, vxp) 1d0876
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 1d0876
	if ! is_build_script_done extract; then
Lucio Andrés Illanes Albornoz (arab, vxp) afe7b9
		secure_rm musl-${PKG_MUSL_VERSION};
Lucio Andrés Illanes Albornoz (arab, vxp) 820be1
		tar -xf ${DLCACHEDIR}/musl-${PKG_MUSL_VERSION}.tar.gz;
Lucio Andrés Illanes Albornoz (arab, vxp) 820be1
		set +o noglob; cp -R -- mmglue/* musl-${PKG_MUSL_VERSION}/; set -o noglob;
Lucio Andrés Illanes Albornoz (arab, vxp) 65771c
		set_build_script_done extract -configure;
lalbornoz 340f4c
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	if ! is_build_script_done configure; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		pkgp_musl_configure;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		set_build_script_done configure clean -build;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	else
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		cd ${PKG_BUILD_DIR};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	if ! is_build_script_done clean; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		make ${MAKEFLAGS} clean;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		set_build_script_done clean -build;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	if ! is_build_script_done build; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		./lazy	-e ${_install}			\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			-x build;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		set_build_script_done build finish;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
pkg_musl_native_all() {
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	PKG_MUSL_VERSION="${PKG_MUSL_NATIVE_VERSION}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	# Git clone what we need.
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
	pkg_fetch -git "lazy=${GITROOT}/lazy";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	export lz_arch=${ARCH} lz_cflags_debug=-O2 lz_target=${TARGET};
lalbornoz 340f4c
	# Musl: build (full)
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	_install=install;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	set_build_dir musl-${PKG_MUSL_VERSION} native;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	if ! is_build_script_done configure; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		pkgp_musl_configure;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		set_build_script_done configure clean -build;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	else
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		cd ${PKG_BUILD_DIR};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	if ! is_build_script_done clean; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		make ${MAKEFLAGS} clean;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		set_build_script_done clean -build;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	if ! is_build_script_done build; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		./lazy	-e ${_install}			\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			-x build;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		ln -sf -- ../lib/libc.so ${PKG_PREFIX}/bin/ldd;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		set_build_script_done build finish;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
pkg_musl_full_all() {
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	PKG_MUSL_VERSION="${PKG_MUSL_FULL_VERSION}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	# Git clone what we need.
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
	pkg_fetch -git "lazy=${GITROOT}/lazy";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	export lz_arch=${ARCH} lz_cflags_debug=-O2 lz_target=${TARGET};
lalbornoz 340f4c
	# Musl: build (full)
Lucio Andrés Illanes Albornoz (arab, vxp) 6e940c
	_install=install;
Lucio Andrés Illanes Albornoz (arab, vxp) c49754
	set_build_dir musl-${PKG_MUSL_VERSION} cross;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	if ! is_build_script_done configure; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		pkgp_musl_configure;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		set_build_script_done configure clean -build;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	else
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		cd ${PKG_BUILD_DIR};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	if ! is_build_script_done clean; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		make ${MAKEFLAGS} clean;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		set_build_script_done clean -build;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	if ! is_build_script_done build; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		./lazy	-e ${_install}			\
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			-x build;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		set_build_script_done build finish;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
lalbornoz 340f4c
lalbornoz 340f4c
# vim:filetype=sh