From 6a18ba06d5824d4fb1fea997ff9682ff0c713bfc Mon Sep 17 00:00:00 2001 From: Stu Black Date: Sun, 23 Nov 2025 15:55:27 -0500 Subject: [PATCH] Fix build order issues by moving wings-rs/ into WINGs/. Having wings-rs depend on WINGs/WINGs/WINGsP.h was not working very well if all of WINGs/ had to be built before wings-rs/. Moving wings-rs/ into WINGs/ addresses this. --- .gitignore | 2 +- Makefile.am | 2 +- WINGs/Makefile.am | 2 +- {wings-rs => WINGs/wings-rs}/Cargo.toml | 5 +++- WINGs/wings-rs/Makefile.am | 25 ++++++++++++++++++++ {wings-rs => WINGs/wings-rs}/patch_WINGsP.sh | 2 +- {wings-rs => WINGs/wings-rs}/src/lib.rs | 1 - configure.ac | 5 +--- wings-rs/Makefile.am | 25 -------------------- 9 files changed, 34 insertions(+), 35 deletions(-) rename {wings-rs => WINGs/wings-rs}/Cargo.toml (54%) create mode 100644 WINGs/wings-rs/Makefile.am rename {wings-rs => WINGs/wings-rs}/patch_WINGsP.sh (93%) rename {wings-rs => WINGs/wings-rs}/src/lib.rs (99%) delete mode 100644 wings-rs/Makefile.am diff --git a/.gitignore b/.gitignore index 1197043f..3de3fa75 100644 --- a/.gitignore +++ b/.gitignore @@ -143,4 +143,4 @@ WPrefs.app/WPrefs.desktop # Rust stuff. /**/target/** -wings-rs/src/WINGsP.rs +WINGs/wings-rs/src/WINGsP.rs diff --git a/Makefile.am b/Makefile.am index 2cd2a5fd..0a50bf18 100644 --- a/Makefile.am +++ b/Makefile.am @@ -39,7 +39,7 @@ ACLOCAL_AMFLAGS = -I m4 AM_DISTCHECK_CONFIGURE_FLAGS = --enable-silent-rules LINGUAS='*' -SUBDIRS = wrlib wutil-rs WINGs wings-rs wmaker-rs src util po WindowMaker wmlib WPrefs.app doc +SUBDIRS = wrlib wutil-rs WINGs wmaker-rs src util po WindowMaker wmlib WPrefs.app doc DIST_SUBDIRS = $(SUBDIRS) test EXTRA_DIST = TODO BUGS BUGFORM FAQ INSTALL \ diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am index 82ea4514..d6ac116d 100644 --- a/WINGs/Makefile.am +++ b/WINGs/Makefile.am @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = -SUBDIRS = WINGs . po Documentation Resources +SUBDIRS = WINGs wings-rs . po Documentation Resources DIST_SUBDIRS = $(SUBDIRS) Tests Examples Extras libWINGs_la_LDFLAGS = -version-info @WINGS_VERSION@ diff --git a/wings-rs/Cargo.toml b/WINGs/wings-rs/Cargo.toml similarity index 54% rename from wings-rs/Cargo.toml rename to WINGs/wings-rs/Cargo.toml index c7807c62..689a9201 100644 --- a/wings-rs/Cargo.toml +++ b/WINGs/wings-rs/Cargo.toml @@ -7,5 +7,8 @@ edition = "2024" crate-type = ["staticlib"] [dependencies] -wutil-rs = { path = "../wutil-rs" } +libc = "0.2.177" +pango-sys = "0.21.2" +wutil-rs = { path = "../../wutil-rs" } x11 = "2.21.0" +yeslogic-fontconfig-sys = "6.0" diff --git a/WINGs/wings-rs/Makefile.am b/WINGs/wings-rs/Makefile.am new file mode 100644 index 00000000..1e97c269 --- /dev/null +++ b/WINGs/wings-rs/Makefile.am @@ -0,0 +1,25 @@ +AUTOMAKE_OPTIONS = + +RUST_SOURCES = \ + src/font.rs \ + src/lib.rs \ + src/WINGsP.rs + +RUST_EXTRA = \ + Cargo.lock \ + Cargo.toml + +src/WINGsP.rs: ../WINGs/WINGsP.h ../../wrlib/wraster.h ../WINGs/WINGs.h ../WINGs/WUtil.h Makefile patch_WINGsP.sh + $(BINDGEN) ../WINGs/WINGsP.h --ignore-functions --allowlist-type "^W_.+|^WM(View|Array|DragOperationType|Point|Data|OpenPanel|SavePanel|HashTable|DraggingInfo|SelectionProcs|Rect|EventProc|Widget|Size|Color|Pixmap|FilePanel)|R(Context|ContextAttributes|Image|RenderingMode|ScalingFilter|StdColormapMode|ImageFormat|Color)|_WINGsConfiguration" --no-recursive-allowlist -o src/WINGsP.rs -- @PANGO_CFLAGS@ -I../../wrlib -I.. && ./patch_WINGsP.sh src/WINGsP.rs + +target/debug/libwings_rs.a: $(RUST_SOURCES) $(RUST_EXTRA) + $(CARGO) build + +check-local: + $(CARGO) test + +clean-local: + $(CARGO) clean + rm -f src/WINGsP.rs + +all: target/debug/libwings_rs.a diff --git a/wings-rs/patch_WINGsP.sh b/WINGs/wings-rs/patch_WINGsP.sh similarity index 93% rename from wings-rs/patch_WINGsP.sh rename to WINGs/wings-rs/patch_WINGsP.sh index 39911615..c9cdce2c 100755 --- a/wings-rs/patch_WINGsP.sh +++ b/WINGs/wings-rs/patch_WINGsP.sh @@ -15,7 +15,7 @@ fi FILE="$1" exec sed -i -r \ - -e "1s/^/use x11::xlib::*;\n\n/" \ + -e "1s/^/use x11::xlib::*;/" \ -e "s/_XftDraw/::std::ffi::c_void/g" \ -e "s/_XftFont/::std::ffi::c_void/g" \ -e "s/PangoLayout/::std::ffi::c_void/g" \ diff --git a/wings-rs/src/lib.rs b/WINGs/wings-rs/src/lib.rs similarity index 99% rename from wings-rs/src/lib.rs rename to WINGs/wings-rs/src/lib.rs index 146931ed..b90acba5 100644 --- a/wings-rs/src/lib.rs +++ b/WINGs/wings-rs/src/lib.rs @@ -1,5 +1,4 @@ #[allow(non_camel_case_types)] #[allow(non_snake_case)] #[allow(non_upper_case_globals)] - pub mod WINGsP; diff --git a/configure.ac b/configure.ac index cfdebb56..898b71ad 100644 --- a/configure.ac +++ b/configure.ac @@ -966,13 +966,10 @@ AC_CONFIG_FILES( wutil-rs/Makefile dnl WINGs toolkit - WINGs/Makefile WINGs/WINGs/Makefile WINGs/po/Makefile + WINGs/Makefile WINGs/wings-rs/Makefile WINGs/WINGs/Makefile WINGs/po/Makefile WINGs/Documentation/Makefile WINGs/Resources/Makefile WINGs/Extras/Makefile WINGs/Examples/Makefile WINGs/Tests/Makefile - dnl Rust implementation of WINGs libraries - wings-rs/Makefile - dnl Rust implementation of Window Maker core wmaker-rs/Makefile diff --git a/wings-rs/Makefile.am b/wings-rs/Makefile.am deleted file mode 100644 index f69c85fd..00000000 --- a/wings-rs/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -AUTOMAKE_OPTIONS = - -RUST_SOURCES = \ - src/font.rs \ - src/lib.rs \ - src/WINGsP.rs - -RUST_EXTRA = \ - Cargo.lock \ - Cargo.toml - -src/WINGsP.rs: ../WINGs/WINGs/WINGsP.h ../wrlib/wraster.h ../WINGs/WINGs/WINGs.h ../WINGs/WINGs/WUtil.h Makefile patch_WINGsP.sh - $(BINDGEN) ../WINGs/WINGs/WINGsP.h --ignore-functions --allowlist-type "^W_.+|^WM(View|Array|DragOperationType|Point|Data|OpenPanel|SavePanel|HashTable|DraggingInfo|SelectionProcs|Rect|EventProc|Widget|Size|Color|Pixmap|FilePanel)|R(Context|ContextAttributes|Image|RenderingMode|ScalingFilter|StdColormapMode|ImageFormat|Color)|_WINGsConfiguration" --no-recursive-allowlist -o src/WINGsP.rs -- @PANGO_CFLAGS@ -I../wrlib -I../WINGs && ./patch_WINGsP.sh src/WINGsP.rs - -target/debug/libwings_rs.a: $(RUST_SOURCES) $(RUST_EXTRA) - $(CARGO) build - -check-local: - $(CARGO) test - -clean-local: - $(CARGO) clean - rm -f src/WINGsP.rs - -all: target/debug/libwings_rs.a