diff --git a/nix/overlay.nix b/nix/overlay.nix --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -10,6 +10,32 @@ prev: { + # Patch aws-sdk-cpp to automatically pick up header location + # specific to nixpkgs, as nixpkgs separates build-time and runtime + # depencenies (a saving of 400MB in header + generated files). + # In the case of c and c++, this means the header files are + # located in a separate directory from the libraries. + # + # From a developer perspective, this avoids having to manually specify + # the header location with `-DAWS_CORE_HEADER_FILE` each time + # one invokes `cmake` on the command line when using + # `find_package(AWSSDK COMPONENTS [comps])` + # + # For more information, see: + # - aws-sdk-cpp issue: https://github.com/aws/aws-sdk-cpp/issues/2009 + # - Nixpkgs fix: https://github.com/NixOS/nixpkgs/pull/182918 + aws-sdk-cpp = (prev.aws-sdk-cpp.overrideAttrs(oldAttrs:{ + postPatch = oldAttrs.postPatch + '' + substituteInPlace cmake/AWSSDKConfig.cmake \ + --replace 'C:/AWSSDK/''${AWSSDK_INSTALL_INCLUDEDIR}/aws/core' \ + 'C:/AWSSDK/''${AWSSDK_INSTALL_INCLUDEDIR}/aws/core" + "${placeholder "dev"}/include/aws/core' + ''; + })).override { + # avoid rebuildilng all 300+ apis + apis = [ "core" "s3" "dynamodb" ]; + }; + # add packages meant for just this repository amqp-cpp = prev.callPackage ./amqp-cpp.nix { };