rozniak / xfce-winxp-tc

Windows XP stuff for XFCE
Other
1.11k stars 37 forks source link

AUR broken - buildall -z switch broken since library header changes #280

Closed rozniak closed 8 months ago

rozniak commented 8 months ago

I think I may have accidentally broken the buildall.sh -z switch during my work on the library header stuff in 65d041ec1c724991e67ab71e72784ed333029927

Part of the changes were to tidy up the public headers, because the way I was doing them was crap: copying all public APIs from the source code headers, into an accompanying public/wintc-XXX.h file.

That was undesirable due to the copy paste nature of it, and also because #include "wintc-comgtk.h" is unlike any other lib on the system. My changes were aimed at moving all public APIs into public/ (which would make sense), and then at install-time to put them in the right place such that for this file tree:

public/
  _api.h
  thing.h
  another.h

Would get deployed as:

<include root>/
  wintc/
    someapi.h
    someapi/
      thing.h
      another.h

The only issue with this is that due to the file tree in the source not matching the file tree after install, when the project is compiled with -DWINTC_USE_LOCAL_LIBS=1, programs that use <wintc/comgtk.h> will be unable to find the header because it doesn't actually exist in the source.

My workaround was (as a bodge really), to have wintc_resolve_library look in the build/packaging output of the libraries for the header. Kind of crappy, but it did work... unless you build with the -z switch to skip the packaging step, which obviously means the package output will not be present and the lookup will fail.

The AUR uses the -z switch to build the project, so it is currently broken due to this issue. Basically need some reliable way of generating these headers in a way that works nicely when installed AND during build-time.

rozniak commented 8 months ago

A potential solution may perhaps be to use configure_file() to provide the aggregate header.

Something like having a file, api.h.in , with the contents:

#ifndef __WINTC_MYAPI_H__
#define __WINTC_MYAPI_H__

#include "@LIB_HEADER_DIR@/another.h"
#include "@LIB_HEADER_DIR@/thing.h"

#endif

In the CMake we could configure_file() twice - once with LIB_HEADER_DIR set to the expected subdir for the installed version ("myapi") and again using the current dir for local libs build (".")

I will have to look into it this evening, this issue is quite urgent considering the AUR build is broken.

rozniak commented 8 months ago

Have applied the above - currently testing that this does not cause any regressions before merging.