release: restore ZUPT and harden source-only 5.2.2

This commit is contained in:
Cristian Cezar Moisés 2026-08-31 14:14:36 -03:00
commit ff99770bd0
205 changed files with 19627 additions and 13215 deletions

View file

@ -1,25 +1,22 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Nix flake for zupt.
# Nix flake for ZUPT.
#
# Usage (with flakes enabled):
# nix build .#zupt # build the package
# nix run .#zupt -- version # run zupt directly
# nix run .#zupt -- --version # run ZUPT directly
# nix develop # drop into a dev shell
# nix flake check # lint the flake
#
# To consume from another flake:
# inputs.zupt.url = "git+https://git.securityops.co/cristiancmoises/zupt?ref=v2.4.4";
# inputs.zupt.url = "github:cristiancmoises/zupt/v5.2.2";
# ...packages.x86_64-linux.default = inputs.zupt.packages.x86_64-linux.zupt;
#
# Reproducibility:
# * Nix already pins the source tree by hash.
# * `make dist` is also reproducible (tests/test_dist_reproducible.sh).
# * Together, two independent Nix evaluations of the same flake.lock
# produce byte-identical /nix/store outputs.
# `make dist` has its own reproducibility gate. This development flake has no
# committed lock file and therefore makes no independent locked-output claim.
{
description = "Zupt post-quantum backup compression utility (C11)";
description = "ZUPT post-quantum backup compression utility (C11)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
@ -27,22 +24,25 @@
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs { inherit system; };
zupt = pkgs.stdenv.mkDerivation {
pname = "vaptvupt";
version = "5.0.0";
pname = "zupt";
version = "5.2.2";
# When publishing, replace this with `fetchurl` against the
# release tarball. For local development the flake assumes it
# lives in the same directory as the source.
src = ./.;
src = builtins.path { path = ../..; name = "zupt-source"; };
nativeBuildInputs = with pkgs; [
gcc
git
gnumake
file
gnutar
];
# python3 is only used by the regression-test harness.
@ -55,7 +55,7 @@
# Source-only build (WITH_SDK=0): native crypto, no vendored libraries.
buildPhase = ''
runHook preBuild
make WITH_SDK=0 -j$NIX_BUILD_CORES
make WITH_SDK=0 WITH_PQBOX=0 -j$NIX_BUILD_CORES
runHook postBuild
'';
@ -63,27 +63,30 @@
doCheck = true;
checkPhase = ''
runHook preCheck
make WITH_SDK=0 check
make WITH_SDK=0 WITH_PQBOX=0 check
runHook postCheck
'';
installPhase = ''
runHook preInstall
make DESTDIR=$out PREFIX= WITH_SDK=0 install
make PREFIX=$out WITH_SDK=0 WITH_PQBOX=0 \
INSTALL_LEGACY_ALIAS=0 install
# Docs
mkdir -p $out/share/doc/vaptvupt
cp README.md SECURITY.md CHANGELOG.md $out/share/doc/vaptvupt/
mkdir -p $out/share/doc/zupt
cp README.md SECURITY.md CHANGELOG.md $out/share/doc/zupt/
test -f $out/share/licenses/zupt/LICENSE-BSD-3-Clause
test -f $out/share/licenses/zupt/LICENSE-CC0-1.0
runHook postInstall
'';
meta = with pkgs.lib; {
description = "Post-quantum backup compression utility (ML-KEM-768 + X25519 + AES-256-CTR + HMAC-SHA256)";
homepage = "https://git.securityops.co/cristiancmoises/vaptvupt";
license = with licenses; [ agpl3Plus gpl3Plus ];
homepage = "https://github.com/cristiancmoises/zupt";
license = with licenses; [ agpl3Plus gpl3Plus bsd2 bsd3 cc0 ];
maintainers = [ ];
platforms = [ "x86_64-linux" "aarch64-linux" ];
mainProgram = "vaptvupt";
platforms = [ "x86_64-linux" ];
mainProgram = "zupt";
};
};
in {