From 59172a14e71cf6aeae1de13e55d2e60af6dacb35 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 5 Oct 2018 20:37:19 +0200 Subject: [PATCH 1/2] Starting to work on auto sfml build locally --- .gitignore | 1 + Cargo.toml | 5 +++++ prepare/build.rs | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 prepare/build.rs diff --git a/.gitignore b/.gitignore index 6936990..7a4bf0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target **/*.rs.bk Cargo.lock +third-party diff --git a/Cargo.toml b/Cargo.toml index b47da53..a0f3a6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,10 +2,15 @@ name = "rusty" version = "0.1.0" authors = ["Thomas Forgione "] +build = "prepare/build.rs" [dependencies] sfml = "0.14.0" +[build-dependencies] +git2 = "0.7.5" +cmake = "0.1" + [[bin]] name = "rusty-maker" path = "src/app/game.rs" diff --git a/prepare/build.rs b/prepare/build.rs new file mode 100644 index 0000000..c07cd58 --- /dev/null +++ b/prepare/build.rs @@ -0,0 +1,22 @@ +extern crate git2; + +use git2::Repository; + +fn main() { + let sfml = match Repository::open("third-party/sfml") { + Ok(repo) => repo, + Err(_) => { + Repository::clone("https://github.com/sfml/sfml", "third-party/sfml") + .expect("Couldn't clone SFML") + } + }; + + let csfml = match Repository::open("third-party/csfml") { + Ok(repo) => repo, + Err(_) => { + Repository::clone("https://github.com/sfml/csfml", "third-party/csfml") + .expect("Couldn't clone CSFML") + } + }; + +} From e479ccd3882382f70d2d8e918bede7c3fb1fe95e Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Mon, 8 Oct 2018 14:22:45 +0200 Subject: [PATCH 2/2] Fix auto SFML build --- Cargo.toml | 3 +-- prepare/build.rs | 22 ---------------------- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 prepare/build.rs diff --git a/Cargo.toml b/Cargo.toml index a0f3a6d..e65a71f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,10 +2,9 @@ name = "rusty" version = "0.1.0" authors = ["Thomas Forgione "] -build = "prepare/build.rs" [dependencies] -sfml = "0.14.0" +sfml = { git = "https://gitea.tforgione.fr/free-rusty-maker/rust-sfml" } [build-dependencies] git2 = "0.7.5" diff --git a/prepare/build.rs b/prepare/build.rs deleted file mode 100644 index c07cd58..0000000 --- a/prepare/build.rs +++ /dev/null @@ -1,22 +0,0 @@ -extern crate git2; - -use git2::Repository; - -fn main() { - let sfml = match Repository::open("third-party/sfml") { - Ok(repo) => repo, - Err(_) => { - Repository::clone("https://github.com/sfml/sfml", "third-party/sfml") - .expect("Couldn't clone SFML") - } - }; - - let csfml = match Repository::open("third-party/csfml") { - Ok(repo) => repo, - Err(_) => { - Repository::clone("https://github.com/sfml/csfml", "third-party/csfml") - .expect("Couldn't clone CSFML") - } - }; - -}