(merge)
This commit is contained in:
commit
a47efeb329
|
@ -15,30 +15,30 @@ tasks:
|
||||||
- check-dnapi-rs: |
|
- check-dnapi-rs: |
|
||||||
source ~/.cargo/env
|
source ~/.cargo/env
|
||||||
cd /home/build/trifid/dnapi-rs
|
cd /home/build/trifid/dnapi-rs
|
||||||
cargo check --locked --target x86_64-unknown-linux-musl
|
cargo check --target x86_64-unknown-linux-musl
|
||||||
cargo clippy --locked --target x86_64-unknown-linux-musl
|
cargo clippy --target x86_64-unknown-linux-musl
|
||||||
- check-nebula-ffi: |
|
- check-nebula-ffi: |
|
||||||
source ~/.cargo/env
|
source ~/.cargo/env
|
||||||
cd /home/build/trifid/nebula-ffi
|
cd /home/build/trifid/nebula-ffi
|
||||||
cargo check --locked --target x86_64-unknown-linux-musl
|
cargo check --target x86_64-unknown-linux-musl
|
||||||
cargo clippy --locked --target x86_64-unknown-linux-musl
|
cargo clippy --target x86_64-unknown-linux-musl
|
||||||
- check-tfcli: |
|
- check-tfcli: |
|
||||||
source ~/.cargo/env
|
source ~/.cargo/env
|
||||||
cd /home/build/trifid/tfcli
|
cd /home/build/trifid/tfcli
|
||||||
cargo check --locked --target x86_64-unknown-linux-musl
|
cargo check --target x86_64-unknown-linux-musl
|
||||||
cargo clippy --locked --target x86_64-unknown-linux-musl
|
cargo clippy --target x86_64-unknown-linux-musl
|
||||||
- check-tfclient: |
|
- check-tfclient: |
|
||||||
source ~/.cargo/env
|
source ~/.cargo/env
|
||||||
cd /home/build/trifid/tfclient
|
cd /home/build/trifid/tfclient
|
||||||
cargo check --locked --target x86_64-unknown-linux-musl
|
cargo check --target x86_64-unknown-linux-musl
|
||||||
cargo clippy --locked --target x86_64-unknown-linux-musl
|
cargo clippy --target x86_64-unknown-linux-musl
|
||||||
- check-trifid-api: |
|
- check-trifid-api: |
|
||||||
source ~/.cargo/env
|
source ~/.cargo/env
|
||||||
cd /home/build/trifid/trifid-api
|
cd /home/build/trifid/trifid-api
|
||||||
cargo check --locked --target x86_64-unknown-linux-musl
|
cargo check --target x86_64-unknown-linux-musl
|
||||||
cargo clippy --locked --target x86_64-unknown-linux-musl
|
cargo clippy --target x86_64-unknown-linux-musl
|
||||||
- check-trifid-pki: |
|
- check-trifid-pki: |
|
||||||
source ~/.cargo/env
|
source ~/.cargo/env
|
||||||
cd /home/build/trifid/trifid-pki
|
cd /home/build/trifid/trifid-pki
|
||||||
cargo check --locked --target x86_64-unknown-linux-musl
|
cargo check --target x86_64-unknown-linux-musl
|
||||||
cargo clippy --locked --target x86_64-unknown-linux-musl
|
cargo clippy --target x86_64-unknown-linux-musl
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
image: archlinux
|
||||||
|
packages:
|
||||||
|
- xbps-static-bin
|
||||||
|
- openssl
|
||||||
|
- go
|
||||||
|
- clang
|
||||||
|
- musl
|
||||||
|
sources:
|
||||||
|
- https://git.e3t.cc/~core/trifid
|
||||||
|
tasks:
|
||||||
|
- archive: |
|
||||||
|
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||||
|
source ~/.cargo/env
|
||||||
|
rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
cd /home/build/trifid
|
||||||
|
|
||||||
|
describe=$(git describe)
|
||||||
|
if [[ $describe == tfcli* ]]; then
|
||||||
|
project=tfcli
|
||||||
|
fi
|
||||||
|
if [[ $describe == tfclient* ]]; then
|
||||||
|
project=tfclient
|
||||||
|
fi
|
||||||
|
if [[ $describe == trifid-api* ]]; then
|
||||||
|
project=trifid-api
|
||||||
|
fi
|
||||||
|
|
||||||
|
pkgver=$(git describe | sed -e "s/$project-v//g" | sed -e 's/-/_/g')
|
||||||
|
|
||||||
|
echo "project=$project" >> ~/.buildenv
|
||||||
|
echo "pkgver=$pkgver" >> ~/.buildenv
|
||||||
|
- build: |
|
||||||
|
source ~/.cargo/env
|
||||||
|
cd /home/build/trifid/packages/void_amd64_$project
|
||||||
|
./build.sh /home/build/trifid $pkgver
|
||||||
|
sha256sum *.xbps
|
|
@ -2073,7 +2073,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nebula-ffi"
|
name = "nebula-ffi"
|
||||||
version = "0.1.1"
|
version = "0.1.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bindgen",
|
"bindgen",
|
||||||
"gobuild",
|
"gobuild",
|
||||||
|
@ -3447,7 +3447,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tfclient"
|
name = "tfclient"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.0",
|
"base64 0.21.0",
|
||||||
"base64-serde",
|
"base64-serde",
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Cross config
|
||||||
|
[target.aarch64-unknown-linux-musl]
|
||||||
|
pre-build = [
|
||||||
|
"apt-get update && apt-get install --assume-yes wget && wget https://go.dev/dl/go1.20.5.linux-amd64.tar.gz -O /go.tar.gz && tar -C /usr/local -xzf /go.tar.gz && echo \"export PATH=$PATH:/usr/local/go/bin\" >> /etc/profile && touch /go-installed",
|
||||||
|
]
|
||||||
|
|
||||||
|
[target.aarch64-unknown-linux-musl.env]
|
||||||
|
volumes = []
|
||||||
|
passthrough = ["GOPATH=/tmp/gopath", "GOCACHE=/tmp/gocache"]
|
||||||
|
|
||||||
|
[target.x86_64-unknown-linux-musl]
|
||||||
|
pre-build = [
|
||||||
|
"apt-get update && apt-get install --assume-yes wget && wget https://go.dev/dl/go1.20.5.linux-amd64.tar.gz -O /go.tar.gz && tar -C /usr/local -xzf /go.tar.gz && echo \"export PATH=$PATH:/usr/local/go/bin\" >> /etc/profile && touch /go-installed",
|
||||||
|
]
|
||||||
|
|
||||||
|
[target.x86_64-unknown-linux-musl.env]
|
||||||
|
volumes = []
|
||||||
|
passthrough = ["GOPATH=/tmp/gopath", "GOCACHE=/tmp/gocache"]
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "nebula-ffi"
|
name = "nebula-ffi"
|
||||||
version = "0.1.1"
|
version = "0.1.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A Rust wrapper crate for communicating with Nebula via a CGO FFI."
|
description = "A Rust wrapper crate for communicating with Nebula via a CGO FFI."
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
|
@ -13,4 +13,4 @@ repository = "https://git.e3t.cc/~core/trifid"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
gobuild = "0.1.0-alpha.2"
|
gobuild = "0.1.0-alpha.2"
|
||||||
bindgen = "0.66.1"
|
bindgen = "0.66.1"
|
||||||
|
|
|
@ -2,8 +2,20 @@ use std::env;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use bindgen::CargoCallbacks;
|
use bindgen::CargoCallbacks;
|
||||||
use gobuild::BuildMode;
|
use gobuild::BuildMode;
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// Find compiler: if /usr/local/go/bin/go exists, use that
|
||||||
|
// otherwise, rely on PATH
|
||||||
|
let compiler;
|
||||||
|
if Path::new("/usr/local/go/bin/go").exists() {
|
||||||
|
println!("Using /usr/local/go/bin/go");
|
||||||
|
compiler = "/usr/local/go/bin/go";
|
||||||
|
} else {
|
||||||
|
compiler = "go";
|
||||||
|
}
|
||||||
|
|
||||||
|
gobuild::Build::new().compiler(compiler).file("main.go").compile("nebulaffi");
|
||||||
gobuild::Build::new().buildmode(BuildMode::CShared).file("main.go").compile("nebulaffi");
|
gobuild::Build::new().buildmode(BuildMode::CShared).file("main.go").compile("nebulaffi");
|
||||||
|
|
||||||
println!("Go compile success");
|
println!("Go compile success");
|
||||||
|
|
|
@ -7,7 +7,7 @@ cd tfcli || exit
|
||||||
echo "Building for release, v$2_$3 (+static) (--target x86_64-unknown-musl)"
|
echo "Building for release, v$2_$3 (+static) (--target x86_64-unknown-musl)"
|
||||||
cargo build --release --target x86_64-unknown-linux-musl
|
cargo build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
cd ../packages/void || exit
|
cd ../packages/void_amd64_tfcli || exit
|
||||||
|
|
||||||
echo "Creating workdir"
|
echo "Creating workdir"
|
||||||
rm -rf work
|
rm -rf work
|
||||||
|
@ -17,9 +17,9 @@ mkdir -p work/etc/sv
|
||||||
|
|
||||||
echo "Copying tfcli binary"
|
echo "Copying tfcli binary"
|
||||||
|
|
||||||
cp ../../target/release/tfcli work/usr/bin/tfcli
|
cp ../../target/x86_64-unknown-linux-musl/release/tfcli work/usr/bin/tfcli
|
||||||
chmod 755 work/usr/bin/tfcli
|
chmod 755 work/usr/bin/tfcli
|
||||||
|
|
||||||
echo "Building XBPS package"
|
echo "Building XBPS package"
|
||||||
|
|
||||||
xbps-create -A x86_64 -B trifid-build -H https://hub.e3t.cc/~core/trifid -l GPL-3.0-or-later -m "c0repwn3r <core@e3t.cc>" -n "tfcli-$2_$3" -s "A command-line client for managing trifid-api servers" work
|
xbps-create -A x86_64 -B trifid-build -H https://hub.e3t.cc/~core/trifid -l GPL-3.0-or-later -m "c0repwn3r <core@e3t.cc>" -n "tfcli-$2_$3" -s "A command-line client for managing trifid-api servers" work
|
||||||
|
|
|
@ -7,7 +7,7 @@ cd tfclient || exit
|
||||||
echo "Building for release, v$2_$3 (+static) (--target x86_64-unknown-musl)"
|
echo "Building for release, v$2_$3 (+static) (--target x86_64-unknown-musl)"
|
||||||
cargo build --release --target x86_64-unknown-linux-musl
|
cargo build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
cd ../packages/void || exit
|
cd ../packages/void_amd64_tfclient || exit
|
||||||
|
|
||||||
echo "Creating workdir"
|
echo "Creating workdir"
|
||||||
rm -rf work
|
rm -rf work
|
||||||
|
@ -17,10 +17,10 @@ mkdir -p work/etc/sv
|
||||||
|
|
||||||
echo "Copying tfclient binary"
|
echo "Copying tfclient binary"
|
||||||
|
|
||||||
cp ../../target/release/tfclient work/usr/bin/tfclient
|
cp ../../target/x86_64-unknown-linux-musl/release/tfclient work/usr/bin/tfclient
|
||||||
chmod 755 work/usr/bin/tfclient
|
chmod 755 work/usr/bin/tfclient
|
||||||
cp -r tfclient work/etc/sv
|
cp -r tfclient work/etc/sv
|
||||||
|
|
||||||
echo "Building XBPS package"
|
echo "Building XBPS package"
|
||||||
|
|
||||||
xbps-create -A x86_64 -B trifid-build -H https://hub.e3t.cc/~core/trifid -l GPL-3.0-or-later -m "c0repwn3r <core@e3t.cc>" -n "tfclient-$2_$3" -s "An open-source Rust Defined Networking client" work
|
xbps-create -A x86_64 -B trifid-build -H https://hub.e3t.cc/~core/trifid -l GPL-3.0-or-later -m "c0repwn3r <core@e3t.cc>" -n "tfclient-$2_$3" -s "An open-source Rust Defined Networking client" work
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tfclient"
|
name = "tfclient"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "An open-source reimplementation of a Defined Networking-compatible client"
|
description = "An open-source reimplementation of a Defined Networking-compatible client"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
|
@ -47,4 +47,5 @@ maintainer = "c0repwn3r <core@e3t.cc>"
|
||||||
copyright = "e3team <admin@e3t.cc>"
|
copyright = "e3team <admin@e3t.cc>"
|
||||||
license-file = "LICENSE.txt"
|
license-file = "LICENSE.txt"
|
||||||
maintainer-scripts = "debian/"
|
maintainer-scripts = "debian/"
|
||||||
systemd-units = { enable = false, unit-name = "tfclient@" }
|
systemd-units = { enable = false, unit-name = "tfclient@" }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue