From 94542583301db530a258cfee5252eb46fcddf97f Mon Sep 17 00:00:00 2001 From: April & May & June Date: Thu, 15 Jan 2026 02:44:33 +0800 Subject: [PATCH 1/2] ci: add deepin & archlinux build CI This may work as intended. --- .github/workflows/ddm-archlinux-build.yml | 103 ++++++++++++++++++++++ .github/workflows/ddm-deepin-build.yml | 87 ++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 .github/workflows/ddm-archlinux-build.yml create mode 100644 .github/workflows/ddm-deepin-build.yml diff --git a/.github/workflows/ddm-archlinux-build.yml b/.github/workflows/ddm-archlinux-build.yml new file mode 100644 index 0000000..f9143ed --- /dev/null +++ b/.github/workflows/ddm-archlinux-build.yml @@ -0,0 +1,103 @@ +name: Build ddm on Arch Linux + +# Dependencies are based on the official ArchLinux PKGBUILD +# treeland-protocols-git is installed from source + +on: + push: + + pull_request: + +jobs: + container: + runs-on: ubuntu-latest + container: archlinux:latest + steps: + - name: Run in container + run: | + cat /etc/pacman.d/mirrorlist + pacman-key --init + pacman --noconfirm --noprogressbar -Syu + + - name: Install base dependencies + run: | + pacman -S --noconfirm --noprogressbar base-devel bash gcc-libs glibc libxau pam qt6-base qt6-declarative systemd-libs ttf-font xorg-server xorg-xauth git extra-cmake-modules python-docutils qt6-tools treeland-protocols ninja + + - name: Build and Install treeland-protocols + run: | + echo "Building treeland-protocols from source..." + git clone https://github.com/linuxdeepin/treeland-protocols.git --depth 1 + cd treeland-protocols + cmake -B build \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_INSTALL_LIBEXECDIR=lib \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release + cmake --build build + cmake --install build + echo "✅ treeland-protocols built and installed from source" + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure and Build ddm with ci preset + run: | + echo "Working directory:" $PWD + echo "Configuring ddm..." + cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror" + cmake --build build + echo "✅ ddm built successfully!" + + - name: Install ddm to staging directory + run: | + echo "Installing ddm to staging directory..." + mkdir -p /tmp/ddm-install + DESTDIR=/tmp/ddm-install cmake --install build + echo "✅ ddm installed to staging directory" + + echo "Installed files:" + find /tmp/ddm-install -type f | head -20 + echo "Total files installed: $(find /tmp/ddm-install -type f | wc -l)" + + - name: Create ddm installation package + run: | + cd /tmp/ddm-install + + # Install zip if not available + pacman -S --noconfirm zip + + # Create package info + echo "Creating package info..." + cat > PACKAGE_INFO.txt << EOF + Package: ddm-archlinux-build + Version: $(date +%Y%m%d-%H%M%S) + Architecture: x86_64 + Built-on: Arch Linux + CMake-Config: -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib + + Installation Instructions: + 1. Extract this package to / + 2. Run: sudo ldconfig (if libraries are included) + 3. Ensure dependencies are installed on target system + + Files included in this package: + EOF + find . -type f | sort >> PACKAGE_INFO.txt + + # Create the zip package + zip -r /tmp/ddm-archlinux-$(date +%Y%m%d-%H%M%S).zip . + echo "✅ ddm installation package created" + + ls -la /tmp/ddm-archlinux-*.zip + + - name: Upload ddm ArchLinux build artifacts + uses: actions/upload-artifact@v4 + with: + name: ddm-archlinux-build + path: "/tmp/ddm-archlinux-*.zip" + if-no-files-found: error + retention-days: 30 diff --git a/.github/workflows/ddm-deepin-build.yml b/.github/workflows/ddm-deepin-build.yml new file mode 100644 index 0000000..2f51267 --- /dev/null +++ b/.github/workflows/ddm-deepin-build.yml @@ -0,0 +1,87 @@ +name: Build ddm on Deepin crimson (independent) + +on: + push: + + pull_request: + +jobs: + container: + runs-on: ubuntu-latest + container: linuxdeepin/deepin:crimson + steps: + - uses: actions/checkout@v4 + + - name: Install build dependencies + run: | + set -euxo pipefail + + echo "deb [trusted=yes] http://mirrors.kernel.org/deepin/beige/ crimson main commercial community" > /etc/apt/sources.list + echo "deb-src [trusted=yes] http://mirrors.kernel.org/deepin/beige/ crimson main commercial community" >> /etc/apt/sources.list + rm -rf /etc/apt/sources.list.d + + apt-get update + apt-get install -y devscripts equivs git + + # Save the ddm workspace directory + DDM_DIR="$PWD" + echo "ddm workspace directory: $DDM_DIR" + + # Build and install treeland-protocols locally (required build dependency not from repo) + echo "Building treeland-protocols from source (master)" + cd /tmp + if [ ! -d treeland-protocols ]; then + git clone --depth=1 --branch master --single-branch https://github.com/linuxdeepin/treeland-protocols.git + fi + cd treeland-protocols + mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control + dpkg-buildpackage -uc -us -b + apt-get install -y ../*.deb || dpkg -i ../*.deb || apt-get -f install -y + cd "$DDM_DIR" + + # Install build-deps defined in ddm/debian/control + mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control + + - name: Build ddm deb package + run: | + set -euxo pipefail + + # Check build dependencies and diagnose missing packages + set +e + dpkg-checkbuilddeps 2> /tmp/ddm-builddeps.err + BUILDDEPS_RC=$? + set -e + + if [ "$BUILDDEPS_RC" -ne 0 ]; then + echo "❌ Build dependencies check failed. Analyzing missing packages..." + cat /tmp/ddm-builddeps.err + + # Extract and list each missing package with version requirements + echo "" + echo "Detailed missing packages analysis:" + grep -oP '(?<=Unmet build dependencies: ).*' /tmp/ddm-builddeps.err | tr ' ' '\n' | while read pkg; do + if [ -n "$pkg" ]; then + # Check if package exists in repos + apt-cache policy "$pkg" 2>/dev/null | head -20 || echo "Package '$pkg' not found in any repository" + fi + done + fi + + dpkg-buildpackage -uc -us -b + echo "ddm deb package built successfully!" + ls -la ../ + + - name: Collect deb artifacts + run: | + set -euxo pipefail + mkdir -p dist + mv ../*.deb dist/ + ls -la dist + + - name: Upload ddm deb packages as artifacts + uses: actions/upload-artifact@v4 + with: + name: ddm-deepin-deb-packages + path: dist/*.deb + if-no-files-found: error + retention-days: 30 From 545612133db2858f48b68634ac10f783b3d5b31d Mon Sep 17 00:00:00 2001 From: April & May & June Date: Thu, 15 Jan 2026 03:31:03 +0800 Subject: [PATCH 2/2] ci: add copilot instructions It's informative and suitable for everyone that want to have look to this project. --- .github/copilot-instructions.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..7f117fc --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,33 @@ +# GitHub Copilot Repository Instructions for ddm + +## Big Picture +`ddm` is a Linux display manager that use Treeland as its greeter, originally forked from SDDM. Treeland is a Wayland compositor built on `wlroots` + Qt6/QtQuick + +## Where to Look +- `src/common` includes utilities and is exposed outside independently, like configuration definitions, socket messaging protocols and VT management functions. +- `src/daemon` includes source of the main app + - DaemonApp defines the application. It starts SeatManager, PowerManager, DisplayManager, SignalHandler and TreelandConnector. + - PowerManager provides functionality of poweroff, reboot, etc. + - DisplayManager provides org.freedesktop.DisplayManager D-Bus service. + - SignalHandler handle signals send to the DaemonApp. + - TreelandConnector is a wayland client that connects to Treeland. + - SeatManager manage seats & displays. It will create one Display for each seat. + - The Display starts up Treeland as greeter and use SocketServer to communicate with it. + - For each time user login / unlock, an Auth is created and managed by Display. + - When user login, Auth will startup UserSession, which will call PAM to open session, as well as starting up desktop environment. + +## Build & Test +```bash +cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror" +cmake --build build +``` + +## Project Rules (must-follow) +- Use C++20; Qt6 only (do not introduce Qt5 APIs/modules). +- Keep diffs minimal: touch only task-related files/symbols; avoid broad refactors/renames and avoid reformatting unrelated code. +- New files must include an SPDX line consistent with this repo (typically `SPDX-License-Identifier: GPL-2.0-or-later`). +- For English reviews, append a Chinese translation after the English content. +- Terminal commands in fenced `bash` blocks; paths/symbols in backticks.