From d4e0f0ad5498e27a44e1305baa423d76240e0e4a Mon Sep 17 00:00:00 2001 From: Antoine 'toinux' Wam Date: Tue, 31 Dec 2024 16:03:15 +0100 Subject: [PATCH 1/2] nixel: Add UpdateScript --- pkgs/by-name/ni/nixel/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/ni/nixel/package.nix b/pkgs/by-name/ni/nixel/package.nix index fcbfbb5b98d014..7a99a8ec3ac19f 100644 --- a/pkgs/by-name/ni/nixel/package.nix +++ b/pkgs/by-name/ni/nixel/package.nix @@ -2,6 +2,7 @@ lib, rustPlatform, fetchFromGitHub, + nix-update-script, testers, nixel, }: @@ -27,6 +28,7 @@ rustPlatform.buildRustPackage rec { passthru.tests = { version = testers.testVersion { package = nixel; }; }; + passthru.updateScript = nix-update-script { }; meta = with lib; { description = "Lexer, Parser, Abstract Syntax Tree and Concrete Syntax Tree for the Nix Expressions Language"; From bdd148d1207c1641bd44e978d3d008a77616a447 Mon Sep 17 00:00:00 2001 From: Antoine 'toinux' Wam Date: Sun, 29 Dec 2024 14:18:29 +0100 Subject: [PATCH 2/2] nixel: 4.1.0 -> 5.1.1 + Fix rust crate::ffi bindgen error w/ clang 18&19 by downgrading to 16 --- pkgs/by-name/ni/nixel/package.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/ni/nixel/package.nix b/pkgs/by-name/ni/nixel/package.nix index 7a99a8ec3ac19f..311b7c5e770e6d 100644 --- a/pkgs/by-name/ni/nixel/package.nix +++ b/pkgs/by-name/ni/nixel/package.nix @@ -3,22 +3,33 @@ rustPlatform, fetchFromGitHub, nix-update-script, + clang_16, testers, nixel, }: - -rustPlatform.buildRustPackage rec { +let + clang = clang_16; # Until bindgen is updated with clang19 support + rustPlatform' = rustPlatform // { + bindgenHook = rustPlatform.bindgenHook.override { inherit clang; }; + }; +in +rustPlatform'.buildRustPackage rec { pname = "nixel"; - version = "4.1.0"; + version = "5.1.1"; src = fetchFromGitHub { owner = "kamadorueda"; repo = pname; rev = version; - sha256 = "sha256-dQ3wzBTjteqk9rju+FMAO+ydimnGu24Y2DEDLX/P+1A="; + sha256 = "sha256-wIXZd8iujLqbgbV+abWmIfjDgQ8i6nyE5jTAs3OczXM="; }; - cargoHash = "sha256-1OsHs0W3ji9Kgpv7nGY9XyGxJ4c0faN2VuFLsdwkgKY="; + cargoHash = "sha256-GJ2UO8MvujRxFjzdt2Tfrlfzv1jot9XCrmfBqTFVngI="; + + nativeBuildInputs = [ + # Workaround borrowed here where the same error were observed: https://github.com/NixOS/nixpkgs/issues/331240#issuecomment-2260565324 + rustPlatform'.bindgenHook # with override { clang = clang_16; } + ]; # Package requires a non reproducible submodule # https://github.com/kamadorueda/nixel/blob/2873bd84bf4fc540d0ae8af062e109cc9ad40454/.gitmodules#L7