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
69 lines
1.6 KiB
Nix
69 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
buildRubyGem,
|
|
bundlerEnv,
|
|
ruby_3_4,
|
|
}:
|
|
|
|
let
|
|
gemName = "github-linguist";
|
|
version = "9.1.0";
|
|
src = fetchFromGitHub {
|
|
owner = "github-linguist";
|
|
repo = "linguist";
|
|
tag = "v${version}";
|
|
hash = "sha256-nPIUo6yQY6WvKuXvT1oOx6LZq49QLa9YIJmOrRYgAdg=";
|
|
};
|
|
|
|
deps = bundlerEnv {
|
|
name = "github-linguist-dep";
|
|
gemfile = "${src}/Gemfile";
|
|
lockfile = ./Gemfile.lock;
|
|
gemset = ./gemset.nix;
|
|
inherit ruby;
|
|
};
|
|
|
|
ruby = ruby_3_4;
|
|
|
|
in
|
|
buildRubyGem rec {
|
|
name = "${gemName}-${version}";
|
|
inherit
|
|
gemName
|
|
version
|
|
src
|
|
ruby
|
|
;
|
|
|
|
doInstallCheck = true;
|
|
dontBuild = false;
|
|
|
|
postInstall = ''
|
|
export GEM_PATH="${deps}/lib/ruby/gems/${ruby.version.libDir}"
|
|
bundle exec rake samples
|
|
install --mode=0644 -Dm 0755 lib/linguist/samples.json $out/lib/ruby/gems/${ruby.version.libDir}/gems/${name}/lib/linguist
|
|
|
|
wrapProgram "$out/bin/github-linguist" \
|
|
--set GEM_PATH "${deps}/lib/ruby/gems/${ruby.version.libDir}"
|
|
|
|
wrapProgram "$out/bin/git-linguist" \
|
|
--set GEM_PATH "${deps}/lib/ruby/gems/${ruby.version.libDir}"
|
|
'';
|
|
|
|
passthru = {
|
|
inherit ruby deps;
|
|
};
|
|
|
|
meta = {
|
|
description = "Language savant Ruby library";
|
|
longDescription = ''
|
|
A Ruby library that is used on GitHub.com to detect blob languages, ignore binary or vendored files, suppress generated files in diffs, and generate language breakdown graphs.
|
|
'';
|
|
homepage = "https://github.com/github-linguist/linguist";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ Cryolitia ];
|
|
platforms = with lib.platforms; linux ++ darwin;
|
|
};
|
|
}
|