From fd0919108f454c1889a49e3e4ad8f3e98f0de4b9 Mon Sep 17 00:00:00 2001 From: superconvert Date: Sat, 6 Aug 2022 00:17:23 +0800 Subject: [PATCH] modify some script --- 02_build_img.sh | 15 ------------- common.sh | 17 +++++++++++++++ mk_xorg.sh | 57 ++++++++++++++++++++++++++++++++----------------- 3 files changed, 55 insertions(+), 34 deletions(-) diff --git a/02_build_img.sh b/02_build_img.sh index cdffaed..3ab685a 100755 --- a/02_build_img.sh +++ b/02_build_img.sh @@ -1,20 +1,5 @@ #!/bin/sh -red='\e[0;41m' # 红色 -RED='\e[1;31m' -green='\e[0;32m' # 绿色 -GREEN='\e[1;32m' -yellow='\e[5;43m' # 黄色 -YELLOW='\e[1;33m' -blue='\e[0;34m' # 蓝色 -BLUE='\e[1;34m' -purple='\e[0;35m' # 紫色 -PURPLE='\e[1;35m' -cyan='\e[4;36m' # 蓝绿色 -CYAN='\e[1;36m' -WHITE='\e[1;37m' # 白色 -NC='\e[0m' # 没有颜色 - # 导入公共环境 . ./common.sh diff --git a/common.sh b/common.sh index ce72d2b..73234ff 100755 --- a/common.sh +++ b/common.sh @@ -1,3 +1,20 @@ +#!/bin/sh + +red='\e[0;41m' # 红色 +RED='\e[1;31m' +green='\e[0;32m' # 绿色 +GREEN='\e[1;32m' +yellow='\e[5;43m' # 黄色 +YELLOW='\e[1;33m' +blue='\e[0;34m' # 蓝色 +BLUE='\e[1;34m' +purple='\e[0;35m' # 紫色 +PURPLE='\e[1;35m' +cyan='\e[4;36m' # 蓝绿色 +CYAN='\e[1;36m' +WHITE='\e[1;37m' # 白色 +NC='\e[0m' # 没有颜色 + # 处理器 core_num=`nproc` diff --git a/mk_xorg.sh b/mk_xorg.sh index bb4a303..ea54db6 100755 --- a/mk_xorg.sh +++ b/mk_xorg.sh @@ -23,7 +23,7 @@ cd source XORG_SRC_NAME=$(file_name ${XORG_SRC_URL}) if [ ! -f ${XORG_SRC_NAME} ]; then - wget $XORG_SRC_URL + wget -c -t 0 $XORG_SRC_URL fi cd .. @@ -60,101 +60,120 @@ fi # 编译 xclient # #-------------------------------------------- -export XLOAD_CFLAGS="-I${xorg_install}/xclient/usr" -export XLOAD_LDFLAGS="-L${xorg_install}/xclient/usr/lib" +export CFLAGS="-I${xorg_install}/xclient/usr/include" +export LDFLAGS="-L${xorg_install}/xclient/usr/lib" +export ACLOCAL="aclocal -I /usr/share/aclocal:${xorg_install}/xclient/usr/share/aclocal" +export PKG_CONFIG_PATH="${xorg_install}/xclient/usr/share/pkgconfig:${xorg_install}/xclient/usr/lib/pkgconfig" + +if [ ! -f xclient.tar.gz ]; then + git clone https://gitlab.freedesktop.org/xorg/util/macros.git + git clone https://gitlab.freedesktop.org/xorg/proto/xcbproto.git + git clone https://gitlab.freedesktop.org/xorg/proto/xorgproto.git + git clone https://gitlab.freedesktop.org/xorg/lib/libxau.git + git clone https://gitlab.freedesktop.org/xorg/lib/libxcb.git + git clone https://gitlab.freedesktop.org/xorg/lib/libxtrans.git + git clone https://gitlab.freedesktop.org/xorg/lib/libx11.git + git clone https://gitlab.freedesktop.org/xorg/lib/libice.git + git clone https://gitlab.freedesktop.org/xorg/lib/libsm.git + git clone https://gitlab.freedesktop.org/xorg/lib/libxt.git + git clone https://gitlab.freedesktop.org/xorg/lib/libxext.git + git clone https://gitlab.freedesktop.org/xorg/lib/libxmu.git + git clone https://gitlab.freedesktop.org/xorg/lib/libxpm.git + git clone https://gitlab.freedesktop.org/xorg/lib/libxaw.git + git clone https://gitlab.freedesktop.org/xorg/lib/libxdmcp.git + git clone https://gitlab.freedesktop.org/xorg/app/xload.git + tar zcf xclient.tar.gz macros xcbproto xorgproto libxau libxcb libxtrans libx11 libice libsm libxt libxext libxmu libxpm libxaw libxdmcp xload +else + rm -rf macros xcbproto xorgproto libxau libxcb libxtrans libx11 libice libsm libxt libxext libxmu libxpm libxaw libxdmcp xload + tar zxf xclient.tar.gz +fi echo "${GREEN}build macros begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/util/macros.git cd macros ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build macros success${NC}" cd .. && sleep 1 echo "${GREEN}build xcbproto begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/proto/xcbproto.git cd xcbproto ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build xcbproto success${NC}" cd .. && sleep 1 echo "${GREEN}build xorgproto begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/proto/xorgproto.git cd xorgproto ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build xorgproto success${NC}" cd .. && sleep 1 echo "${GREEN}build libxau begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libxau.git cd libxau ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libxau success${NC}" cd .. && sleep 1 echo "${GREEN}build libxcb begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libxcb.git cd libxcb ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libxcb success${NC}" cd .. && sleep 1 echo "${GREEN}build libxtrans begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libxtrans.git + cd libxtrans ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libxtrans success${NC}" cd .. && sleep 1 echo "${GREEN}build libx11 begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libx11.git cd libx11 ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libx11 success${NC}" cd .. && sleep 1 echo "${GREEN}build libice begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libice.git + cd libice ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libice success${NC}" cd .. && sleep 1 echo "${GREEN}build libsm begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libsm.git + cd libsm ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libsm success${NC}" cd .. && sleep 1 echo "${GREEN}build libxt begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libxt.git + cd libxt ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libxt success${NC}" cd .. && sleep 1 echo "${GREEN}build libxext begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libxext.git + cd libxext ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libxext success${NC}" cd .. && sleep 1 echo "${GREEN}build libxmu begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libxmu.git + cd libxmu ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libxmu success${NC}" cd .. && sleep 1 echo "${GREEN}build libxpm begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libxpm.git + cd libxpm ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libxpm success${NC}" cd .. && sleep 1 echo "${GREEN}build libxaw begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libxaw.git + cd libxaw ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libxaw success${NC}" cd .. && sleep 1 echo "${GREEN}build libxdmcp begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/lib/libxdmcp.git + cd libxdmcp ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build libxdmcp success${NC}" cd .. && sleep 1 echo "${GREEN}build xload begin${NC}" -git clone https://gitlab.freedesktop.org/xorg/app/xload.git + cd xload ./autogen.sh && ./configure --prefix=/usr && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" make -j8 && make install -j8 DESTDIR=${xorg_install}"/xclient" && echo "${GREEN}build xload success${NC}" cd .. && sleep 1