Files
Martin Vogel 2e055d771f
DCO / dco (push) Has been cancelled
chore: drop optional libgit2 dependency, keep git log fallback
libgit2 is licensed GPLv2-with-linking-exception, and this project is
deliberately GPL-free (see scripts/license-policy.json). libgit2 was only
an OPTIONAL, faster git-history code path guarded by HAVE_LIBGIT2 and
auto-detected via pkg-config; it always shipped with a popen("git log ...")
fallback that release binaries already used (they were built without
libgit2). Making that popen fallback the SOLE git-history implementation
means there is NO change to shipped behavior.

Changes:
- pass_githistory.c: collapse the HAVE_LIBGIT2 #ifdef so only the popen
  parse_git_log remains; drop the now-unused <git2.h>/<time.h> includes.
- cbm.c / cbm.h / main.c / subprocess.c / index_supervisor.h: remove the
  libgit2 mimalloc allocator bind and its >=1.7.0 version guards; keep the
  tree-sitter + sqlite3 binds; correct the comments.
- Makefile.cbm: remove the optional-libgit2 pkg-config detection block,
  the REQUIRE_LIBGIT2 error gate, and all LIBGIT2 CFLAGS/LIBS/FLAGS.
- .github/workflows/_test.yml: drop the REQUIRE_LIBGIT2 test-matrix leg
  plus its libgit2-dev/pkg-config apt install (lower CI cost, no new
  gating, no trigger change).
- flake.nix: drop libgit2/pkg-config from the dev shell (now-dead dep).

HAVE_LIBGIT2 no longer exists anywhere in the tree.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-07-05 00:37:59 +02:00

51 lines
1.7 KiB
Nix

{
description = "codebase-memory-mcp — C11 MCP server for codebase indexing";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
let
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
in
{
packages = forAllSystems (pkgs: {
default = pkgs.stdenv.mkDerivation {
pname = "codebase-memory-mcp";
version = "0.6.0";
src = ./.;
nativeBuildInputs = [ pkgs.gnumake ];
buildInputs = [ pkgs.zlib ];
# scripts/build.sh verifies the compiler via `file`, which fails on Nix
# because CC is a bash wrapper script rather than a binary. Call make
# directly to bypass that check; the Nix stdenv already guarantees the
# correct compiler and target architecture.
buildPhase = ''
make -j$NIX_BUILD_CORES -f Makefile.cbm cbm
'';
installPhase = ''
install -Dm755 build/c/codebase-memory-mcp $out/bin/codebase-memory-mcp
'';
meta = {
description = "MCP server that builds and queries a semantic graph of your codebase";
homepage = "https://github.com/DeusData/codebase-memory-mcp";
license = nixpkgs.lib.licenses.mit;
mainProgram = "codebase-memory-mcp";
platforms = systems;
};
};
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
inputsFrom = [ self.packages.${pkgs.system}.default ];
};
});
};
}