nixpkgs/pkgs/development/tools/rubyfmt/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

84 lines
1.6 KiB
Nix
Raw Normal View History

2023-02-10 08:24:41 +00:00
{ lib
, stdenv
2023-02-10 08:24:41 +00:00
, rustPlatform
, fetchFromGitHub
, autoconf
, automake
, bison
, ruby
, zlib
, readline
, libiconv
, libobjc
, libunwind
2023-02-10 08:24:41 +00:00
, libxcrypt
2023-09-02 04:20:00 +00:00
, libyaml
, Foundation
, Security
2023-02-10 08:24:41 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "rubyfmt";
2023-09-02 04:20:00 +00:00
version = "0.10.0";
2023-02-10 08:24:41 +00:00
src = fetchFromGitHub {
owner = "fables-tales";
repo = "rubyfmt";
rev = "v${version}";
2023-09-02 04:20:00 +00:00
hash = "sha256-IIHPU6iwFwQ5cOAtOULpMSjexFtTelSd/LGLuazdmUo=";
2023-02-10 08:24:41 +00:00
fetchSubmodules = true;
};
nativeBuildInputs = [
autoconf
automake
bison
ruby
];
buildInputs = [
zlib
libxcrypt
2023-09-02 04:20:00 +00:00
libyaml
] ++ lib.optionals stdenv.isDarwin [
readline
libiconv
libobjc
libunwind
Foundation
Security
2023-02-10 08:24:41 +00:00
];
preConfigure = ''
pushd librubyfmt/ruby_checkout
autoreconf --install --force --verbose
./configure
popd
'';
2023-02-10 08:24:41 +00:00
cargoPatches = [
# Avoid checking whether ruby gitsubmodule is up-to-date.
./0002-remove-dependency-on-git.patch
];
2023-09-02 04:20:00 +00:00
cargoHash = "sha256-QZ26GmsKyENkzdCGg2peie/aJhEt7KQAF/lwsibonDk=";
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fdeclspec";
2023-02-10 08:24:41 +00:00
preFixup = ''
mv $out/bin/rubyfmt{-main,}
'';
meta = with lib; {
description = "A Ruby autoformatter";
homepage = "https://github.com/fables-tales/rubyfmt";
license = licenses.mit;
maintainers = with maintainers; [ bobvanderlinden ];
2023-09-02 04:20:00 +00:00
# = note: Undefined symbols for architecture x86_64:
# "_utimensat", referenced from:
# _utime_internal in librubyfmt-3c969812b3b27083.rlib(file.o)
broken = stdenv.isDarwin && stdenv.isx86_64;
mainProgram = "rubyfmt";
2023-02-10 08:24:41 +00:00
};
}