From 05a72abf41c5fedd1d6365becfa6a16a4553f502 Mon Sep 17 00:00:00 2001 From: purian23 Date: Fri, 17 Oct 2025 15:39:09 -0400 Subject: [PATCH] Update Copr Architecture logic --- .github/workflows/copr-release.yml | 51 ++++++++++++++++++------------ dms.spec | 42 ++++++++++++++++++++---- 2 files changed, 66 insertions(+), 27 deletions(-) diff --git a/.github/workflows/copr-release.yml b/.github/workflows/copr-release.yml index aa4d6449..a05fe98a 100644 --- a/.github/workflows/copr-release.yml +++ b/.github/workflows/copr-release.yml @@ -56,7 +56,7 @@ jobs: VERSION="${{ steps.version.outputs.version }}" cd ~/rpmbuild/SOURCES - echo "📦 Downloading DMS release assets for v${VERSION}..." + echo "📦 Downloading DMS QML source for v${VERSION}..." # Download DMS QML source wget "https://github.com/AvengeMedia/DankMaterialShell/releases/download/v${VERSION}/dms-qml.tar.gz" || { @@ -64,21 +64,8 @@ jobs: exit 1 } - # Download dms-cli (always use latest) - echo "📦 Downloading latest dms-cli..." - wget "https://github.com/AvengeMedia/danklinux/releases/latest/download/dms-distropkg-amd64.gz" || { - echo "❌ Failed to download dms-cli" - exit 1 - } - - # Download dgop (always use latest) - echo "📦 Downloading latest dgop..." - wget "https://github.com/AvengeMedia/dgop/releases/latest/download/dgop-linux-amd64.gz" || { - echo "❌ Failed to download dgop" - exit 1 - } - - echo "✅ All sources downloaded" + echo "✅ Source downloaded" + echo "Note: dms-cli and dgop binaries will be downloaded during build based on target architecture" ls -lh - name: Generate stable spec file @@ -102,10 +89,9 @@ jobs: URL: https://github.com/AvengeMedia/DankMaterialShell Source0: dms-qml.tar.gz - Source1: dms-distropkg-amd64.gz - Source2: dgop-linux-amd64.gz BuildRequires: gzip + BuildRequires: wget Requires: (quickshell or quickshell-git) Requires: dms-cli @@ -157,10 +143,35 @@ jobs: %prep %setup -q -c -n dms-qml - gunzip -c %{SOURCE1} > %{_builddir}/dms-cli + # Download architecture-specific binaries during build + # This ensures the correct architecture is used for each build target + case "%{_arch}" in + x86_64) + ARCH_SUFFIX="amd64" + ;; + aarch64) + ARCH_SUFFIX="arm64" + ;; + *) + echo "Unsupported architecture: %{_arch}" + exit 1 + ;; + esac + + # Download dms-cli for target architecture + wget -O %{_builddir}/dms-cli.gz "https://github.com/AvengeMedia/danklinux/releases/latest/download/dms-distropkg-${ARCH_SUFFIX}.gz" || { + echo "Failed to download dms-cli for architecture %{_arch}" + exit 1 + } + gunzip -c %{_builddir}/dms-cli.gz > %{_builddir}/dms-cli chmod +x %{_builddir}/dms-cli - gunzip -c %{SOURCE2} > %{_builddir}/dgop + # Download dgop for target architecture + wget -O %{_builddir}/dgop.gz "https://github.com/AvengeMedia/dgop/releases/latest/download/dgop-linux-${ARCH_SUFFIX}.gz" || { + echo "Failed to download dgop for architecture %{_arch}" + exit 1 + } + gunzip -c %{_builddir}/dgop.gz > %{_builddir}/dgop chmod +x %{_builddir}/dgop %build diff --git a/dms.spec b/dms.spec index 6be3870a..7195f79b 100644 --- a/dms.spec +++ b/dms.spec @@ -18,14 +18,12 @@ Source0: {{{ git_dir_pack }}} # DMS CLI from danklinux latest commit Source1: https://github.com/AvengeMedia/danklinux/archive/refs/heads/master.tar.gz -# DGOP binary from dgop latest release -Source2: https://github.com/AvengeMedia/dgop/releases/latest/download/dgop-linux-amd64.gz - BuildRequires: git-core BuildRequires: rpkg BuildRequires: gzip BuildRequires: golang >= 1.24 BuildRequires: make +BuildRequires: wget # Core requirements Requires: (quickshell-git or quickshell) @@ -85,8 +83,25 @@ used standalone. This package always includes the latest stable dgop release. # Extract DankLinux source tar -xzf %{SOURCE1} -C %{_builddir} -# Extract DGOP binary -gunzip -c %{SOURCE2} > %{_builddir}/dgop +# Download and extract DGOP binary for target architecture +case "%{_arch}" in + x86_64) + DGOP_ARCH="amd64" + ;; + aarch64) + DGOP_ARCH="arm64" + ;; + *) + echo "Unsupported architecture: %{_arch}" + exit 1 + ;; +esac + +wget -O %{_builddir}/dgop.gz "https://github.com/AvengeMedia/dgop/releases/latest/download/dgop-linux-${DGOP_ARCH}.gz" || { + echo "Failed to download dgop for architecture %{_arch}" + exit 1 +} +gunzip -c %{_builddir}/dgop.gz > %{_builddir}/dgop chmod +x %{_builddir}/dgop %build @@ -95,8 +110,21 @@ cd %{_builddir}/danklinux-master make dist %install -# Install dms-cli binary (built from source) -install -Dm755 %{_builddir}/danklinux-master/bin/dms-linux-amd64 %{buildroot}%{_bindir}/dms +# Install dms-cli binary (built from source) - use architecture-specific path +case "%{_arch}" in + x86_64) + DMS_BINARY="dms-linux-amd64" + ;; + aarch64) + DMS_BINARY="dms-linux-arm64" + ;; + *) + echo "Unsupported architecture: %{_arch}" + exit 1 + ;; +esac + +install -Dm755 %{_builddir}/danklinux-master/bin/${DMS_BINARY} %{buildroot}%{_bindir}/dms # Install dgop binary install -Dm755 %{_builddir}/dgop %{buildroot}%{_bindir}/dgop