enable armv8,neon for build scripts

This commit is contained in:
zonyitoo
2022-01-28 09:54:10 +08:00
parent 2cc68880d8
commit d3454dbd9a
4 changed files with 6 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ WORKDIR /root/shadowsocks-rust
ADD . .
RUN rustup install "$(cat rust-toolchain)" && \
RUN rustup install nightly && \
case "$TARGETARCH" in \
"386") \
RUST_TARGET="i686-unknown-linux-musl" \
@@ -30,7 +30,7 @@ RUN rustup install "$(cat rust-toolchain)" && \
wget -qO- "https://musl.cc/$MUSL-cross.tgz" | tar -xzC /root/ && \
CC=/root/$MUSL-cross/bin/$MUSL-gcc && \
rustup target add $RUST_TARGET && \
RUSTFLAGS="-C linker=$CC" CC=$CC cargo build --target $RUST_TARGET --release && \
RUSTFLAGS="-C linker=$CC" CC=$CC cargo build --target "$RUST_TARGET" --release --features "local-tun local-redir armv8 neon" && \
mv target/$RUST_TARGET/release/ss* target/release/
FROM alpine:3.14 AS sslocal

View File

@@ -6,7 +6,7 @@ all: build
build:
ifeq (${TARGET}, release)
cargo build --release
cargo build --release --features "local-tun local-redir armv8 neon"
else
cargo build
endif

View File

@@ -15,7 +15,7 @@ class ShadowsocksRust < Formula
def install
ENV.with_build_environment do
ENV["RUSTFLAGS"] = "-C target-cpu=native"
system "cargo", "install", *std_cargo_args
system "cargo", "install", *std_cargo_args, "--features", "local-tun local-redir"
end
end

View File

@@ -43,6 +43,8 @@ parts:
shadowsocks-rust:
plugin: rust
source: https://github.com/shadowsocks/shadowsocks-rust.git
rust-channel: nightly
rust-features: [local-tun, local-redir, armv8, neon]
override-pull: |
snapcraftctl pull
snapcraftctl set-version `git describe --tags --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'`