dev for openEuler
This commit is contained in:
parent
cc9c16a5d6
commit
a90c9aba96
4
env.sh
4
env.sh
|
@ -36,6 +36,10 @@ else
|
|||
fi
|
||||
|
||||
DISPLAY_SERVER=$(cat ${HOME}/.xsession-errors | grep XDG_SESSION_TYPE | head -n 1 | cut -d "=" -f2)
|
||||
if [ "${DISPLAY_SERVER}" = "" ]; then
|
||||
ps -ef | grep -v grep | grep kwin_x11
|
||||
[ $? = 0 ] && DISPLAY_SERVER=x11 || DISPLAY_SERVER=wayland
|
||||
fi
|
||||
PYTHON_VERSION=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
|
||||
whitelist="/usr/share/deepin-elf-verify/whitelist"
|
||||
pypi_mirror="https://pypi.tuna.tsinghua.edu.cn/simple"
|
||||
|
|
|
@ -89,7 +89,7 @@ init_pip(){
|
|||
|
||||
install_py_deb(){
|
||||
rm -rf ${1}*
|
||||
apt download ${1} > /tmp/env.log 2>&1
|
||||
${yq} download ${1} > /tmp/env.log 2>&1
|
||||
if [ $? != 0 ]; then
|
||||
cat /tmp/env.log
|
||||
exit 120
|
||||
|
|
|
@ -15,14 +15,16 @@ echo "
|
|||
"
|
||||
|
||||
env(){
|
||||
sudo apt update
|
||||
if [ "${debian_platform}" = "true" ]; then
|
||||
sudo apt update
|
||||
fi
|
||||
|
||||
deb_array=(
|
||||
python3-pip
|
||||
python3-tk
|
||||
sshpass
|
||||
scrot
|
||||
openjdk-8-jdk
|
||||
openjdk-11-jdk-headless
|
||||
gir1.2-atspi-2.0
|
||||
libatk-adaptor
|
||||
at-spi2-core
|
||||
|
@ -35,13 +37,20 @@ env(){
|
|||
deb_array=(
|
||||
python3-pip
|
||||
sshpass
|
||||
openjdk-8-jdk
|
||||
openjdk-11-jdk-headless
|
||||
)
|
||||
fi
|
||||
|
||||
if [ "${debian_platform}" = "false" ]; then
|
||||
deb_array[${#deb_array[@]}]=java-11-openjdk-headless
|
||||
deb_array[${#deb_array[@]}]=python3-tkinter
|
||||
deb_array[${#deb_array[@]}]=xdotool
|
||||
deb_array[${#deb_array[@]}]=opencv
|
||||
fi
|
||||
|
||||
for deb in ${deb_array[*]}
|
||||
do
|
||||
sudo apt install -y ${deb} > /tmp/env.log 2>&1
|
||||
sudo ${yq} install -y ${deb} > /tmp/env.log 2>&1
|
||||
check_status ${deb}
|
||||
done
|
||||
|
||||
|
@ -92,7 +101,7 @@ do
|
|||
install_py_deb ${pd} ${python_virtualenv_path}
|
||||
done
|
||||
|
||||
apt download python3-gi-cairo > /tmp/env.log 2>&1
|
||||
${yq} download python3-gi-cairo > /tmp/env.log 2>&1
|
||||
dpkg -x python3-gi-cairo*.deb python3-gi-cairo
|
||||
cp -r ./python3-gi-cairo/usr/lib/python3/dist-packages/gi/* ${python_virtualenv_path}/lib/python${PYTHON_VERSION}/site-packages/gi/
|
||||
rm -rf python3-gi-cairo*
|
||||
|
|
|
@ -234,8 +234,13 @@ class _Config(object):
|
|||
_Config.options = {}
|
||||
|
||||
# 显示服务器
|
||||
DISPLAY_SERVER = os.popen("cat ~/.xsession-errors | grep XDG_SESSION_TYPE | head -n 1").read().split("=")[
|
||||
-1].strip("\n")
|
||||
|
||||
DISPLAY_SERVER = (
|
||||
os.popen("cat ~/.xsession-errors | grep XDG_SESSION_TYPE | head -n 1")
|
||||
.read()
|
||||
.split("=")[-1]
|
||||
.strip("\n")
|
||||
) or ("x11" if os.popen("ps -ef | grep -v grep | grep kwin_x11").read() else "wayland")
|
||||
|
||||
class DisplayServer:
|
||||
wayland = "wayland"
|
||||
|
|
Loading…
Reference in New Issue