diff --git a/.github/workflows/package_posix.yml b/.github/workflows/package_posix.yml index 4744c3276..960d121d6 100644 --- a/.github/workflows/package_posix.yml +++ b/.github/workflows/package_posix.yml @@ -20,8 +20,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v1 - - name: Update submodules - run: git submodule update --init - name: Install System Deps run: sudo ./get-deps - name: Install Rust diff --git a/.github/workflows/package_win.yml b/.github/workflows/package_win.yml index 38e6e1747..df409e1b6 100644 --- a/.github/workflows/package_win.yml +++ b/.github/workflows/package_win.yml @@ -20,8 +20,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v1 - - name: Update submodules - run: git submodule update --init - name: Install Rust shell: cmd run: | diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index 0cc8abe14..a04aad265 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -18,8 +18,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v1 - - name: Update submodules - run: git submodule update --init - name: Install System Deps run: sudo ./get-deps - name: Install Rust diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index fc9aa0a6d..bbb4563e5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -18,8 +18,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v1 - - name: Update submodules - run: git submodule update --init - name: Install Rust shell: cmd run: | diff --git a/deps/freetype/build.rs b/deps/freetype/build.rs index ca794eb17..79000b86d 100644 --- a/deps/freetype/build.rs +++ b/deps/freetype/build.rs @@ -4,6 +4,10 @@ use std::env; use std::path::{Path, PathBuf}; fn zlib() { + if !Path::new("zlib/.git").exists() { + git_submodule_update(); + } + // The out-of-source build for zlib unfortunately modifies some of // the sources, leaving the repo with a dirty status. Let's take // a copy of the sources so that we don't trigger this. @@ -49,6 +53,10 @@ fn libpath(p: &Path, name: &str) -> PathBuf { } fn libpng() { + if !Path::new("libpng/.git").exists() { + git_submodule_update(); + } + let mut config = Config::new("libpng"); let dst = config.profile("Release").build(); emit_libdirs(&dst); @@ -60,6 +68,10 @@ fn libpng() { } fn freetype() { + if !Path::new("freetype2/.git").exists() { + git_submodule_update(); + } + let mut config = Config::new("freetype2"); let dst = config .define("FT_WITH_PNG", "ON") @@ -73,6 +85,12 @@ fn freetype() { println!("cargo:lib={}", libpath(&dst, "freetype").display()); } +fn git_submodule_update() { + let _ = std::process::Command::new("git") + .args(&["submodule", "update", "--init"]) + .status(); +} + fn main() { zlib(); libpng(); diff --git a/deps/harfbuzz/build.rs b/deps/harfbuzz/build.rs index 2dc34676d..422d21688 100644 --- a/deps/harfbuzz/build.rs +++ b/deps/harfbuzz/build.rs @@ -3,6 +3,10 @@ use std::env; use std::path::Path; fn harfbuzz() { + if !Path::new("harfbuzz/.git").exists() { + git_submodule_update(); + } + let mut config = Config::new("harfbuzz"); for (key, value) in std::env::vars() { println!("{}: {}", key, value); @@ -44,6 +48,12 @@ fn emit_libdirs(p: &Path) { } } +fn git_submodule_update() { + let _ = std::process::Command::new("git") + .args(&["submodule", "update", "--init"]) + .status(); +} + fn main() { harfbuzz(); let out_dir = env::var("OUT_DIR").unwrap();