Skip to content

Allow rust from repos, properly install rust-toolchain file #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pkgbase = linux-rust
pkgdesc = Rust Linux
pkgver = 6.12.9.arch1
pkgrel = 1
pkgrel = 2
url = https://github.com/rnestler/archpkg-linux-rust
arch = x86_64
license = GPL2
Expand All @@ -14,7 +14,8 @@ pkgbase = linux-rust
makedepends = pahole
makedepends = perl
makedepends = python
makedepends = rustup
makedepends = rust
makedepends = rust-src
makedepends = rust-bindgen
makedepends = tar
makedepends = xz
Expand All @@ -29,7 +30,6 @@ pkgbase = linux-rust
source = https://github.com/archlinux/linux/releases/download/v6.12.9-arch1/linux-v6.12.9-arch1.patch.zst
source = https://github.com/archlinux/linux/releases/download/v6.12.9-arch1/linux-v6.12.9-arch1.patch.zst.sig
source = config
source = rust-toolchain
validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886
validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E
validpgpkeys = 83BC8889351B5DEBBB68416EB8AC08600F108CDF
Expand All @@ -38,13 +38,11 @@ pkgbase = linux-rust
sha256sums = f57e541d26eb3971b3e587d418825c50612d75684f5ad6dd36b8084846751b5a
sha256sums = SKIP
sha256sums = 494f9b61b4893afa086d29657b1fa84948e0798217193c264055a68c7fae3380
sha256sums = 9cbdfdb58bcc5bbe0b6c578e62775f3d11d323ee711fa79eccdc0ac463776c1d
b2sums = 2584e35822a429b6825bf8d99c073848d5ba83d45b382ab82d1caa36ccbf2529036b31d4687dafb29650c87f4b63489caa2cb67a85d05183c572dcad75a35ba8
b2sums = SKIP
b2sums = 195386c83893d88d4198ddd208f4c71e1264d8f48aef50006e42581cdf6ebe441ca67a9b93bf7ed84b7580dd0b591a3ef7a06d7ee4d6ffef8486fa4962220214
b2sums = SKIP
b2sums = cb50013dc3a66c66a81bcd04b32fc627ed2166d45820ba45a9f0389416fb3e73eb425c2b1e4f135e22d9f68d089dcd8ed367d1880e0b173cf3e0e1255cb12282
b2sums = 731c8a43afaa9597af54611925431341f9bc1369981c0ffc455f21270ee5cd6a7de16d67d293925598ae5ca451ff425b69562b8635940fbcfa1877049b9eecb5

pkgname = linux-rust
pkgdesc = The Linux kernel and modules with support for Rust written modules
Expand Down
28 changes: 18 additions & 10 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pkgbase=linux-rust
pkgver=6.12.9.arch1
pkgrel=1
pkgrel=2
pkgdesc='Rust Linux'
url='https://github.com/rnestler/archpkg-linux-rust'
arch=(x86_64)
Expand All @@ -17,7 +17,8 @@ makedepends=(
pahole
perl
python
rustup
rust
rust-src
rust-bindgen
tar
xz
Expand All @@ -36,7 +37,6 @@ source=(
https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/${_srcname}.tar.{xz,sign}
https://github.com/archlinux/linux/releases/download/$_srctag/linux-$_srctag.patch.zst{,.sig}
config # the main kernel config file
rust-toolchain
)
validpgpkeys=(
ABAF11C65A2970B130ABE3C479BE3E4300411886 # Linus Torvalds
Expand All @@ -48,14 +48,12 @@ sha256sums=('87be0360df0931b340d2bac35161a548070fbc3a8c352c49e21e96666c26aeb4'
'SKIP'
'f57e541d26eb3971b3e587d418825c50612d75684f5ad6dd36b8084846751b5a'
'SKIP'
'494f9b61b4893afa086d29657b1fa84948e0798217193c264055a68c7fae3380'
'9cbdfdb58bcc5bbe0b6c578e62775f3d11d323ee711fa79eccdc0ac463776c1d')
'494f9b61b4893afa086d29657b1fa84948e0798217193c264055a68c7fae3380')
b2sums=('2584e35822a429b6825bf8d99c073848d5ba83d45b382ab82d1caa36ccbf2529036b31d4687dafb29650c87f4b63489caa2cb67a85d05183c572dcad75a35ba8'
'SKIP'
'195386c83893d88d4198ddd208f4c71e1264d8f48aef50006e42581cdf6ebe441ca67a9b93bf7ed84b7580dd0b591a3ef7a06d7ee4d6ffef8486fa4962220214'
'SKIP'
'cb50013dc3a66c66a81bcd04b32fc627ed2166d45820ba45a9f0389416fb3e73eb425c2b1e4f135e22d9f68d089dcd8ed367d1880e0b173cf3e0e1255cb12282'
'731c8a43afaa9597af54611925431341f9bc1369981c0ffc455f21270ee5cd6a7de16d67d293925598ae5ca451ff425b69562b8635940fbcfa1877049b9eecb5')
'cb50013dc3a66c66a81bcd04b32fc627ed2166d45820ba45a9f0389416fb3e73eb425c2b1e4f135e22d9f68d089dcd8ed367d1880e0b173cf3e0e1255cb12282')

export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase
Expand All @@ -78,12 +76,22 @@ prepare() {
patch -Np1 < "../$src"
done

echo "Installing rust-src"
rustup component add rust-src
if rustup --help >/dev/null 2>&1; then
echo "Installing rust-src"
rustup component add rust-src
fi

echo "Verifying that Rust support is available"
make LLVM=1 rustavailable

echo "Generating rust-toolchain"
# We can't redirect it directly to the file, since otherwise the shell would
# create it empty before the rustup rustc shim starts and then rustup would
# complain "that empty toolchain override file detected. Please remove it, or
# else specify the desired toolchain properties in the file"
rust_version=$(rustc --version | cut -d' ' -f 2)
echo "$rust_version" > "$srcdir/rust-toolchain"

echo "Setting config..."
cp ../config .config
make LLVM=1 olddefconfig
Expand Down Expand Up @@ -203,7 +211,7 @@ _package-headers() {
install -Dt "$builddir/rust" -m644 scripts/target.json
install -Dt "$builddir/rust" -m644 rust/*.rmeta
install -Dt "$builddir/rust" -m644 rust/*.so
install -Dt "$builddir" -m644 ../rust-toolchain
install -Dt "$builddir" -m644 "$srcdir/rust-toolchain"

echo "Stripping build tools..."
local file
Expand Down
1 change: 0 additions & 1 deletion rust-toolchain

This file was deleted.