From 624e5a428cb0cedbd7aeffa7cc6a327f834d2d46 Mon Sep 17 00:00:00 2001 From: qrzbing Date: Fri, 15 May 2026 14:55:00 +0800 Subject: [PATCH] officecli: init at 1.0.92 --- pkgs/by-name/of/officecli/deps.json | 27 ++++++++++++++ pkgs/by-name/of/officecli/package.nix | 54 +++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 pkgs/by-name/of/officecli/deps.json create mode 100644 pkgs/by-name/of/officecli/package.nix diff --git a/pkgs/by-name/of/officecli/deps.json b/pkgs/by-name/of/officecli/deps.json new file mode 100644 index 000000000000..1aea7114d031 --- /dev/null +++ b/pkgs/by-name/of/officecli/deps.json @@ -0,0 +1,27 @@ +[ + { + "pname": "DocumentFormat.OpenXml", + "version": "3.4.1", + "hash": "sha256-kCsDhby6ZgVZKV43UHVZbiR1d/g6rD50C2IR4lnJPDk=" + }, + { + "pname": "DocumentFormat.OpenXml.Framework", + "version": "3.4.1", + "hash": "sha256-Qi4wz7WocNUpGqZIE6RIA0wgfbc981r6fHyz19Pn+5g=" + }, + { + "pname": "OpenMcdf", + "version": "3.1.3", + "hash": "sha256-pZvVso9+En4OjtTeb+GH+nWgjW4Kx7y1WddvWpDhSaM=" + }, + { + "pname": "System.CommandLine", + "version": "3.0.0-preview.2.26159.112", + "hash": "sha256-Al+rUmQ8/OAY1VszXMEqRpAKiTgspQjDwfaPmSI1ss4=" + }, + { + "pname": "System.IO.Packaging", + "version": "8.0.1", + "hash": "sha256-xf0BAfqQvITompBsvfpxiLts/6sRQEzdjNA3f/q/vY4=" + } +] diff --git a/pkgs/by-name/of/officecli/package.nix b/pkgs/by-name/of/officecli/package.nix new file mode 100644 index 000000000000..d81ddaeeafd3 --- /dev/null +++ b/pkgs/by-name/of/officecli/package.nix @@ -0,0 +1,54 @@ +{ + lib, + buildDotnetModule, + dotnetCorePackages, + fetchFromGitHub, + versionCheckHook, +}: + +buildDotnetModule (finalAttrs: { + pname = "officecli"; + version = "1.0.92"; + + strictDeps = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "iOfficeAI"; + repo = "OfficeCLI"; + tag = "v${finalAttrs.version}"; + hash = "sha256-g4eCgVqlW3N+pwATIsZbmjWNQ4IScUv9e40eUH9rfQw="; + }; + + projectFile = "src/officecli/officecli.csproj"; + nugetDeps = ./deps.json; + + dotnet-sdk = dotnetCorePackages.sdk_10_0; + dotnet-runtime = dotnetCorePackages.runtime_10_0; + + selfContainedBuild = true; + executables = [ "officecli" ]; + + makeWrapperArgs = [ + "--set" + "OFFICECLI_SKIP_UPDATE" + "1" + ]; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + meta = { + description = "Command-line tool for creating, reading and editing Office documents"; + homepage = "https://github.com/iOfficeAI/OfficeCLI"; + changelog = "https://github.com/iOfficeAI/OfficeCLI/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.asl20; + mainProgram = "officecli"; + maintainers = with lib.maintainers; [ qrzbing ]; + platforms = finalAttrs.dotnet-sdk.meta.platforms; + sourceProvenance = with lib.sourceTypes; [ + fromSource + binaryBytecode + ]; + }; +})