rewrite script to use RPM built using GitHub action

This commit is contained in:
fb24m
2026-05-08 17:32:53 +04:00
parent bfad75c93a
commit c67c8840e4
5 changed files with 23 additions and 250 deletions
-43
View File
@@ -1,43 +0,0 @@
%global source_date_epoch_from_changelog 0
%global tag 1.0.4
%global commits 1054
%global commit 91b6b78e408a8b1c0b7146c9034a03156c082da2
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: cpptrace
Version: 1.0.4
Release: 1%{?dist}
Summary: Simple, portable, and self-contained stacktrace library for C++11 and newer
License: MIT
URL: https://github.com/jeremy-rifkin/cpptrace
Source0: %{url}/archive/%{commit}/cpptrace-%{shortcommit}.tar.gz
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: ninja-build
BuildRequires: libunwind-devel
%description
C++ lightweight logging library used by Quickshell.
%prep
%autosetup -n cpptrace-%{commit} -p1
%build
mkdir -p build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DCPPTRACE_UNWIND_WITH_LIBUNWIND=true
cmake --build .
%install
cd build
DESTDIR=%{buildroot} cmake --install .
%files
%{_prefix}/local/include/*
%{_prefix}/local/lib64/*
%license LICENSE
%doc README.md
-37
View File
@@ -1,37 +0,0 @@
%global commit 4112d352914742ba69f6380fd07984adba02d376
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global snapdate 20260322
%global tag 4.1.0
Name: matugen
Version: %{tag}.%{shortcommit}
Release: 0%{?dist}
Summary: A cross-platform material you and base16 color generation tool
License: GPL-2.0
URL: https://github.com/InioX/matugen
Source0: %{url}/archive/%{commit}/matugen-%{shortcommit}.tar.gz
BuildRequires: rust-packaging
BuildRequires: cargo
BuildRequires: gcc
%description
A cross-platform material you and base16 color generation tool
%prep
%autosetup -n matugen-%{commit} -p1
%build
cargo build --release
%install
install -Dm0755 target/release/matugen %{buildroot}%{_bindir}/matugen
%files
%license LICENSE
%doc README.md
%{_bindir}/matugen
%changelog
%autochangelog
@@ -1,87 +0,0 @@
# Original-Spec: https://copr-dist-git.fedorainfracloud.org/packages/errornointernet/quickshell/quickshell-git.git/plain/quickshell-git.spec?h=master
%bcond_with asan
%global commit 7511545ee20664e3b8b8d3322c0ffe7567c56f7a
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global commits 770
%global snapdate 20260327
%global tag 0.2.1
Name: quickshell-git
Version: %{tag}^%{commits}.git%{shortcommit}
Release: 0%{?dist}
Summary: Flexible QtQuick based desktop shell toolkit
License: LGPL-3.0-only AND GPL-3.0-only
URL: https://github.com/quickshell-mirror/quickshell
Source0: %{url}/archive/%{commit}/quickshell-%{shortcommit}.tar.gz
Conflicts: quickshell <= %{tag}
%if 0%{fedora} >= 43
BuildRequires: breakpad-static
%endif
BuildRequires: cmake
BuildRequires: cmake(Qt6Core)
BuildRequires: cmake(Qt6Qml)
BuildRequires: cmake(Qt6ShaderTools)
BuildRequires: cmake(Qt6WaylandClient)
BuildRequires: gcc-c++
BuildRequires: ninja-build
BuildRequires: pkgconfig(breakpad)
BuildRequires: pkgconfig(CLI11)
BuildRequires: pkgconfig(gbm)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(jemalloc)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libpipewire-0.3)
BuildRequires: pkgconfig(pam)
BuildRequires: pkgconfig(polkit-agent-1)
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-protocols)
BuildRequires: qt6-qtbase-private-devel
BuildRequires: spirv-tools
%if %{with asan}
BuildRequires: libasan
%endif
Provides: desktop-notification-daemon
%description
Flexible toolkit for making desktop shells with QtQuick, targeting
Wayland and X11.
%prep
%autosetup -n quickshell-%{commit} -p1
%build
%cmake -GNinja \
%if %{with asan}
-DASAN=ON \
%endif
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DGIT_REVISION=%{commit} \
-DINSTALL_QML_PREFIX=%{_lib}/qt6/qml
%cmake_build
%install
%cmake_install
%files
%license LICENSE
%license LICENSE-GPL
%doc BUILD.md
%doc CONTRIBUTING.md
%doc README.md
%doc changelog/v%{tag}.md
%{_bindir}/qs
%{_bindir}/quickshell
%{_datadir}/applications/org.quickshell.desktop
%{_datadir}/icons/hicolor/scalable/apps/org.quickshell.svg
%{_libdir}/qt6/qml/Quickshell
%changelog
%autochangelog
+3 -26
View File
@@ -134,33 +134,10 @@ packages = [
]
install_opts = ["--setopt=install_weak_deps=False"]
# Quickshell-git
[groups.quickshell]
[groups.illogical-impulse]
packages = [
"qt6-qtdeclarative",
"qt6-qtbase",
"jemalloc",
"qt6-qtsvg",
"pipewire-libs",
"libxcb",
"wayland-devel",
"qt6-qtwayland",
"qt5-qtwayland",
"libdrm",
"breakpad",
"kf6-kirigami",
"libunwind-devel",
# NOTE: Below are custom dependencies of illogical-impulse
"qt6-qt5compat",
"qt6-qtimageformats",
"qt6-qtpositioning",
"qt6-qtquicktimeline",
"qt6-qtsensors",
"qt6-qttools",
"qt6-qttranslations",
"qt6-qtvirtualkeyboard",
"kdialog",
"kf6-syntax-highlighting"
"quickshell-git",
"matugen"
]
# Screencapture
+20 -57
View File
@@ -23,61 +23,20 @@ function r() {
[ "$original_id" == "$last_id" ] || yq -i ".dnf.transaction_ids += [ $last_id ]" "$user_config" || :
}
# Start building and install the missing RPM package locally.
function install_RPMS() {
local local_specs local_rpms
rpmbuildroot="${rpmbuildroot:-${REPO_ROOT}/cache/rpmbuild}"
# Init local RPM repo and download rpms from releases there.
function init_local_repo() {
url="https://api.github.com/repos/end-4/ii-package-builds/releases/tags/packages-fedora"
path="$HOME/.cache/illogical-impulse-repo"
x rm -rf "${REPO_ROOT}/cache/rpmbuild"
x mkdir -p "$rpmbuildroot"/{BUILD,RPMS,SOURCES}
x cp -r "${REPO_ROOT}/sdata/dist-fedora/SPECS" "$rpmbuildroot/"
rm -rf -- "$path"
mkdir -p "$path"
x cd $rpmbuildroot/SPECS
packages=(
"cpptrace"
"quickshell-git"
"matugen"
)
for package in "${packages[@]}"; do
echo "start $package"
spec="$rpm_specs/$package.spec"
installed_rpm_stamp=$(rpm -q --qf '%{NVRA}\n' "$package" 2>/dev/null || true)
spec_stamp=$(rpmspec -q --qf '%{NVRA}\n' "$spec")
arch=$(rpm --eval "%_arch") # if we somehow want aarch64??
built_rpm_path="$rpmbuildroot/RPMS/$arch/$spec_stamp.rpm"
[[ -f "$spec" ]] || {
echo "Missing spec: $spec"
continue
}
echo "rpm_specs=$rpm_specs"
echo "spec=$spec"
echo "spec_stamp=$spec_stamp"
if [[ "$installed_rpm_stamp" == "$spec_stamp" ]]; then
printf "$installed_rpm_stamp is installed and up to date. Skipping.\n"
continue
fi
# Download sources
x spectool -g -C "$rpmbuildroot/SOURCES" "$spec"
# Install build dependencies
r x sudo dnf builddep -y "$spec"
# Build the RPM package locally. If it fails, download it from COPR.
if ! rpmbuild -bb --define "_topdir $rpmbuildroot" --define "debug_package %{nil}" "$spec"; then
printf "${STY_RED}Local build encountered an issue. Downloading $(basename "$spec" .spec) from COPR. Report the issue to Discussions pls.${STY_RST}\n"
sudo dnf install -y $(basename "$spec" .spec)
nolock_qs=true
fi
if [[ -f "$rpmbuildroot/RPMS/x86_64/$spec_stamp.rpm" ]]; then
echo -e "${STY_BLUE}Next command:${STY_RST} sudo dnf install $rpmbuildroot/RPMS/x86_64/$spec_stamp.rpm -y"
r x sudo dnf install "$rpmbuildroot/RPMS/x86_64/$spec_stamp.rpm" -y
fi
done
x cd ${REPO_ROOT}
for file in $(curl -s "$url" | jq -r '.assets[].browser_download_url'); do
name=$(basename "$file")
echo "Downloading $file"
curl --max-time 10 -L --fail --show-error --progress-bar -o "$path/$name" "$file"
createrepo_c "$path"
done
}
# -------------------------
@@ -102,7 +61,7 @@ v sudo dnf versionlock delete quickshell-git 2>/dev/null
v sudo dnf install yq -y
# Install development tools
r v sudo dnf install @development-tools fedora-packager -y
r v sudo dnf install createrepo_c -y
# Install COPR repositories
copr_repos_json=$(yq -o=j '.copr.repos // []' "$deps_data_file")
@@ -111,9 +70,9 @@ for copr in ${copr_repos_array[@]}; do
v sudo dnf copr enable "$copr" -y
done
# Build and install locally RPMS
showfun install_RPMS
v install_RPMS
# Init local repo with prebuilt rpms
showfun init_local_repo
v init_local_repo
# Install packages from toml file
deps_data=$(yq -o=j '.' "$deps_data_file")
@@ -125,6 +84,10 @@ while IFS= read -r deps_list_key; do
install_opts=$(echo $deps_data | yq ".groups.\"$deps_list_key\" | select(has(\"install_opts\")) | .install_opts[]")
package_list=$(echo $deps_data | yq ".groups.\"$deps_list_key\".packages | unique | .[]")
if [[ $deps_list_key == 'illogical-impulse' ]]; then
install_opts="$install_opts --repofrompath=illogical-impulse,file://$HOME/.cache/illogical-impulse-repo --nogpgcheck"
fi
r v sudo dnf install -y $install_opts $package_list </dev/tty
echo "----------------------------------------"