A patch needs to be come from a local file. Right now, there is no url option for it.
This will definitely not work. Flatpak Builder first loads and caches all sources, and then builds offline.
I’d say just provide the patch in the folder with your manifest. Its the simplest and best solution.
Also, on another note:
You set the prefix to /app/libdb in your configure. While Flatpak uses a special prefix for apps, it still follows the other Linux filesystem conventions, so binaries should go to /app/bin, libraries to /app/lib and data files under /app/share/libdb.
Its best you ensure this is the case after build. You can check this by looking at the filetree of the build folder after an successful build, as this shows anything the app will have in its /app prefix.
Right now I’m trying to solve (maybe) related issue, when the app get compiled successfully, but launching with this linking error: libboost_filesystem.so cannot open shared object file: No such file or directory