From 8bb07a7eac05081b98350f26c5927e3d8ba76f69 Mon Sep 17 00:00:00 2001
From: Ilya Sorochan <k0tran@altlinux.org>
Date: Wed, 28 Aug 2024 18:18:03 +0300
Subject: [PATCH 3/3] 1.0.0-alt0.2.alpha.1

- Add two patches for loongarch64 for linux-raw-sys and nix crates
---
 .gear/rules       |  1 +
 cosmic-panel.spec | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/.gear/rules b/.gear/rules
index 38b3b820..9d13a36b 100644
--- a/.gear/rules
+++ b/.gear/rules
@@ -1,2 +1,3 @@
 tar: cosmic-panel-1.0.0.alpha.1-cargo name=cosmic-panel-1.0.0.alpha.1-cargo base=
 tar: cosmic-panel name=cosmic-panel-1.0.0.alpha.1
+copy: *.patch
diff --git a/cosmic-panel.spec b/cosmic-panel.spec
index e315bf60..3036b33f 100644
--- a/cosmic-panel.spec
+++ b/cosmic-panel.spec
@@ -8,7 +8,7 @@
 
 Name: cosmic-panel
 Version: %ver_major.0
-Release: alt0.1%beta
+Release: alt0.2%beta
 
 Summary: COSMIC Panel
 License: GPL-3.0
@@ -24,6 +24,9 @@ Source: %name-%version%beta.tar
 %endif
 Source1: %name-%version%beta-cargo.tar
 
+Patch0: cosmic-panel-1.0.0-alt-linux-raw-sys-char-loongarch64.patch
+Patch1: cosmic-panel-1.0.0-alt-old-nix-loongarch64.patch
+
 BuildRequires(pre): rpm-build-rust
 BuildRequires: just
 BuildRequires: pkgconfig(xkbcommon)
@@ -40,6 +43,12 @@ Panel for the COSMIC desktop environment.
 cargo vendor | sed 's/^directory = ".*"/directory = "vendor"/g' > .cargo/config.toml
 tar -cf %_sourcedir/%name-%version%beta-cargo.tar .cargo/ vendor/}
 
+%patch0 -p2
+%patch1 -p2
+sed -i -e 's/"files":{[^}]*}/"files":{}/' \
+     ./vendor/linux-raw-sys/.cargo-checksum.json \
+     ./vendor/nix-0.26.4/.cargo-checksum.json
+
 %build
 %rust_build
 
@@ -57,6 +66,9 @@ just rootdir=%buildroot install
 %doc README*
 
 %changelog
+* Wed Aug 28 2024 Ilya Sorochan <k0tran@altlinux.org> 1.0.0-alt0.2.alpha.1
+- Add two patches for loongarch64 for linux-raw-sys and nix crates
+
 * Sun Aug 18 2024 Yuri N. Sedunov <aris@altlinux.org> 1.0.0-alt0.1.alpha.1
 - first build for Sisyphus (epoch-1.0.0-alpha.1-4-ge184d10)
 
-- 
2.42.2