Files
logos-cpp-sdk/flake.nix
T
Dario LipicarandClaude Opus 4.8 1bc101df1f feat: cpp-generator consumes logos-lidl; delete embedded frontend (#89)
* feat: cpp-generator consumes logos-lidl; delete embedded frontend

The canonical LIDL frontend now lives in logos-lidl. cpp-generator links it
and keeps only the C++/Qt-specific parts (impl-header parsing, the gen_client/
gen_cdylib backends, the Qt type-name mapping).

- Delete the embedded lidl_lexer/parser/serializer/validator/ast.
- Add experimental/lidl_compat.h: brings logos-lidl's std AST into the global
  scope the backends use (via `using`), a qs() std::string→QString helper, a
  QTextStream<<std::string overload, and name-compatible shims (lidlParse/
  lidlSerialize/lidlValidate) so the emission code keeps compiling.
- Re-point impl_header_parser, lidl_gen_client (+ Doxygen /// docs on the
  generated client methods), lidl_gen_cdylib, lidl_emit_common, and legacy/
  main at lidl::ModuleDecl.
- CMake: C++17 + find_package(logos-lidl) + link logos-lidl::logos_lidl.
- bin.nix: distribute only the shared C++/Qt backend helpers (compat +
  impl_header_parser + emit_common) under share/lidl-frontend, not the frontend.
- tests: drop the 4 frontend test files (covered by logos-lidl now); the
  backend tests link logos-lidl.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: pin logos-lidl to the C-ABI commit + lock it

The logos-lidl input was declared in flake.nix but missing from flake.lock,
so override chains that don't reach the nested input (the doctest harness
building a scaffolded module) couldn't resolve it. Pin the branch rev and
lock it so the component is self-contained. Re-point at master once logos-lidl
lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: re-point logos-lidl to merged master (#5)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 21:00:42 -03:00

97 lines
3.6 KiB
Nix

{
description = "Logos C++ SDK";
inputs.logos-nix.url = "github:logos-co/logos-nix";
inputs.nixpkgs.follows = "logos-nix/nixpkgs";
# The protocol layer (transports, token exchange, lp_* C ABI). Follows our
# logos-nix so both repos resolve the identical nixpkgs/Qt pin — the QRO
# wire is Qt-version-sensitive.
inputs.logos-protocol.url = "github:logos-co/logos-protocol";
inputs.logos-protocol.inputs.logos-nix.follows = "logos-nix";
# The canonical, language-neutral LIDL frontend (lexer/parser/AST/serializer/
# validator) the code generator links. Follows our logos-nix so it resolves
# the identical nixpkgs pin.
inputs.logos-lidl.url = "github:logos-co/logos-lidl";
inputs.logos-lidl.inputs.logos-nix.follows = "logos-nix";
outputs = { self, nixpkgs, logos-nix, logos-protocol, logos-lidl }:
let
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
packages = forAllSystems ({ pkgs }:
let
# Common configuration
common = import ./nix/default.nix { inherit pkgs; };
src = ./.;
# Individual package components
bin = import ./nix/bin.nix { inherit pkgs common src logos-protocol; logos-lidl = logos-lidl.packages.${pkgs.system}.logos-lidl; };
lib = import ./nix/lib.nix { inherit pkgs common src logos-protocol; };
include = import ./nix/include.nix { inherit pkgs common src logos-protocol; };
tests = import ./nix/tests.nix { inherit pkgs common src logos-protocol; logos-lidl = logos-lidl.packages.${pkgs.system}.logos-lidl; };
# Combined SDK package. We re-declare propagatedBuildInputs on
# the join so downstream Nix derivations that depend on the
# combined `sdk` (rather than the nested `lib`) still inherit
# OpenSSL / Boost / nlohmann_json — symlinkJoin doesn't
# forward propagation from its `paths` attribute. Qt is
# excluded for the same setup-hook ordering reason as in
# `nix/lib.nix`; consumers must list qt6.qtbase +
# qt6.wrapQtAppsNoGuiHook themselves.
sdk = pkgs.symlinkJoin {
name = "logos-cpp-sdk";
paths = [ bin lib include ];
propagatedBuildInputs = common.propagatedBuildInputs;
};
in
{
# Individual outputs
logos-cpp-bin = bin;
logos-cpp-lib = lib;
logos-cpp-include = include;
inherit tests;
# Combined outputs (for backward compatibility)
logos-cpp-sdk = sdk;
cpp-generator = bin; # Alias for backward compatibility
# Default package
default = sdk;
}
);
checks = forAllSystems ({ pkgs }:
let
common = import ./nix/default.nix { inherit pkgs; };
src = ./.;
tests = import ./nix/tests.nix { inherit pkgs common src logos-protocol; logos-lidl = logos-lidl.packages.${pkgs.system}.logos-lidl; };
in
{
inherit tests;
}
);
devShells = forAllSystems ({ pkgs }: {
default = pkgs.mkShell {
nativeBuildInputs = [
pkgs.cmake
pkgs.ninja
pkgs.pkg-config
];
buildInputs = [
pkgs.qt6.qtbase
pkgs.qt6.qtremoteobjects
pkgs.gtest
pkgs.boost
pkgs.openssl
pkgs.nlohmann_json
];
};
});
};
}