Skip to content

Commit

Permalink
core: compile>> split compile2
Browse files Browse the repository at this point in the history
drop duplicate source
  • Loading branch information
huapox authored and sam#gemmi-win10 committed Oct 20, 2024
1 parent 43a0be5 commit 3d2e548
Showing 1 changed file with 3 additions and 146 deletions.
149 changes: 3 additions & 146 deletions ubt-core/src/Dockerfile.compile
Original file line number Diff line number Diff line change
Expand Up @@ -42,158 +42,15 @@ RUN apt.sh \
# deb-src
RUN export DOMAIN="mirrors.ustc.edu.cn"; \
test -z "$(echo $TARGETPLATFORM |grep arm)" && target=ubuntu || target=ubuntu-ports; \
echo "deb-src http://$DOMAIN/$target focal main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb-src http://$DOMAIN/$target focal-updates main restricted universe multiverse">> /etc/apt/sources.list
echo "deb-src http://$DOMAIN/$target focal main restricted universe multiverse" >> /etc/apt/sources.list; \
echo "deb-src http://$DOMAIN/$target focal-updates main restricted universe multiverse">> /etc/apt/sources.list; \
cat /etc/apt/sources.list;
RUN apt update && apt install -qy pulseaudio libpulse-dev \
autoconf m4 intltool build-essential dpkg-dev
# BUILD_tiger ##########
# src
RUN export domain="mirrors.ustc.edu.cn"; \
test -z "$(echo $TARGETPLATFORM |grep arm)" && target=ubuntu || target=ubuntu-ports; \
echo "deb-src http://$domain/$target focal main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb-src http://$domain/$target focal-updates main restricted universe multiverse">> /etc/apt/sources.list; \
cat /etc/apt/sources.list;
# INSTALL dev, dep and sources
RUN apt update; \
# 25.6M
apt install -y --no-install-recommends ca-certificates fakeroot devscripts devscripts binutils wget;

WORKDIR /opt

###xrdp, xorgxrdp###############################################
FROM stage-base as stage-xrdp

#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 \
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-pulsexrdp
#### pulseaudio-module-xrdp >> pulseaudio ver: 10.0
# RUN git submodule update --init --recursive
RUN 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 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###############################################
# ref: https://github.com/abcdesktopio/tigervnc/blob/main/Dockerfile
FROM stage-base as stage-tiger
RUN \
# 129 MB
apt build-dep -y tigervnc

# SRC
ADD src/arm /src/arm
WORKDIR /src/arm
RUN 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)
RUN 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 -DCMAKE_BUILD_TYPE=Release -DINSTALL_SYSTEMD_UNITS=OFF -Wno-dev . && make

# MAKE SERVER
WORKDIR /build/tigervnc-1.12.0/unix/xserver
# --disable-static
# --enable-xvfb > --disable-xvfb #不生成xvfb
# --enable-glx ##libgl1? 24M (drop-all-enabled: 还是有依赖)
RUN autoreconf -fiv; \
CPPFLAGS="-I/usr/include/drm" \
./configure $XORG_CONFIG \
--prefix=/usr/local/tigervnc \
--disable-xwayland --disable-dri --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 \
--enable-dri3 --enable-dri2 \
--with-pic \
--without-dtrace; \
make && make install;
# 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-pulsexrdp /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 \
# --enable-xx ##还是需要libGL.so.1
libgl1 \
libunwind8 libpixman-1-0 libxfont2 libjpeg8 \
libxau6 libxdmcp6
RUN find /rootfs; /rootfs/usr/local/tigervnc/bin/Xvnc -version

0 comments on commit 3d2e548

Please sign in to comment.