Commit 30bdf7a7 authored by Sergei Trofimovich's avatar Sergei Trofimovich
Browse files

libdeltachat: do not use __FILE__ as a path to headers location



`-fmacro-prefix-map=` option can redirect path from the actual source
location to the unrelated path (`build-time` vs `debug-time`).

The change expands `__FILE__` in `deltachat.h` to the absolute location
to stop relying on `__FILE__` expansion.

The change fixes `python3.pkgs.deltachat` for me.

Co-authored-by: default avatarRobert Schütz <github@dotlambda.de>
Co-authored-by: default avatarSandro <sandro.jaeckel@gmail.com>
parent 1156cd9e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -70,6 +70,14 @@ in stdenv.mkDerivation rec {
    cargoCheckHook
  ];

  # Sometimes -fmacro-prefix-map= can redirect __FILE__ to non-existent
  # paths. This breaks packages like `python3.pkgs.deltachat`. We embed
  # absolute path to headers by expanding `__FILE__`.
  postInstall = ''
    substituteInPlace $out/include/deltachat.h \
      --replace __FILE__ '"${placeholder "out"}/include/deltachat.h"'
  '';

  passthru = {
    inherit cargoLock;
    tests = {