2023-10-09 19:29:22 +00:00
{ lib
, rustPlatform
, fetchFromGitHub
, stdenv
} :
rustPlatform . buildRustPackage rec {
pname = " a s t - g r e p " ;
2024-02-07 01:22:34 +00:00
version = " 0 . 1 8 . 1 " ;
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-02-07 01:22:34 +00:00
hash = " s h a 2 5 6 - h r 6 V A q B s v 3 s z V C l R 9 3 y 5 i c k k r N K j v l 6 B f z q K A 3 z c 6 v M = " ;
2023-10-09 19:29:22 +00:00
} ;
2024-02-07 01:22:34 +00:00
cargoHash = " s h a 2 5 6 - t t J M t a Q f V n F j 4 / w U z 4 f n 8 X / E m U w W + u s q h m W h y 4 Y 0 A B 8 = " ;
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 ] ;
} ;
}