It might be related to an issue with python 3.11 - see if this fixes it (replace the line containing # include <eval.h> with the following:
// Python headers needed for PyEval_EvalCode.
//
// Use ceval.h instead of eval.h with Pyhthon 3.11 and greater
#if PY_VERSION_HEX > 0x030B0000
# include <ceval.h>
#else
# include <eval.h>
#endif
I will apply your suggested work around on copy of source code cloned on my Pi. However changes in Flightaware source code at github should be done by Flightaware programmers/software developers, otherwise everyone trying to build piaware from source code will face this issue.
Alternatively the Python team at Debian should remove this bug from Python 3.11
It appears the issue of eval.h being deprecated was reported for a Debian 12 build here
As @abcd567 has found out, it also bites those who are using python 3.11 and newer to build piaware from scratch on Debian 11 as well.
Borrowing a finding from elsewhere (below), @obj or other Flightaware development staff might use this information for test if the above workaround makes sense for general release. I am too far removed from the programming world to remember how to submit a pull request, unfortunately.
The non-limited API files cellobject.h, classobject.h, code.h, context.h, funcobject.h, genobject.h and longintrepr.h have been moved to the Include/cpython directory. Moreover, the eval.h header file was removed. These files must not be included directly, as they are already included in Python.h: Include Files . If they have been included directly, consider including Python.h instead. (Contributed by Victor Stinner in bpo-35134.)
The original error “fatal error: eval.h: No such file or directory” disappeared.
Got following new error: make: *** [debian/rules:104: binary] Error 2 dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2