Skip to content

Commit

Permalink
compile2: with ARG
Browse files Browse the repository at this point in the history
  • Loading branch information
huapox committed Oct 15, 2023
1 parent 01505f0 commit c24a1a7
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions ubt-core/src/Dockerfile.compile2
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM infrastlabs/docker-headless:core-compile
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
Expand All @@ -11,7 +10,8 @@ ENV ver="0.9.16"
# ./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 \
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;\
Expand All @@ -38,18 +38,22 @@ make install;

###pulseaudio-module-xrdp###############################################
# pulse-xrdp: git-latest
FROM stage-base as stage-pulsexrdp
FROM stage-base as stage-pulse
ARG COMPILE_PULSE="yes"
#### pulseaudio-module-xrdp >> pulseaudio ver: 10.0
# RUN git submodule update --init --recursive
RUN apt update && apt build-dep -q -y pulseaudio && \
RUN mkdir -p /var/lib/xrdp-pulseaudio-installer; \
\
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 && \
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}"; \
Expand All @@ -60,13 +64,15 @@ RUN cd /opt && git clone --branch v0.5 https://gitee.com/g-system/pulseaudio-mod


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

# SRC
# src
ADD src/arm /src/arm
WORKDIR /src/arm
RUN mkdir -p /build; \
Expand All @@ -83,7 +89,8 @@ WORKDIR /build/tigervnc-1.12.0
# 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; \
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 -DCMAKE_BUILD_TYPE=Release -DINSTALL_SYSTEMD_UNITS=OFF -Wno-dev . && make
Expand All @@ -93,7 +100,8 @@ 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; \
RUN test "yes" != "$COMPILE_TIGER" && exit 0 || echo doMake; \
autoreconf -fiv; \
CPPFLAGS="-I/usr/include/drm" \
./configure $XORG_CONFIG \
--prefix=/usr/local/tigervnc \
Expand Down Expand Up @@ -128,7 +136,7 @@ RUN export DOMAIN="mirrors.ustc.edu.cn"; \
&& 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-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 \
Expand Down

0 comments on commit c24a1a7

Please sign in to comment.