python312Packages.publicsuffixlist: 1.0.2.20241205 -> 1.0.2.20241207 (#362855)
[NixPkgs.git] / pkgs / development / tools / rubyfmt / 0002-remove-dependency-on-git.patch
blobd7e3b90ab79f490668388c267c9e90d591cc7bcb
1 From 3bbc396c4ddc8a5e26f7776155bb366c8d47c440 Mon Sep 17 00:00:00 2001
2 From: Bob van der Linden <bobvanderlinden@gmail.com>
3 Date: Thu, 9 Feb 2023 16:55:00 +0100
4 Subject: [PATCH 2/2] remove dependency on git
6 ---
7 librubyfmt/build.rs | 35 +++--------------------------------
8 1 file changed, 3 insertions(+), 32 deletions(-)
10 diff --git a/librubyfmt/build.rs b/librubyfmt/build.rs
11 index ef94c09..4668785 100644
12 --- a/librubyfmt/build.rs
13 +++ b/librubyfmt/build.rs
14 @@ -26,27 +26,9 @@ fn main() -> Output {
15 let path = std::env::current_dir()?;
16 let ruby_checkout_path = path.join("ruby_checkout");
18 - let old_checkout_sha = if ruby_checkout_path.join(ripper).exists() {
19 - Some(get_ruby_checkout_sha())
20 - } else {
21 - None
22 - };
24 - let _ = Command::new("git")
25 - .args(&["submodule", "update", "--init"])
26 - .status();
28 - let new_checkout_sha = get_ruby_checkout_sha();
30 - // Only rerun this build if the ruby_checkout has changed
31 - match old_checkout_sha {
32 - Some(old_sha) if old_sha == new_checkout_sha => {}
33 - _ => {
34 - make_configure(&ruby_checkout_path)?;
35 - run_configure(&ruby_checkout_path)?;
36 - build_ruby(&ruby_checkout_path)?;
37 - }
38 - }
39 + make_configure(&ruby_checkout_path)?;
40 + run_configure(&ruby_checkout_path)?;
41 + build_ruby(&ruby_checkout_path)?;
43 cc::Build::new()
44 .file("src/rubyfmt.c")
45 @@ -152,14 +134,3 @@ fn check_process_success(command: &str, code: ExitStatus) -> Output {
49 -fn get_ruby_checkout_sha() -> String {
50 - String::from_utf8(
51 - Command::new("git")
52 - .args(&["rev-parse", "HEAD"])
53 - .current_dir("./ruby_checkout")
54 - .output()
55 - .expect("git rev-parse shouldn't fail")
56 - .stdout,
57 - )
58 - .expect("output should be valid utf8")
60 --
61 2.39.1