From b01ef3b6d87508693a74b04c677419292a99fde1 Mon Sep 17 00:00:00 2001 From: Dawson Date: Mon, 27 Apr 2026 10:16:02 -0400 Subject: [PATCH] Fixing arm build, adding autoupdate gitea workflow --- .gitea/workflows/update-readme-version.yaml | 67 +++++ .gitignore | 311 ++++++++++++++++++++ README.md | 5 + scripts/build-rpm.sh | 2 + scripts/build-srpm.sh | 2 + 5 files changed, 387 insertions(+) create mode 100644 .gitea/workflows/update-readme-version.yaml create mode 100644 .gitignore diff --git a/.gitea/workflows/update-readme-version.yaml b/.gitea/workflows/update-readme-version.yaml new file mode 100644 index 0000000..ebe6358 --- /dev/null +++ b/.gitea/workflows/update-readme-version.yaml @@ -0,0 +1,67 @@ +name: Update README version + +on: + schedule: + - cron: "17 2 * * *" + workflow_dispatch: + +permissions: + contents: write + +jobs: + update-readme-version: + runs-on: ubuntu-latest + env: + TARBALL_URL: https://packages.element.io/desktop/install/linux/glibc-x86-64/element-desktop.tar.gz + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITEA_TOKEN }} + fetch-depth: 0 + ref: ${{ gitea.ref_name }} + + - name: Detect latest upstream version + id: version + shell: bash + run: | + set -euo pipefail + + topdir="$(curl -fsSL "$TARBALL_URL" | tar -tzf - | sed -n '1s#/##p')" + latest_version="${topdir#element-desktop-}" + current_version="$(sed -n 's/^Latest upstream version tracked in this repo: `\([^`]*\)`$/\1/p' README.md)" + + if [ -z "$latest_version" ] || [ "$latest_version" = "$topdir" ]; then + echo "Failed to derive upstream version from tarball root: $topdir" >&2 + exit 1 + fi + + if [ -z "$current_version" ]; then + echo "Could not find tracked version marker in README.md" >&2 + exit 1 + fi + + echo "latest=$latest_version" >> "$GITHUB_OUTPUT" + echo "current=$current_version" >> "$GITHUB_OUTPUT" + + - name: Update README + if: steps.version.outputs.latest != steps.version.outputs.current + shell: bash + run: | + set -euo pipefail + + sed -i \ + "s/^Latest upstream version tracked in this repo: .*/Latest upstream version tracked in this repo: \`${{ steps.version.outputs.latest }}\`/" \ + README.md + + - name: Commit and push update + if: steps.version.outputs.latest != steps.version.outputs.current + shell: bash + run: | + set -euo pipefail + + git config user.name "Gitea Actions" + git config user.email "actions@localhost" + git add README.md + git commit -m "docs: update tracked Element Desktop version to ${{ steps.version.outputs.latest }}" + git push diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89f2ad4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,311 @@ +dist/ +.idea/ +*.iml +.rpmbuild/ +*.src.rpm +__pycache__/ +.dnf/ +scripts/__pycache__/ + +# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux,maven,java,intellij,eclipse,netbeans +# Edit at https://www.toptal.com/developers/gitignore?templates=windows,macos,linux,maven,java,intellij,eclipse,netbeans + +### Eclipse ### +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders +*.iml + +.idea/ + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +### Eclipse Patch ### +# Spring Boot Tooling +.sts4-cache/ + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +!gradle/wrapper/gradle-wrapper.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar +.flattened-pom.xml + +### NetBeans ### +**/nbproject/private/ +**/nbproject/Makefile-*.mk +**/nbproject/Package-*.bash +build/ +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +.dnf/* + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux,maven,java,intellij,eclipse,netbeans +/.gradle/ +.cache/ + +dist-copr-test/ \ No newline at end of file diff --git a/README.md b/README.md index 2e6d0aa..08b647f 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ x86_64 tarball: `https://packages.element.io/desktop/install/linux/glibc-x86-64/element-desktop.tar.gz` +Latest upstream version tracked in this repo: `1.12.15` + ## What it does - Downloads the current upstream tarball. @@ -12,6 +14,8 @@ x86_64 tarball: - Repackages the prebuilt binaries into an RPM. - Removes the upstream auto-update manifest so RPM remains the update path. - Sets `resources/package-type` to `rpm`. +- Forces `rpmbuild` to target `x86_64`, which avoids COPR SRPM failures on + non-`x86_64` source builders. - Supports COPR SCM builds through `.copr/Makefile`. ## Local builds @@ -37,6 +41,7 @@ Use COPR's SCM source type with: - Clone URL: this repository - Spec file: `SPECS/element-desktop.spec` - SRPM build method: `make srpm` +- Enable only `x86_64` binary chroots for this package COPR will invoke `.copr/Makefile`, which calls the same SRPM generation script used for local builds. That script downloads the upstream tarball during the diff --git a/scripts/build-rpm.sh b/scripts/build-rpm.sh index 8922f5b..564dc64 100755 --- a/scripts/build-rpm.sh +++ b/scripts/build-rpm.sh @@ -3,6 +3,7 @@ set -eu ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)" OUTDIR="${1:-$ROOT_DIR/dist}" +RPM_TARGET="${RPM_TARGET:-x86_64}" TOPDIR="$(mktemp -d)" cleanup() { @@ -26,6 +27,7 @@ cp "$ROOT_DIR/SPECS/element-desktop.spec" "$TOPDIR/SPECS/" cp "$ROOT_DIR/SOURCES/element-desktop.desktop" "$TOPDIR/SOURCES/" rpmbuild -ba \ + --target "$RPM_TARGET" \ --define "_topdir $TOPDIR" \ --define "upstream_version $version" \ "$TOPDIR/SPECS/element-desktop.spec" diff --git a/scripts/build-srpm.sh b/scripts/build-srpm.sh index 7672ebf..ffeb360 100755 --- a/scripts/build-srpm.sh +++ b/scripts/build-srpm.sh @@ -3,6 +3,7 @@ set -eu ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)" OUTDIR="${1:-$ROOT_DIR/dist}" +RPM_TARGET="${RPM_TARGET:-x86_64}" TOPDIR="$(mktemp -d)" cleanup() { @@ -26,6 +27,7 @@ cp "$ROOT_DIR/SPECS/element-desktop.spec" "$TOPDIR/SPECS/" cp "$ROOT_DIR/SOURCES/element-desktop.desktop" "$TOPDIR/SOURCES/" rpmbuild -bs \ + --target "$RPM_TARGET" \ --define "_topdir $TOPDIR" \ --define "upstream_version $version" \ "$TOPDIR/SPECS/element-desktop.spec"