From 64458acde2a88bfda21e61d67aefe080af9a57b1 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Sun, 25 Jan 2026 01:26:23 +0300 Subject: [PATCH] packaging: Fix static builds with S3 support, enable by default aws-crt-cpp doesn't provide pkg-config files and has a bunch of transitive deps, so switch to cmake for resolving the dependency. --- src/libstore/meson.build | 11 ++++++----- src/libstore/package.nix | 6 ++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libstore/meson.build b/src/libstore/meson.build index 2dc70a0b0..a01aa903a 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -158,14 +158,15 @@ sqlite = dependency('sqlite3', 'sqlite', version : '>=3.6.19') deps_private += sqlite s3_aws_auth = get_option('s3-aws-auth') -aws_crt_cpp = cxx.find_library('aws-crt-cpp', required : s3_aws_auth) +aws_crt_cpp = dependency( + 'aws-crt-cpp', + required : s3_aws_auth, + method : 'cmake', + modules : [ 'AWS::aws-crt-cpp' ], +) if s3_aws_auth.enabled() deps_other += aws_crt_cpp - aws_c_common = cxx.find_library('aws-c-common', required : true) - deps_other += aws_c_common - aws_c_auth = cxx.find_library('aws-c-auth', required : true) - deps_other += aws_c_auth endif configdata_pub.set('NIX_WITH_AWS_AUTH', s3_aws_auth.enabled().to_int()) diff --git a/src/libstore/package.nix b/src/libstore/package.nix index 968c4e3eb..1f7b56f22 100644 --- a/src/libstore/package.nix +++ b/src/libstore/package.nix @@ -14,6 +14,7 @@ libseccomp, nlohmann_json, sqlite, + cmake, # for resolving aws-crt-cpp dep busybox-sandbox-shell ? null, @@ -25,7 +26,7 @@ withAWS ? # Default is this way because there have been issues building this dependency - lib.meta.availableOn stdenv.hostPlatform aws-c-common, + (lib.meta.availableOn stdenv.hostPlatform aws-c-common), }: let @@ -57,7 +58,8 @@ mkMesonLibrary (finalAttrs: { (fileset.fileFilter (file: file.hasExt "sql") ./.) ]; - nativeBuildInputs = lib.optional embeddedSandboxShell unixtools.hexdump; + nativeBuildInputs = + lib.optional withAWS cmake ++ lib.optional embeddedSandboxShell unixtools.hexdump; buildInputs = [ boost