From 05e6185f7740f3acef556ba39cff95139bd7130d Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Feb 06 2017 00:20:04 +0000 Subject: build.sh, {subr,vars}/*: general cleanup. --- diff --git a/subr/build.subr b/subr/build.subr index 698a71e..35b8a22 100644 --- a/subr/build.subr +++ b/subr/build.subr @@ -21,6 +21,9 @@ build_fileop() { elif [ "${_op}" = ln_symbolic ]; then log_msg varn "Linking \`${1}' to \`${2}' w/ -fs"; [ \( -n "${1}" \) -a \( -n "${2}" \) ] && ln -fs -- "${1}" "${2}"; + elif [ "${_op}" = mv ]; then + log_msg varn "Moving \`${1}' to \`${2}' w/ -fs"; + [ \( -n "${1}" \) -a \( -n "${2}" \) ] && mv -f -- "${1}" "${2}"; elif [ "${_op}" = mkdir ]\ || [ "${_op}" = rm ]; then while [ ${#} -gt 0 ]; do diff --git a/subr/post_strip.subr b/subr/post_strip.subr index 5225021..fd04556 100644 --- a/subr/post_strip.subr +++ b/subr/post_strip.subr @@ -4,8 +4,7 @@ post_strip() { local __; - if [ ${BUILD_SCRIPT_RC:-0} -eq 0 ]\ - && [ "${BUILD}" = release ]; then + if [ "${BUILD}" = release ]; then for __ in $(find ${PREFIX_NATIVE}/bin -perm -0100 \( -type f -or -type l \)); do if objdump -sj .debug_info >/dev/null 2>&1; then log_msg vnfo "${PKG_TARGET}-strip ${__}"; diff --git a/vars/apr.vars b/vars/apr.vars index 6342e35..a36daa4 100644 --- a/vars/apr.vars +++ b/vars/apr.vars @@ -6,8 +6,8 @@ pkg_apr_install_post() { sed -e 's,echo "\$APR_BUILD_DIR/libtool",echo '"${PREFIX}"'/bin/slibtool,' \ -e 's,echo "\${installbuilddir}/libtool",echo '"${PREFIX}"'/bin/slibtool,' \ -e 's,flags="\$flags -I\$includedir \$EXTRA_INCLUDES",flags="-I'"${PKG_PREFIX}"'/include/apr-1",' \ - ${PKG_PREFIX}/bin/apr-1-config > ${PREFIX}/bin/${PKG_TARGET}-apr-1-config; - chmod +x ${PREFIX}/bin/${PKG_TARGET}-apr-1-config; + "${PKG_PREFIX}/bin/apr-1-config" > "${PREFIX}/bin/${PKG_TARGET}-apr-1-config"; + chmod +x "${PREFIX}/bin/${PKG_TARGET}-apr-1-config"; }; # vim:filetype=sh diff --git a/vars/apr_util.vars b/vars/apr_util.vars index 8356448..d4014b9 100644 --- a/vars/apr_util.vars +++ b/vars/apr_util.vars @@ -4,8 +4,8 @@ pkg_apr_util_install_post() { build_fileop cp \ - ${PKG_PREFIX}/bin/apu-1-config \ - ${PREFIX}/bin/${PKG_TARGET}-apu-1-config; + "${PKG_PREFIX}/bin/apu-1-config" \ + "${PREFIX}/bin/${PKG_TARGET}-apu-1-config"; }; # vim:filetype=sh diff --git a/vars/clang_host.vars b/vars/clang_host.vars index 56793f9..03ded26 100644 --- a/vars/clang_host.vars +++ b/vars/clang_host.vars @@ -3,15 +3,16 @@ # pkg_clang_host_configure_pre() { - build_fileop rm ${WORKDIR}/Makefile; + build_fileop rm "${WORKDIR}/Makefile"; }; pkg_clang_host_configure() { - build_fileop rm ../cfe-${PKG_VERSION}-host; - build_fileop mkdir ../cfe-${PKG_VERSION}-host; - build_fileop cd ../cfe-${PKG_VERSION}-host; + build_fileop rm "../cfe-${PKG_VERSION}-host"; + build_fileop mkdir "../cfe-${PKG_VERSION}-host"; + build_fileop cd "../cfe-${PKG_VERSION}-host"; log_msg info "Bootstrapping clang_host..."; - (${PREFIX}/bin/cmake ../cfe-${PKG_VERSION}.src \ + ("${PREFIX}/bin/cmake" \ + "../cfe-${PKG_VERSION}.src" \ -DCLANG_BUILD_EXAMPLES:BOOL=OFF \ -DCLANG_INCLUDE_DOCS:BOOL=OFF \ -DCLANG_INCLUDE_TESTS:BOOL=OFF \ diff --git a/vars/cmake.vars b/vars/cmake.vars index bbcfacb..ceee815 100644 --- a/vars/cmake.vars +++ b/vars/cmake.vars @@ -3,36 +3,36 @@ # pkg_cmake_configure() { - build_fileop cp ../cmake-${PKG_VERSION}/Modules/Platform/BSDOS.cmake \ - ../cmake-${PKG_VERSION}/Modules/Platform/Midipix.cmake; - build_fileop rm ../cmake-${PKG_VERSION}-host; - build_fileop mkdir ../cmake-${PKG_VERSION}-host; - build_fileop cd ../cmake-${PKG_VERSION}-host; + build_fileop cp "../cmake-${PKG_VERSION}/Modules/Platform/BSDOS.cmake" \ + "../cmake-${PKG_VERSION}/Modules/Platform/Midipix.cmake"; + build_fileop rm "../cmake-${PKG_VERSION}-host"; + build_fileop mkdir "../cmake-${PKG_VERSION}-host"; + build_fileop cd "../cmake-${PKG_VERSION}-host"; log_msg info "Bootstrapping cmake..."; (unset AR CC CXX RANLIB; - ../cmake-${PKG_VERSION}/configure ${PKG_CONFIGURE_ARGS}; - make ${DEFAULT_MAKEFLAGS_BUILD} DESTDIR=${PREFIX} install); + "../cmake-${PKG_VERSION}/configure" ${PKG_CONFIGURE_ARGS}; + make ${DEFAULT_MAKEFLAGS_BUILD} "DESTDIR=${PREFIX}" install); log_msg info "Finished bootstrapping cmake."; - stat ../cmake-${PKG_VERSION}; + stat "../cmake-${PKG_VERSION}"; }; pkg_cmake_build() { local _prefix; - build_fileop rm ../cmake-${PKG_VERSION}-native-${PKG_TARGET}; - build_fileop mkdir ../cmake-${PKG_VERSION}-native-${PKG_TARGET}; - build_fileop cd ${WORKDIR}/cmake-${PKG_VERSION}-native-${PKG_TARGET}; + build_fileop rm "../cmake-${PKG_VERSION}-native-${PKG_TARGET}"; + build_fileop mkdir "../cmake-${PKG_VERSION}-native-${PKG_TARGET}"; + build_fileop cd "${WORKDIR}/cmake-${PKG_VERSION}-native-${PKG_TARGET}"; rm -f config.cache; log_msg info "Calling cmake..."; - _prefix=${PREFIX}; + _prefix="${PREFIX}"; env CFLAGS="-L${PKG_PREFIX}/lib --sysroot=${PKG_PREFIX}" \ PREFIX="" cmake \ - -DBZIP2_INCLUDE_DIR=${PKG_PREFIX}/include \ - -DBZIP2_LIBRARIES=${PKG_PREFIX}/lib/libbz2.a \ - -DCMAKE_AR=${_prefix}/bin/${AR} \ - -DCMAKE_C_COMPILER=${_prefix}/bin/${CC} \ - -DCMAKE_CXX_COMPILER=${_prefix}/bin/${PKG_TARGET}-g++ \ + -DBZIP2_INCLUDE_DIR="${PKG_PREFIX}/include" \ + -DBZIP2_LIBRARIES="${PKG_PREFIX}/lib/libbz2.a" \ + -DCMAKE_AR="${_prefix}/bin/${AR}" \ + -DCMAKE_C_COMPILER="${_prefix}/bin/${CC}" \ + -DCMAKE_CXX_COMPILER="${_prefix}/bin/${PKG_TARGET}-g++" \ -DCMAKE_INSTALL_PREFIX= \ - -DCMAKE_RANLIB=${_prefix}/bin/${RANLIB} \ + -DCMAKE_RANLIB="${_prefix}/bin/${RANLIB}" \ -DCMAKE_SYSTEM_NAME=Midipix \ -DCMAKE_USE_SYSTEM_BZIP2=ON \ -DCMAKE_USE_SYSTEM_CURL=ON \ @@ -40,20 +40,20 @@ pkg_cmake_build() { -DCMAKE_USE_SYSTEM_LIBARCHIVE=ON \ -DCMAKE_USE_SYSTEM_ZLIB=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DCURL_INCLUDE_DIR=${PKG_PREFIX}/include/curl \ - -DCURL_LIBRARY=${PKG_PREFIX}/lib/libcurl.lib.a \ - -DCURSES_NCURSES_LIBRARY=${PKG_PREFIX}/lib/libncurses.so \ + -DCURL_INCLUDE_DIR="${PKG_PREFIX}/include/curl" \ + -DCURL_LIBRARY="${PKG_PREFIX}/lib/libcurl.lib.a" \ + -DCURSES_NCURSES_LIBRARY="${PKG_PREFIX}/lib/libncurses.so" \ -DKWSYS_LFS_WORKS=YES \ - -DLibArchive_INCLUDE_DIR=${PKG_PREFIX}/include \ - -DLibArchive_LIBRARY=${PKG_PREFIX}/lib/libarchive.lib.a \ + -DLibArchive_INCLUDE_DIR="${PKG_PREFIX}/include" \ + -DLibArchive_LIBRARY="${PKG_PREFIX}/lib/libarchive.lib.a" \ -DLIBLZMA_HAS_AUTO_DECODER=YES \ -DLIBLZMA_HAS_EASY_ENCODER=YES \ -DLIBLZMA_HAS_LZMA_PRESET=YES \ - -DLIBLZMA_INCLUDE_DIR=${PKG_PREFIX}/include \ - -DLIBLZMA_LIBRARY=${PKG_PREFIX}/lib/liblzma.lib.a \ - -DZLIB_INCLUDE_DIR=${PKG_PREFIX}/include \ - -DZLIB_LIBRARY=${PKG_PREFIX}/lib/libz.a \ - ../cmake-${PKG_VERSION}; + -DLIBLZMA_INCLUDE_DIR="${PKG_PREFIX}/include" \ + -DLIBLZMA_LIBRARY="${PKG_PREFIX}/lib/liblzma.lib.a" \ + -DZLIB_INCLUDE_DIR="${PKG_PREFIX}/include" \ + -DZLIB_LIBRARY="${PKG_PREFIX}/lib/libz.a" \ + "../cmake-${PKG_VERSION}"; log_msg info "Calling make..."; make ${DEFAULT_MAKEFLAGS_BUILD}; }; diff --git a/vars/git.vars b/vars/git.vars index d9d9a4b..4e9b419 100644 --- a/vars/git.vars +++ b/vars/git.vars @@ -4,10 +4,9 @@ pkg_git_install_post() { local __ _new; - for __ in $(find ${PKG_PREFIX}/share/man -name Git*::* -type f); do + for __ in $(find "${PKG_PREFIX}/share/man" -name "Git*::*" -type f); do _new="$(echo ${__} | sed "s/::/./g")"; - echo mv -f ${__} ${_new}; - mv -f ${__} ${_new}; + build_fileop mv "${__}" "${_new}"; done; }; diff --git a/vars/libxml2.vars b/vars/libxml2.vars index 4d4f269..f0bd0f0 100644 --- a/vars/libxml2.vars +++ b/vars/libxml2.vars @@ -3,17 +3,17 @@ # pkg_libxml2_install_post() { - if [ -e ${PREFIX}/bin/${TARGET}-xml2-config ]; then - build_fileop rm ${PREFIX}/bin/${TARGET}-xml2-config; + if [ -e "${PREFIX}/bin/${TARGET}-xml2-config" ]; then + build_fileop rm "${PREFIX}/bin/${TARGET}-xml2-config"; fi; - cat > ${PREFIX}/bin/${TARGET}-xml2-config < "${PREFIX}/bin/${TARGET}-xml2-config" < ${PREFIX}/bin/${TARGET}-pkg-config < "${PREFIX}/bin/${TARGET}-pkg-config" <