Skip to content

Instantly share code, notes, and snippets.

@maxux
Last active December 12, 2023 20:00
Show Gist options
  • Save maxux/77205551ad0a9dcd64a570917a3c7744 to your computer and use it in GitHub Desktop.
Save maxux/77205551ad0a9dcd64a570917a3c7744 to your computer and use it in GitHub Desktop.
Arch tfchain build script
pkgname="tfchain"
pkgver="2.6.0"
pkgrel="1"
pkgdesc="Threefold TFChain"
arch=("x86_64")
source=("https://example.com/${pkgname}-${pkgver}.tar.gz")
source=("https://github.com/threefoldtech/tfchain/archive/refs/tags/v${pkgver}.tar.gz")
license=("custom")
sha256sums=("a9059ae45895fff39d3eeeeaad2eda1298103d9f66232fca826d86f940cea010")
makedepends=("base-devel" "protobuf" "clang" "llvm" "gcc12" "rustup")
build() {
# use rustup, specific version are needed and defined
# in rust cargo file
cd "${pkgname}-${pkgver}/substrate-node"
CC=gcc-12 CXX=g++-12 cargo build --release
}
package() {
mkdir -p "${pkgdir}/usr/bin"
cp "${pkgname}-${pkgver}/substrate-node/target/release/tfchain" "${pkgdir}/usr/bin"
chmod +x "${pkgdir}/usr/bin/tfchain"
}
#!/bin/bash
pacman -Sy
pacman -S --noconfirm fakeroot sudo base-devel
useradd -m maxux
echo "maxux ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/maxux
# Now run `makepkg -fs` as maxux user (cannot be done as root)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment