From 3f39e0094dfadabb3cd1ad627482ce69b2fd489d Mon Sep 17 00:00:00 2001 From: Stu Black Date: Fri, 1 Nov 2024 00:31:15 -0400 Subject: [PATCH] Add missing files to WINGs build and name external repos with headers differently. --- bazel/WINGs/BUILD.bazel | 42 +++++++++++++++++++++++++-------- bazel/WINGs/error.c | 4 ++-- bazel/WINGs/hashtable.c | 4 ++-- bazel/WINGs/menuparser.c | 4 ++-- bazel/WINGs/menuparser_macros.c | 2 +- bazel/WINGs/misc.c | 2 +- bazel/WINGs/proplist.c | 4 ++-- bazel/WINGs/userdefaults.c | 2 +- bazel/WINGs/wapplication.c | 2 +- bazel/WINGs/wconfig.h | 2 ++ bazel/WORKSPACE | 10 ++++---- 11 files changed, 51 insertions(+), 27 deletions(-) diff --git a/bazel/WINGs/BUILD.bazel b/bazel/WINGs/BUILD.bazel index d82f20e4..992e6a2c 100644 --- a/bazel/WINGs/BUILD.bazel +++ b/bazel/WINGs/BUILD.bazel @@ -4,20 +4,39 @@ cc_library( # TODO: These include paths must be kept in sync with the local # repository definitions in WORKSPACE. It would be better to find them # with pkg-config or discover them in some other automated way. - "-Iexternal/glib", - "-Iexternal/pango", - "-Iexternal/glib_config", - "-Iexternal/harfbuzz", - "-Iexternal/freetype2", + "-Iexternal/glib_h", + "-Iexternal/pango_h", + "-Iexternal/glib_config_h", + "-Iexternal/harfbuzz_h", + "-Iexternal/freetype2_h", "-DRESOURCE_PATH=\\\"Resources\\\"", + "-D_GNU_SOURCE", ], data = glob(['Resources/*']), srcs = [ + "array.c", + "bagtree.c", "configuration.c", + "data.c", "dragcommon.c", "dragdestination.c", "dragsource.c", + "error.c", + "findfile.c", + "handlers.c", + "hashtable.c", + "memory.c", + "menuparser.c", + "menuparser_macros.c", + "misc.c", + "notification.c", + "proplist.c", "selection.c", + "string.c", + "tree.c", + "userdefaults.c", + "usleep.c", + "wapplication.c", "wappresource.c", "wballoon.c", "wbox.c", @@ -53,6 +72,8 @@ cc_library( "wwindow.c", ], hdrs = [ + "menuparser.h", + "userdefaults.h", "rgb.h", "wconfig.h", "WINGs.h", @@ -63,10 +84,11 @@ cc_library( "//config", "//wmaker:gnustep_compat", "//wrlib", - "@freetype2//:headers", - "@glib//:headers", - "@glib_config//:headers", - "@harfbuzz//:headers", - "@pango//:headers", + "@freetype2_h//:headers", + "@glib_h//:headers", + "@glib_config_h//:headers", + "@harfbuzz_h//:headers", + "@pango_h//:headers", ], + visibility = ["//visibility:public"], ) diff --git a/bazel/WINGs/error.c b/bazel/WINGs/error.c index 739fa5e7..20d8509a 100644 --- a/bazel/WINGs/error.c +++ b/bazel/WINGs/error.c @@ -27,8 +27,8 @@ #include #include -#include -#include +#include "WINGs/WUtil.h" +#include "WINGs/WINGsP.h" #ifdef HAVE_SYSLOG_H #include diff --git a/bazel/WINGs/hashtable.c b/bazel/WINGs/hashtable.c index 2620c784..dedd5123 100644 --- a/bazel/WINGs/hashtable.c +++ b/bazel/WINGs/hashtable.c @@ -1,11 +1,11 @@ -#include +#include "config/config.h" #include #include #include #include -#include "WUtil.h" +#include "WINGs/WUtil.h" #define INITIAL_CAPACITY 23 diff --git a/bazel/WINGs/menuparser.c b/bazel/WINGs/menuparser.c index 6d8411cc..62add6a0 100644 --- a/bazel/WINGs/menuparser.c +++ b/bazel/WINGs/menuparser.c @@ -24,9 +24,9 @@ #include #include -#include +#include "WINGs/WUtil.h" -#include "menuparser.h" +#include "WINGs/menuparser.h" static WMenuParser menu_parser_create_new(const char *file_name, void *file, const char *include_default_paths); diff --git a/bazel/WINGs/menuparser_macros.c b/bazel/WINGs/menuparser_macros.c index 8c12f2de..96440559 100644 --- a/bazel/WINGs/menuparser_macros.c +++ b/bazel/WINGs/menuparser_macros.c @@ -26,7 +26,7 @@ #include #include -#include +#include "WINGs/WUtil.h" #include "menuparser.h" diff --git a/bazel/WINGs/misc.c b/bazel/WINGs/misc.c index 76cf1f59..ce5369dc 100644 --- a/bazel/WINGs/misc.c +++ b/bazel/WINGs/misc.c @@ -20,7 +20,7 @@ /* Miscelaneous helper functions */ -#include +#include "WINGs/WUtil.h" #include "error.h" diff --git a/bazel/WINGs/proplist.c b/bazel/WINGs/proplist.c index e7a764df..77a9dcfe 100644 --- a/bazel/WINGs/proplist.c +++ b/bazel/WINGs/proplist.c @@ -12,8 +12,8 @@ #include #include -#include "WUtil.h" -#include "wconfig.h" +#include "WINGs/WUtil.h" +#include "WINGs/wconfig.h" typedef enum { WPLString = 0x57504c01, diff --git a/bazel/WINGs/userdefaults.c b/bazel/WINGs/userdefaults.c index c830642d..930dd979 100644 --- a/bazel/WINGs/userdefaults.c +++ b/bazel/WINGs/userdefaults.c @@ -11,7 +11,7 @@ #include "WINGs/WINGs.h" #include "WINGs/WINGsP.h" -#include "WINGs/userdefaults.h" +#include "userdefaults.h" typedef struct W_UserDefaults { diff --git a/bazel/WINGs/wapplication.c b/bazel/WINGs/wapplication.c index ea2e1b57..31984719 100644 --- a/bazel/WINGs/wapplication.c +++ b/bazel/WINGs/wapplication.c @@ -4,7 +4,7 @@ #include "WINGs/WINGsP.h" #include "WINGs/wconfig.h" -#include "WINGs/userdefaults.h" +#include "userdefaults.h" struct W_Application WMApplication; diff --git a/bazel/WINGs/wconfig.h b/bazel/WINGs/wconfig.h index afff5a33..d62c220d 100644 --- a/bazel/WINGs/wconfig.h +++ b/bazel/WINGs/wconfig.h @@ -22,6 +22,8 @@ #include "config/config.h" +#include + #if defined(HAVE_LIBINTL_H) && defined(I18N) # include # define _(text) dgettext("WINGs", text) diff --git a/bazel/WORKSPACE b/bazel/WORKSPACE index b53e07ce..cc5bc9e5 100644 --- a/bazel/WORKSPACE +++ b/bazel/WORKSPACE @@ -4,7 +4,7 @@ # them more easily configurable). new_local_repository( - name = "pango", + name = "pango_h", path = "/usr/include/pango-1.0", build_file_content = """ package(default_visibility = ["//visibility:public"]) @@ -16,7 +16,7 @@ cc_library( ) new_local_repository( - name = "glib", + name = "glib_h", path = "/usr/include/glib-2.0", build_file_content = """ package(default_visibility = ["//visibility:public"]) @@ -28,7 +28,7 @@ cc_library( ) new_local_repository( - name = "glib_config", + name = "glib_config_h", path = "/usr/lib/x86_64-linux-gnu/glib-2.0/include", build_file_content = """ package(default_visibility = ["//visibility:public"]) @@ -40,7 +40,7 @@ cc_library( ) new_local_repository( - name = "harfbuzz", + name = "harfbuzz_h", path = "/usr/include/harfbuzz", build_file_content = """ package(default_visibility = ["//visibility:public"]) @@ -52,7 +52,7 @@ cc_library( ) new_local_repository( - name = "freetype2", + name = "freetype2_h", path = "/usr/include/freetype2", build_file_content = """ package(default_visibility = ["//visibility:public"])