Skip to content
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
19 changes: 6 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,22 @@ jobs:
set_env('BUILD_VERSION', buildVersion)
set_env('RELEASE_VERSION', releaseVersion)

- name: Build Rust
- name: Install nightly Rust
run: |
git clone https://github.com/rust-lang/rust.git -b 1.91.0
cd rust
./x check
./x build --stage 2
rustup toolchain install nightly --profile complete
rustup default nightly

rustup toolchain link stage0 build/host/stage0-sysroot
rustup toolchain link stage1 build/host/stage1
rustup toolchain link stage2 build/host/stage2
rustc +stage2 -vV
rustc -vV
which rustc
rustc --print target-list|grep vision
rustc --print target-list|grep tvos

- name: Install cargo-c
run: |
cargo install cargo-c

- name: Build
run: |
rustc +stage2 -vV
which rustc
rustc +stage2 --print target-list|grep vision
rustc +stage2 --print target-list|grep tvos
make build version=${{ env.RELEASE_VERSION }}

- name: Update Package.swift
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build and Release

on:
push:
branches:
- ci
workflow_dispatch:

jobs:
build:
permissions:
contents: write
runs-on: macos-14
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
brew install autoconf
brew install automake
brew install libtool
python -m pip install meson==1.4.2
brew install ninja


- name: Setup Xcode to support visionOS
run: |
sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
xcodebuild -showsdks

- name: Check version to release
uses: jannekem/run-python-script-action@v1
with:
script: |
import re

def normalize_version(version_string):
version_string = re.sub(r'[^.0-9]+|-.+', '', version_string)
parts = re.split(r'\.', version_string)
major = int(parts[0])
minor = int(parts[1]) if len(parts) > 1 else 0
patch = int(parts[2]) if len(parts) > 2 else 0
return f"{major}.{minor}.{patch}"

file_path = './Sources/BuildScripts/XCFrameworkBuild/main.swift'
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
buildVersion = re.search(r'(case .libdovi[^"]+?)"(.+?)"', content).group(2)
print(f'build version: {buildVersion}')
releaseVersion = '${{ github.event.inputs.version }}' or normalize_version(buildVersion)
print(f'release version: {releaseVersion}')
set_env('BUILD_VERSION', buildVersion)
set_env('RELEASE_VERSION', releaseVersion)

- name: Install nightly Rust
run: |
rustup toolchain install nightly --profile complete
rustup default nightly

rustc -vV
which rustc
rustc --print target-list|grep vision
rustc --print target-list|grep tvos

- name: Install cargo-c
run: |
cargo install cargo-c

- name: Build
run: |
make build version=${{ env.RELEASE_VERSION }}
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,14 @@ https://github.com/mpvkit/libdovi-build.git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

### build rustc support tvOS arm64e target
### install nightly version to support tvOS arm64e target

```
git clone https://github.com/rust-lang/rust.git -b ${{ github.event.inputs.version }}
cd rust
git apply ../patch/rust/01-tvos_arm64e_support.patch
./x check
./x build --stage 2
# install
rustup toolchain install nightly --profile complete
rustup default nightly

rustup toolchain link stage0 build/host/stage0-sysroot
rustup toolchain link stage1 build/host/stage1
rustup toolchain link stage2 build/host/stage2
rustc +stage2 -vV
rustc -vV
```


Expand Down
2 changes: 1 addition & 1 deletion Sources/BuildScripts/XCFrameworkBuild/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private class BuildDovi: BaseBuild {
let environ = environment(platform: platform, arch: arch)

let cargo = Utility.shell("which cargo", isOutput: true, environment: environ)!
try Utility.launch(path: cargo, arguments: ["+stage2", "cinstall", "-Zbuild-std=std,panic_abort", "--release", "--prefix=\(prefix.path)", "--target=\(target)"] , currentDirectoryURL: currentDirectoryURL, environment: environ)
try Utility.launch(path: cargo, arguments: ["cinstall", "-Zbuild-std=std,panic_abort", "--release", "--prefix=\(prefix.path)", "--target=\(target)"] , currentDirectoryURL: currentDirectoryURL, environment: environ)
}
}

Expand Down
53 changes: 0 additions & 53 deletions patch/cargo-c/01-add-visionos-support.patch

This file was deleted.

114 changes: 0 additions & 114 deletions patch/rust/01-tvos_arm64e_support.patch

This file was deleted.

Loading