22 lib ,
33 rustPlatform ,
44 fetchFromGitHub ,
5+ versionCheckHook ,
6+ nix-update-script ,
57} :
68
7- rustPlatform . buildRustPackage rec {
9+ rustPlatform . buildRustPackage ( finalAttrs : {
810 pname = "rq" ;
911 version = "1.0.4" ;
1012
1113 src = fetchFromGitHub {
1214 owner = "dflemstr" ;
13- repo = pname ;
14- rev = "v${ version } " ;
15- sha256 = "sha256-QyYTbMXikLSe3eYJRUALQJxUJjA6VlvaLMwGrxIKfZI=" ;
15+ repo = "rq" ;
16+ tag = "v${ finalAttrs . version } " ;
17+ hash = "sha256-QyYTbMXikLSe3eYJRUALQJxUJjA6VlvaLMwGrxIKfZI=" ;
1618 } ;
1719
1820 useFetchCargoVendor = true ;
@@ -22,24 +24,34 @@ rustPlatform.buildRustPackage rec {
2224 # Remove #[deny(warnings)] which is equivalent to -Werror in C.
2325 # Prevents build failures when upgrading rustc, which may give more warnings.
2426 substituteInPlace src/lib.rs \
25- --replace "#![deny(warnings)]" ""
27+ --replace-fail "#![deny(warnings)]" ""
2628
2729 # build script tries to get version information from git
2830 # this fixes the --version output
2931 rm build.rs
3032 '' ;
3133
32- VERGEN_SEMVER = version ;
34+ VERGEN_SEMVER = finalAttrs . version ;
3335
34- meta = with lib ; {
36+ nativeInstallCheckInputs = [
37+ versionCheckHook
38+ ] ;
39+ versionCheckProgramArg = "--version" ;
40+ doInstallCheck = true ;
41+
42+ passthru = {
43+ updateScript = nix-update-script { } ;
44+ } ;
45+
46+ meta = {
3547 description = "Tool for doing record analysis and transformation" ;
3648 mainProgram = "rq" ;
3749 homepage = "https://github.com/dflemstr/rq" ;
38- license = with licenses ; [ asl20 ] ;
39- maintainers = with maintainers ; [
50+ license = with lib . licenses ; [ asl20 ] ;
51+ maintainers = with lib . maintainers ; [
4052 aristid
4153 Br1ght0ne
4254 figsoda
4355 ] ;
4456 } ;
45- }
57+ } )
0 commit comments