Files
nixpkgs/pkgs/by-name/ru/rubyfmt/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

81 lines
1.5 KiB
Nix

{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
autoconf,
automake,
bison,
ruby,
zlib,
readline,
libiconv,
libunwind,
libxcrypt,
libyaml,
rust-jemalloc-sys-unprefixed,
}:
rustPlatform.buildRustPackage rec {
pname = "rubyfmt";
version = "0.10.0";
src = fetchFromGitHub {
owner = "fables-tales";
repo = "rubyfmt";
tag = "v${version}";
hash = "sha256-IIHPU6iwFwQ5cOAtOULpMSjexFtTelSd/LGLuazdmUo=";
fetchSubmodules = true;
};
nativeBuildInputs = [
autoconf
automake
bison
ruby
];
buildInputs = [
zlib
libxcrypt
libyaml
rust-jemalloc-sys-unprefixed
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
readline
libiconv
libunwind
];
preConfigure = ''
pushd librubyfmt/ruby_checkout
autoreconf --install --force --verbose
./configure
popd
'';
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-8LgAHznxU30bbK8ivNamVD3Yi2pljgpqJg2WC0nxftk=";
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-fdeclspec";
preFixup = ''
mv $out/bin/rubyfmt{-main,}
'';
meta = {
description = "Ruby autoformatter";
homepage = "https://github.com/fables-tales/rubyfmt";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ bobvanderlinden ];
broken = stdenv.hostPlatform.isDarwin;
mainProgram = "rubyfmt";
};
}