2023-10-09 19:29:22 +00:00
{ lib
, rustPlatform
, fetchFromGitHub
, stdenv
} :
rustPlatform . buildRustPackage rec {
pname = " a s t - g r e p " ;
2024-01-13 08:15:51 +00:00
version = " 0 . 1 7 . 0 " ;
2023-10-09 19:29:22 +00:00
src = fetchFromGitHub {
owner = " a s t - g r e p " ;
repo = " a s t - g r e p " ;
rev = version ;
2024-01-13 08:15:51 +00:00
hash = " s h a 2 5 6 - / l W v F Y S E 4 g F b V P l J M R O G c b 8 6 m V v i G d h 1 t F A Y 7 4 q T T X 4 = " ;
2023-10-09 19:29:22 +00:00
} ;
2024-01-13 08:15:51 +00:00
cargoHash = " s h a 2 5 6 - r 1 v f h 2 J t B j W F g X r i j l F x P y R r 8 L R A I o g i A 2 T Z H I 5 M J R M = " ;
2024-01-02 11:29:13 +00:00
# Work around https://github.com/NixOS/nixpkgs/issues/166205.
env = lib . optionalAttrs stdenv . cc . isClang {
NIX_LDFLAGS = " - l ${ stdenv . cc . libcxx . cxxabi . libName } " ;
} ;
2023-10-09 19:29:22 +00:00
# error: linker `aarch64-linux-gnu-gcc` not found
postPatch = ''
rm .cargo/config.toml
'' ;
checkFlags = [
# disable flaky test
" - - s k i p = t e s t : : t e s t _ l o a d _ p a r s e r _ m a c "
# BUG: Broke by 0.12.1 update (https://github.com/NixOS/nixpkgs/pull/257385)
# Please check if this is fixed in future updates of the package
" - - s k i p = v e r i f y : : t e s t _ c a s e : : t e s t s : : t e s t _ u n m a t c h i n g _ i d "
] ++ lib . optionals ( with stdenv . hostPlatform ; ( isDarwin && isx86_64 ) || ( isLinux && isAarch64 ) ) [
# x86_64-darwin: source/benches/fixtures/json-mac.so\' (no such file), \'/private/tmp/nix-build-.../source/benches/fixtures/json-mac.so\' (mach-o file, but is an incompatible architecture (have \'arm64\', need \'x86_64h\' or \'x86_64\'))" })
# aarch64-linux: /build/source/benches/fixtures/json-linux.so: cannot open shared object file: No such file or directory"
" - - s k i p = t e s t : : t e s t _ l o a d _ p a r s e r "
" - - s k i p = t e s t : : t e s t _ r e g i s t e r _ l a n g "
] ;
meta = with lib ; {
mainProgram = " s g " ;
description = " A f a s t a n d p o l y g l o t t o o l f o r c o d e s e a r c h i n g , l i n t i n g , r e w r i t i n g a t l a r g e s c a l e " ;
homepage = " h t t p s : / / a s t - g r e p . g i t h u b . i o / " ;
changelog = " h t t p s : / / g i t h u b . c o m / a s t - g r e p / a s t - g r e p / b l o b / ${ src . rev } / C H A N G E L O G . m d " ;
license = licenses . mit ;
maintainers = with maintainers ; [ montchr lord-valen cafkafk ] ;
} ;
}