Skip to content

Commit

Permalink
+compile2
Browse files Browse the repository at this point in the history
sq: compile2> 对标deb12, 调试构建tiger #   apt build-dep -y tigervnc
--
# RUN /rootfs/usr/local/tigervnc/bin/Xvnc -version

fix # libjpeg62-turbo> libjpeg8

# test "0" == "$?" && echo Xvnc-ok || exit 1; \

compile2:  |tee -a /usr/local/tigervnc/_build.log

# TODO1: Xvnc未生成,并行跑的原因?

compile2: entry validate run

CPL2: ./hw/vnc/Xvnc -version; \
      test "0" == "$?" && echo Xvnc-ok || exit 1; \

cpl2: fix deps

xkb path

compile2: -DBUILD_VIEWER=false \# X11_Xi_LIB (ADVANCED)

fotmat

compile x11-xkb-utils xkb-data

compile2: fix RUN mkdir -p /usr/local/tigervnc; \

f

fix stage-xrdp

debug #0 16.95   Could NOT find X11 (missing: X11_X11_LIB) 002

fix

view

test "yes" != "$COMPILE_PULSE" && exit 0 || echo doMake; \

compile2: up

compile2: with ARG

compile2: notes tiger
  • Loading branch information
huapox authored and sam#gemmi-win10 committed Oct 20, 2024
1 parent b45c4bd commit 2f37ad4
Showing 1 changed file with 209 additions and 0 deletions.
209 changes: 209 additions & 0 deletions ubt-core/src/Dockerfile.compile2
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
FROM infrastlabs/docker-headless:core-compile as stage-base

###xrdp, xorgxrdp###############################################
FROM stage-base as stage-xrdp
ARG COMPILE_XRDP="yes"
#0.9.5 > 0.9.16 > 0.9.19(thunar@gemmi-deb11卡死)
ENV ver="0.9.16"
# https://hub.fastgit.org/neutrinolabs/xrdp/wiki/Building-on-Debian-8
# configure: error: please install libfdk-aac-dev or fdk-aac-devel
# --enable-tjpeg \
# ./configure --prefix=/usr/local/xrdp --enable-fuse --enable-mp3lame --enable-pixman;\
ADD src/arm /src/arm
# RUN wget https://github.com/neutrinolabs/xrdp/releases/download/v${ver}/xrdp-${ver}.tar.gz; \
RUN mkdir -p /usr/local/xrdp
RUN test "yes" != "$COMPILE_XRDP" && exit 0 || echo doMake; \
tar -zxf /src/arm/xrdp-${ver}.tar.gz;\
cd xrdp-${ver};\
./bootstrap;\
./configure \
--prefix=/usr/local/xrdp \
--enable-vsock \
--enable-fdkaac \
--enable-opus \
--enable-fuse \
--enable-mp3lame \
--enable-pixman \
CFLAGS='-Wno-format';\
make;\
make install;

#####git clone; xorgxrdp with xrdp --prefix, testOK;
# # gitee.com/g-system/xorgxrdp
# RUN git clone --branch br-0214 https://gitee.com/g-system/xorgxrdp;\
# cd xorgxrdp;\
# ./bootstrap;\
# CPPFLAGS="-I/usr/local/xrdp/include" LDFLAGS="-L/usr/local/xrdp/lib" ./configure;\
# make;\
# sudo make install;

###pulseaudio-module-xrdp###############################################
# pulse-xrdp: git-latest
FROM stage-base as stage-pulse
ARG COMPILE_PULSE="yes"
#### pulseaudio-module-xrdp >> pulseaudio ver: 10.0
# RUN git submodule update --init --recursive
RUN mkdir -p /var/lib/xrdp-pulseaudio-installer; \
\
test "yes" != "$COMPILE_PULSE" && exit 0 || echo doMake; \
apt update && apt build-dep -q -y pulseaudio && \
cd /opt && apt source pulseaudio && \
pulseaudio=$(pulseaudio --version | awk '{print $2}') && \
cd /opt/pulseaudio-${pulseaudio} && ./configure
# RUN pulseaudio=$(pulseaudio --version); echo "pulseaudio: $pulseaudio"
# hand copy: /opt/pulseaudio-1.11/config.h +src/pulsecore
# https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
# https://gitee.com/g-system/pulseaudio-module-xrdp.git
RUN test "yes" != "$COMPILE_PULSE" && exit 0 || echo doMake; \
cd /opt && git clone --branch v0.5 https://gitee.com/g-system/pulseaudio-module-xrdp.git && \
cd /opt/pulseaudio-module-xrdp ;\
pulseaudio=$(pulseaudio --version | awk '{print $2}') && echo "pulseaudio ver: $pulseaudio" && \
./bootstrap && ./configure PULSE_DIR="/opt/pulseaudio-${pulseaudio}"; \
cp -a /opt/pulseaudio-${pulseaudio}/config.h . && cp -a /opt/pulseaudio-${pulseaudio}/src/pulsecore/ .; \
make && \
cd /opt/pulseaudio-module-xrdp/src/.libs && \
install -t "/var/lib/xrdp-pulseaudio-installer" -D -m 644 *.so;


###tigervnc###############################################
FROM stage-base as stage-tiger
ARG COMPILE_TIGER="yes"
# ref: https://github.com/abcdesktopio/tigervnc/blob/main/Dockerfile
# RUN \
# # 129 MB
# apt build-dep -y tigervnc

# # RUN apt update; apt -y install cmake;
# RUN apt update; apt install -y \
# cmake libfltk1.3-dev libxi-dev libxshmfence-dev \
# libxcb-dri3-0 \
# libdrm-dev libxfont-dev mesa-common-dev \
# libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev
# # xorg-dev

# # src
# ADD src/arm /src/arm
# WORKDIR /src/arm
# RUN mkdir -p /usr/local/tigervnc; \
# mkdir -p /build; \
# tar -zxf tigervnc-1.12.0.tar.gz -C /build/; \
# tar -jxf xorg-server-1.20.7.tar.bz2 --strip-components=1 -C /build/tigervnc-1.12.0/unix/xserver/; \
# \cp -a tigervnc-1.12.0-configuration_fixes-1.patch /build/; \
# \
# ls /build/tigervnc-1.12.0/unix/xserver/

# # apply patch: tigervnc-1.12.0; xserver120
# WORKDIR /build/tigervnc-1.12.0

#MAKE vncviewver, vncpasswd, vncconfig, ...
# err with armv7:
#0 16.95 CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
#0 16.95 Could NOT find X11 (missing: X11_X11_LIB)
#0 16.95 Could NOT find X11 (missing: X11_X11_LIB) 002

# #==apt install -y cmake libfltk1.3-dev
# # CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
# # Please set them or make sure they are set and tested correctly in the CMake files:
# # X11_Xi_LIB (ADVANCED)
# # linked by target "vncviewer" in directory /build/tigervnc-1.12.0/vncviewer
# # -DBUILD_VIEWER=false
# RUN test "yes" != "$COMPILE_TIGER" && exit 0 || echo doMake; \
# patch -Np1 -i ../tigervnc-1.12.0-configuration_fixes-1.patch; \
# cd unix/xserver && patch -Np1 -i ../xserver120.patch; \
# \
# cd /build/tigervnc-1.12.0; \
# cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr \
# -DBUILD_VIEWER=false \
# -DCMAKE_BUILD_TYPE=Release -DINSTALL_SYSTEMD_UNITS=OFF -Wno-dev . |tee -a /usr/local/tigervnc/_build.log; \
# \
# cat /build/tigervnc-1.12.0/CMakeFiles/CMakeError.log |tee -a /usr/local/tigervnc/_build.log; \
# make |tee -a /usr/local/tigervnc/_build.log; \
# echo "finished";
#
# MAKE SERVER
# # WORKDIR /build/tigervnc-1.12.0/unix/xserver
# # --disable-static
# # --enable-xvfb > --disable-xvfb #不生成xvfb
# # --enable-glx ##libgl1? 24M (drop-all-enabled: 还是有依赖)
# # TODO1: Xvnc未生成,并行跑的原因?
# # make[2]: *** No rule to make target '../../../../common/network/libnetwork.la', needed by 'Xvnc'. Stop.
# RUN \
# test "yes" != "$COMPILE_TIGER" && exit 0 || echo doMake; \
# cd /build/tigervnc-1.12.0/unix/xserver; \
# autoreconf -fiv; \
# CPPFLAGS="-I/usr/include/drm" \
# ./configure $XORG_CONFIG \
# --prefix=/usr/local/tigervnc \
# \
# # https://github.com/jlesage/docker-baseimage-gui/blob/master/src/tigervnc/build.sh
# # 手动重buildOK;
# --sysconfdir=/etc/X11 \
# --localstatedir=/var \
# --with-xkb-path=/usr/share/X11/xkb \
# --with-xkb-output=/var/lib/xkb \
# --with-xkb-bin-directory=/usr/bin \
# \
# --disable-xwayland --disable-dmx \
# --disable-xorg --disable-xnest --disable-xvfb \
# --disable-xwin --disable-xephyr --disable-kdrive \
# --disable-devel-docs --disable-config-hal --disable-config-udev \
# --disable-unit-tests --disable-selective-werror \
# --disable-dri --disable-dri3 --enable-dri2 \
# --with-pic \
# --without-dtrace |tee -a /usr/local/tigervnc/_build.log; \
# make |tee -a /usr/local/tigervnc/_build.log; \
# \
# find /build/tigervnc-1.12.0/ |egrep Xvnc |tee -a /usr/local/tigervnc/_build.log; \
# find /build/tigervnc-1.12.0/ |egrep "libos|librfb|librdr|libnetwork|libunixcommon" |tee -a /usr/local/tigervnc/_build.log; \
# ./hw/vnc/Xvnc -version; \
# # test "0" == "$?" && echo Xvnc-ok || exit 1; \
# \
# make install; \
# echo "finished";

# vncpasswd
# RUN cp /build/tigervnc-1.12.0/unix/vncpasswd/vncpasswd /usr/local/tigervnc/bin/
#
# https://github.com/TigerVNC/tigervnc/issues/800
# LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 vncserver :2 -localhost no

# swrast_dri.so # /usr/lib/dri/swrast_dri.so
# ln -s /usr/lib/x86_64-linux-gnu/dri /usr/lib/dri

###merge: xrdp, pulse, tigervnc###############################################
# 11.9M
# FROM scratch
FROM ubuntu:20.04
ARG TARGETPLATFORM
RUN export DOMAIN="mirrors.ustc.edu.cn"; \
test -z "$(echo $TARGETPLATFORM |grep arm)" && target=ubuntu || target=ubuntu-ports; \
echo "deb http://${DOMAIN}/$target focal main restricted universe multiverse" > /etc/apt/sources.list \
&& echo "deb http://${DOMAIN}/$target focal-updates main restricted universe multiverse">> /etc/apt/sources.list; \
\
echo 'apt update -qq && apt install -yq --no-install-recommends $@ && apt clean && rm -rf /var/lib/apt/lists/*; ' > /usr/local/bin/apt.sh \
&& chmod +x /usr/local/bin/apt.sh
WORKDIR /rootfs/usr/local/tigervnc/bin
COPY --from=stage-xrdp /usr/local/xrdp /rootfs/usr/local/xrdp
COPY --from=stage-pulse /var/lib/xrdp-pulseaudio-installer /rootfs/var/lib/xrdp-pulseaudio-installer
# COPY --from=stage-tiger /usr/local/tigervnc /rootfs/usr/local/tigervnc
# test
# RUN apt.sh \
# libgl1 x11-xkb-utils xkb-data \
# libunwind8 libpixman-1-0 libxfont2 libjpeg8 \
# libxau6 libxdmcp6

# libjpeg62-turbo> libjpeg8
RUN apt.sh \
# --enable-xx ##还是需要libGL.so.1
libjpeg8 openssl \
x11-xkb-utils xkb-data \
\
libgl1 libxau6 libxdmcp6 \
libpixman-1-0 \
libxfont2
RUN find /rootfs;
# RUN /rootfs/usr/local/tigervnc/bin/Xvnc -version

RUN echo "/rootfs/usr/local/tigervnc/bin/Xvnc -ac :50 -listen tcp -rfbauth=/etc/xrdp/vnc_pass -depth 16 -BlacklistThreshold=3 -BlacklistTimeout=1" > /entry.sh; \
chmod +x /entry.sh
CMD ["/entry.sh"]

0 comments on commit 2f37ad4

Please sign in to comment.