mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
rubyfmt 0.11.0 -> 0.13.0 (#519834)
This commit is contained in:
commit
f77c3e23e5
3 changed files with 13 additions and 91 deletions
|
|
@ -1,49 +0,0 @@
|
|||
--- a/librubyfmt/build.rs
|
||||
+++ b/librubyfmt/build.rs
|
||||
@@ -33,27 +33,9 @@
|
||||
let path = env::current_dir()?;
|
||||
let ruby_checkout_path = path.join("ruby_checkout");
|
||||
|
||||
- let old_checkout_sha = if ruby_checkout_path.join(ripper).exists() {
|
||||
- Some(get_ruby_checkout_sha())
|
||||
- } else {
|
||||
- None
|
||||
- };
|
||||
-
|
||||
- let _ = Command::new("git")
|
||||
- .args(["submodule", "update", "--init"])
|
||||
- .status();
|
||||
-
|
||||
- let new_checkout_sha = get_ruby_checkout_sha();
|
||||
-
|
||||
- // Only rerun this build if the ruby_checkout has changed
|
||||
- match old_checkout_sha {
|
||||
- Some(old_sha) if old_sha == new_checkout_sha => {}
|
||||
- _ => {
|
||||
- make_configure(&ruby_checkout_path)?;
|
||||
- run_configure(&ruby_checkout_path)?;
|
||||
- build_ruby(&ruby_checkout_path)?;
|
||||
- }
|
||||
- }
|
||||
+ make_configure(&ruby_checkout_path)?;
|
||||
+ run_configure(&ruby_checkout_path)?;
|
||||
+ build_ruby(&ruby_checkout_path)?;
|
||||
|
||||
let arch = extract_ruby_arch(&ruby_checkout_path);
|
||||
|
||||
@@ -225,15 +207,3 @@
|
||||
Err(format!("Command {} failed with: {}", command, code).into())
|
||||
}
|
||||
}
|
||||
-
|
||||
-fn get_ruby_checkout_sha() -> String {
|
||||
- String::from_utf8(
|
||||
- Command::new("git")
|
||||
- .args(["rev-parse", "HEAD"])
|
||||
- .current_dir("./ruby_checkout")
|
||||
- .output()
|
||||
- .expect("git rev-parse shouldn't fail")
|
||||
- .stdout,
|
||||
- )
|
||||
- .expect("output should be valid utf8")
|
||||
-}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
diff --git i/librubyfmt/build.rs w/librubyfmt/build.rs
|
||||
index 296b749..941a4ca 100644
|
||||
--- i/librubyfmt/build.rs
|
||||
+++ w/librubyfmt/build.rs
|
||||
@@ -166,6 +166,7 @@ fn run_configure(ruby_checkout_path: &Path) -> Output {
|
||||
command
|
||||
.arg("--target=aarch64-unknown-linux-gnu")
|
||||
.arg("--host=x86_64")
|
||||
+ .arg("--disable-werror")
|
||||
.env("CC", "aarch64-linux-gnu-gcc")
|
||||
.env("AR", "aarch64-linux-gnu-ar")
|
||||
.env("RANLIB", "aarch64-linux-gnu-ranlib");
|
||||
diff --git i/librubyfmt/src/lib.rs w/librubyfmt/src/lib.rs
|
||||
index 9b94b5f..b78e99f 100644
|
||||
--- i/librubyfmt/src/lib.rs
|
||||
+++ w/librubyfmt/src/lib.rs
|
||||
@@ -1,4 +1,3 @@
|
||||
-#![deny(warnings, missing_copy_implementations)]
|
||||
#![allow(clippy::upper_case_acronyms, clippy::enum_variant_names)]
|
||||
|
||||
use serde::de::value;
|
||||
|
|
@ -13,19 +13,19 @@
|
|||
libunwind,
|
||||
libxcrypt,
|
||||
libyaml,
|
||||
rust-jemalloc-sys-unprefixed,
|
||||
rust-jemalloc-sys,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "rubyfmt";
|
||||
version = "0.11.0";
|
||||
version = "0.13.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "fables-tales";
|
||||
repo = "rubyfmt";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-wGvfmBm2GNXASXc//K2JOrn/iUdlbA5dDReNJ+NqjDM=";
|
||||
hash = "sha256-Pzv51KUvDi9MyOOj/RiJus91JzU5M2IhHDoxUS4cN2I=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
|
|
@ -34,13 +34,14 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
automake
|
||||
bison
|
||||
ruby
|
||||
rustPlatform.bindgenHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
zlib
|
||||
libxcrypt
|
||||
libyaml
|
||||
rust-jemalloc-sys-unprefixed
|
||||
rust-jemalloc-sys
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
readline
|
||||
|
|
@ -48,23 +49,15 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
libunwind
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
pushd librubyfmt/ruby_checkout
|
||||
autoreconf --install --force --verbose
|
||||
./configure
|
||||
popd
|
||||
'';
|
||||
cargoHash = "sha256-Y7W3zwbScdZd+4W75od3CpwKWSxe1Bk2u2QEzgDUn/Y=";
|
||||
|
||||
cargoPatches = [
|
||||
# Avoid checking whether ruby gitsubmodule is up-to-date.
|
||||
./0002-remove-dependency-on-git.patch
|
||||
# Avoid failing on unused variable warnings.
|
||||
./0003-ignore-warnings.patch
|
||||
];
|
||||
|
||||
cargoHash = "sha256-jJa/6TKwTTN3xOBuUy+YdwKOJbtYVrmlHgMyqPCVqVs=";
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-fdeclspec";
|
||||
env = {
|
||||
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-fdeclspec";
|
||||
}
|
||||
// lib.optionalAttrs stdenv.hostPlatform.isLinux {
|
||||
"BINDGEN_EXTRA_CLANG_ARGS_${stdenv.hostPlatform.rust.rustcTarget}" =
|
||||
"-isystem ${stdenv.cc.libc.dev}/include";
|
||||
};
|
||||
|
||||
preFixup = ''
|
||||
mv $out/bin/rubyfmt{-main,}
|
||||
|
|
@ -77,7 +70,6 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
homepage = "https://github.com/fables-tales/rubyfmt";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ bobvanderlinden ];
|
||||
broken = stdenv.hostPlatform.isDarwin;
|
||||
mainProgram = "rubyfmt";
|
||||
};
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue