Trying to apply a patch to Darktable

Hi,
I’m trying to patch darktable like this.
in ~/nixos-cfg/nixos/delorean/default.nix:

    (
      let
        gtk3 = pkgs.gtk3.overrideAttrs (old: {
          patches = (old.patches or [ ]) ++ [
            (pkgs.fetchpatch {
              name = "fix-entry-completion";
              url = "https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2681.patch";
              hash = "sha256-PAg7jbdKFOSDCqZuyM/DOxsmF8d8LeoJxytaTkHhjpk=";
            })
          ];
        });

        wrapGAppsHook3 = pkgs.wrapGAppsHook3.override {
          inherit gtk3;
        };

        darktable = pkgs.darktable.overrideAttrs (old: {
          patches = (old.patches or [ ]) ++ [
            "./dt-fix-crash.patch"
          ];
        });
      in
      darktable.override {
        inherit gtk3 wrapGAppsHook3;
        withAi = true;
      }
    )

the patch file is in the same directory as default.nix

but

Using versionCheckHook
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/r179641gzf7ns16j3qb7nwvaw4fh9i4m-darktable-5.6.1.tar.xz
source root is darktable-5.6.1
setting SOURCE_DATE_EPOCH to timestamp 1787730418 of file "darktable-5.6.1/src/version_gen.c"
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
applying patch ./dt-fix-crash.patch
/nix/store/dp0zdsysxsli2xncj4prvhsik08qn697-stdenv-linux/setup: line 1412: ./dt-fix-crash.patch: No such file or directory

What am I missing?

You are not missing anything, but there is a pair of quotes too much. Instead of a string for the patchlocation, you have to use a path.

1 Like

Indeed! Thanks you very much!

Feel free to submit the patch in nixpkgs if you believe it is needed, it might help some other users.

Il should be in 5.8 (December release)