2022-08-01 22:57:30 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-08-03 22:19:42 +08:00
|
|
|
# 预装工具
|
2022-08-06 20:48:29 +08:00
|
|
|
apt install git autoconf libtool gcc g++ gettext pkg-config m4 -y
|
|
|
|
apt install xutils-dev xtrans-dev libpixman-1-dev libdrm-dev libx11-dev libgl-dev libgcrypt-dev libxkbfile-dev libxfont-dev libpciaccess-dev libepoxy-dev libgbm-dev libegl1-mesa-dev -y
|
2022-08-03 22:19:42 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------
|
|
|
|
#
|
|
|
|
# 导入公共变量
|
|
|
|
#
|
|
|
|
#-----------------------------------------------
|
|
|
|
. ./common.sh
|
|
|
|
|
|
|
|
XORG_SRC_URL=https://www.x.org/archive/individual/xserver/xorg-server-1.20.11.tar.bz2
|
|
|
|
|
|
|
|
#----------------------------
|
|
|
|
#
|
|
|
|
# 下载源码
|
|
|
|
#
|
|
|
|
#----------------------------
|
|
|
|
mkdir -pv source
|
|
|
|
cd source
|
|
|
|
|
|
|
|
XORG_SRC_NAME=$(file_name ${XORG_SRC_URL})
|
|
|
|
if [ ! -f ${XORG_SRC_NAME} ]; then
|
2022-08-06 00:17:23 +08:00
|
|
|
wget -c -t 0 $XORG_SRC_URL
|
2022-08-03 22:19:42 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
#---------------------------
|
|
|
|
#
|
|
|
|
# 解压源码
|
|
|
|
#
|
|
|
|
#---------------------------
|
|
|
|
mkdir -pv ${build_dir}
|
|
|
|
|
|
|
|
XORG_SRC_DIR=${build_dir}"/"$(file_dirname ${XORG_SRC_NAME} .tar.bz2)
|
|
|
|
if [ ! -d ${XORG_SRC_DIR} ]; then
|
|
|
|
echo "unzip ${XORG_SRC_NAME} source code"
|
|
|
|
tar xf source/${XORG_SRC_NAME} -C ${build_dir}
|
|
|
|
fi
|
|
|
|
|
|
|
|
#---------------------------------------------
|
|
|
|
#
|
|
|
|
# 编译源码
|
|
|
|
#
|
|
|
|
#---------------------------------------------
|
|
|
|
cd ${build_dir}
|
2022-08-06 06:15:14 +08:00
|
|
|
xserver_dir=${xorg_install}"/xclient"
|
|
|
|
xclient_dir=${xorg_install}"/xclient"
|
2022-08-03 22:19:42 +08:00
|
|
|
|
|
|
|
# 编译
|
|
|
|
if [ ! -d "xorg_install" ]; then
|
|
|
|
mkdir -pv xorg_install && cd ${XORG_SRC_DIR} && make distclean && ./autogensh
|
2022-08-06 06:15:14 +08:00
|
|
|
./configure ${CFGOPT}
|
|
|
|
CFLAGS="-L${glibc_install}/lib64 $CFLAGS" make -j8 && make install -j8 DESTDIR=${xserver_dir} && cd ..
|
2022-08-03 22:19:42 +08:00
|
|
|
fi
|
|
|
|
|
2022-08-05 00:08:53 +08:00
|
|
|
#--------------------------------------------
|
|
|
|
#
|
|
|
|
# 编译 xclient
|
|
|
|
#
|
|
|
|
#--------------------------------------------
|
2022-08-06 06:15:14 +08:00
|
|
|
export CFGOPT="--prefix=/usr --with-sysroot=${xorg_install}/xclient --with-build-sysroot=${xorg_install}/xclient"
|
2022-08-06 00:17:23 +08:00
|
|
|
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
|
2022-08-05 00:08:53 +08:00
|
|
|
|
|
|
|
echo "${GREEN}build macros begin${NC}"
|
|
|
|
cd macros
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build macros success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build xcbproto begin${NC}"
|
|
|
|
cd xcbproto
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build xcbproto success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build xorgproto begin${NC}"
|
|
|
|
cd xorgproto
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build xorgproto success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libxau begin${NC}"
|
|
|
|
cd libxau
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libxau success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libxcb begin${NC}"
|
|
|
|
cd libxcb
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libxcb success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libxtrans begin${NC}"
|
2022-08-06 00:17:23 +08:00
|
|
|
|
2022-08-05 00:08:53 +08:00
|
|
|
cd libxtrans
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libxtrans success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libx11 begin${NC}"
|
|
|
|
cd libx11
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libx11 success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libice begin${NC}"
|
|
|
|
cd libice
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libice success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libsm begin${NC}"
|
2022-08-06 00:17:23 +08:00
|
|
|
|
2022-08-05 00:08:53 +08:00
|
|
|
cd libsm
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libsm success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libxt begin${NC}"
|
2022-08-06 00:17:23 +08:00
|
|
|
|
2022-08-05 00:08:53 +08:00
|
|
|
cd libxt
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libxt success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libxext begin${NC}"
|
2022-08-06 00:17:23 +08:00
|
|
|
|
2022-08-05 00:08:53 +08:00
|
|
|
cd libxext
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libxext success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libxmu begin${NC}"
|
2022-08-06 00:17:23 +08:00
|
|
|
|
2022-08-05 00:08:53 +08:00
|
|
|
cd libxmu
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libxmu success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libxpm begin${NC}"
|
2022-08-06 00:17:23 +08:00
|
|
|
|
2022-08-05 00:08:53 +08:00
|
|
|
cd libxpm
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libxpm success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libxaw begin${NC}"
|
2022-08-06 00:17:23 +08:00
|
|
|
|
2022-08-05 00:08:53 +08:00
|
|
|
cd libxaw
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libxaw success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build libxdmcp begin${NC}"
|
2022-08-06 00:17:23 +08:00
|
|
|
|
2022-08-05 00:08:53 +08:00
|
|
|
cd libxdmcp
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build libxdmcp success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
|
|
|
echo "${GREEN}build xload begin${NC}"
|
2022-08-06 00:17:23 +08:00
|
|
|
|
2022-08-05 00:08:53 +08:00
|
|
|
cd xload
|
2022-08-06 06:15:14 +08:00
|
|
|
./autogen.sh && ./configure ${CFGOPT} && make -j8 && make install -j8 DESTDIR=${xclient_dir} && echo "${GREEN}build xload success${NC}"
|
2022-08-05 00:08:53 +08:00
|
|
|
cd .. && sleep 1
|
|
|
|
|
2022-08-03 22:19:42 +08:00
|
|
|
cd ..
|