2023-10-09 19:29:22 +00:00
{ lib
, rustPlatform
, fetchFromGitHub
, stdenv
} :
rustPlatform . buildRustPackage rec {
pname = " a s t - g r e p " ;
2023-11-16 04:20:00 +00:00
version = " 0 . 1 3 . 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 ;
2023-11-16 04:20:00 +00:00
hash = " s h a 2 5 6 - W e e + n p g L 0 + 7 p v 9 p h 3 S 9 3 f I X r 8 z / F W p / T B t h J h V S x 3 z I = " ;
2023-10-09 19:29:22 +00:00
} ;
2023-11-16 04:20:00 +00:00
cargoHash = " s h a 2 5 6 - O F N q B k P A K a S q D Q U W i s u p j 6 F l D b m 3 k w 0 x q 5 n b v j 0 4 H 5 U = " ;
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 ] ;
} ;
}