diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7b14a3e..6dc3364 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -253,16 +253,19 @@ jobs: - name: Build release binary shell: bash run: | - # if aarch64-unknown-linux-gnu, we need to install the cross compiler - if [[ ${{ matrix.target }} == aarch64-unknown-linux-gnu ]]; then - sudo apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu - fi version="${{ github.ref_name }}" DEB_NAME="tv-$version-${{ matrix.target }}.deb" DEB_DIR="target/${{ matrix.target }}/debian" # Build the actual binary - cargo deb --profile deb --target ${{ matrix.target }} -o "$DEB_DIR/$DEB_NAME" + # if aarch64, we need to install the cross compiler since we're running x86_64 + if [[ ${{ matrix.target }} == aarch64-unknown-linux-gnu ]]; then + sudo apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu + cargo deb --profile deb --target ${{ matrix.target }} -o "$DEB_DIR/$DEB_NAME" -- --no-default-features --features zero-copy,simd,fancy + else + cargo deb --profile deb --target ${{ matrix.target }} -o "$DEB_DIR/$DEB_NAME" + fi + echo "DEB_DIR=$DEB_DIR" >> $GITHUB_ENV echo "DEB_NAME=$DEB_NAME" >> $GITHUB_ENV diff --git a/Cargo.toml b/Cargo.toml index 3c4b27a..0576c4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,10 +64,18 @@ syntect = { package = "syntect", version = "5.2", default-features = false } bat = { package = "bat", version = "0.25", default-features = false } +# target specific dependencies +[target.'cfg(target_os = "macos")'.dependencies] +crossterm = { version = "0.28.1", features = ["serde", "use-dev-tty"] } + +[target.'cfg(not(target_os = "macos"))'.dependencies] +crossterm = { version = "0.28", features = ["serde"] } + [target.'cfg(windows)'.dependencies] winapi-util = "0.1.9" clipboard-win = "5.4.0" + [dev-dependencies] criterion = { version = "0.5", features = ["async_tokio"] } tempfile = "3.16.0" @@ -75,16 +83,11 @@ tempfile = "3.16.0" [features] simd = ["dep:simdutf8"] zero-copy = [] -default = ["zero-copy", "simd", "onig"] # Use fancy-regex for aarch64 Linux fancy = ["syntect/regex-fancy", "bat/regex-fancy"] # Use oniguruma for other platforms onig = ["syntect/regex-onig", "bat/regex-onig"] - - -# Use `fancy-regex` instead of `oniguruma` on aarch64 Linux (build problems) -[target.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.features] -default = ["fancy"] +default = ["zero-copy", "simd", "onig"] [build-dependencies] @@ -101,11 +104,6 @@ name = "tv" name = "main" harness = false -[target.'cfg(target_os = "macos")'.dependencies] -crossterm = { version = "0.28.1", features = ["serde", "use-dev-tty"] } - -[target.'cfg(not(target_os = "macos"))'.dependencies] -crossterm = { version = "0.28", features = ["serde"] } [profile.staging] inherits = "dev"