add struct2json

This commit is contained in:
Rongsong Shen 2025-12-05 17:12:02 +08:00
parent 3bc72b826a
commit e634e6222e
3 changed files with 44 additions and 3 deletions

View file

@ -71,6 +71,9 @@ let
pkgs = pkgs; pkgs = pkgs;
}; };
cetcd = callPackage ./pkgs/c/cetcd/package.nix {}; cetcd = callPackage ./pkgs/c/cetcd/package.nix {};
struct2json = callPackage ./pkgs/s/struct2json/package.nix {
pkgs = pkgs;
};
in in
{ {
xbuild = xbuild; xbuild = xbuild;
@ -83,4 +86,5 @@ in
cetcd = cetcd; cetcd = cetcd;
libcello_debug = libcello_debug; libcello_debug = libcello_debug;
packcc = packcc_main; packcc = packcc_main;
struct2json = struct2json;
} }

6
flake.lock generated
View file

@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1762111121, "lastModified": 1764667669,
"narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=", "narHash": "sha256-7WUCZfmqLAssbDqwg9cUDAXrSoXN79eEEq17qhTNM/Y=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4", "rev": "418468ac9527e799809c900eda37cbff999199b6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -0,0 +1,37 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkgs,
}:
let
meta = with lib; {
description = "convert c struct to json";
homepage = "https://github.com/armink/struct2json";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
pname = "struct2json";
version = "1.0.0";
in
stdenv.mkDerivation (finalAttrs: {
pname = pname;
version = version;
src = fetchFromGitHub {
owner = "shen390s";
repo = "struct2json";
rev = "master";
hash = "sha256-2J3JFrUc0FSX5U+vmyc5Ccmb7ONqiRprZj+QoRtwius=";
};
nativeBuildInputs = [
pkgs.meson
pkgs.ninja
pkgs.pkgconf
];
inherit meta;
})