This repository has been archived on 2025-10-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
bscpkgs/pkgs/aocc/default.nix
2025-06-19 22:16:04 +02:00

30 lines
699 B
Nix

{ lib
, aoccUnwrapped
, wrapCCWith
}:
let
cc = aoccUnwrapped;
stdenv = aoccUnwrapped.stdenv;
targetConfig = stdenv.targetPlatform.config;
gcc = stdenv.cc;
in wrapCCWith {
inherit cc;
extraBuildCommands = ''
echo "-isystem ${cc}/include" >> $out/nix-support/cc-cflags
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
echo "-L${cc}/lib" >> $out/nix-support/cc-ldflags
# Need the gcc in the path
echo 'export "PATH=${gcc}/bin:$PATH"' >> $out/nix-support/cc-wrapper-hook
# Disable hardening by default
echo "" > $out/nix-support/add-hardening.sh
'';
}