1
0
mirror of https://github.com/skeeto/w64devkit.git synced 2026-10-23 06:08:56 +03:00

Copy only ncurses headers needed, not entire /deps/include/

Copying the entire /deps/include/ from build-ncurses was overwriting
cross-compiler headers already present in build-gdb/build-cmake.
Only copy what ncurses actually adds: curses.h and the ncursesw/ subdir.

Also restore --enable-tui and -DNCURSES_STATIC flags.

https://claude.ai/code/session_01NJhZXUW8C4GZsWZ945zs9j
This commit is contained in:
Claude
2026-03-18 13:02:16 +00:00
parent 1c8db8aab5
commit 6ce2de500e
2 changed files with 11 additions and 14 deletions

View File

@@ -510,12 +510,8 @@ RUN /dl/ncurses/configure \
FROM cross AS build-gdb
COPY --from=dl-gdb /dl/ /dl/
COPY --from=build-ncurses /deps/lib/libcurses.a /deps/lib/
COPY --from=build-ncurses /deps/include/ /deps/include/
# Verify ncurses static linking works before spending 17min on GDB
RUN printf '#include <ncursesw/ncurses.h>\n#include <ncursesw/panel.h>\nint main(void){WINDOW*w=newwin(1,1,0,0);new_panel(w);return 0;}\n' \
| $ARCH-gcc -x c - -DNCURSES_STATIC -I/deps/include -L/deps/lib -lcurses -o /tmp/nctest \
&& echo "ncurses sanity check passed"
COPY --from=build-ncurses /deps/include/curses.h /deps/include/
COPY --from=build-ncurses /deps/include/ncursesw/ /deps/include/ncursesw/
WORKDIR /expat
RUN /dl/expat/configure \
@@ -547,9 +543,9 @@ RUN cat $PREFIX/src/gdb-*.patch | patch -d/dl/gdb -p1 \
&& sed -i 's/quiet = 0/quiet = 1/' /dl/gdb/gdb/main.c \
&& /dl/gdb/configure \
--host=$ARCH \
--disable-tui \
CFLAGS="-std=gnu17 -O2 -D__MINGW_USE_VC2005_COMPAT -I/deps/include" \
CXXFLAGS="-O2 -D__MINGW_USE_VC2005_COMPAT -I/deps/include" \
--enable-tui \
CFLAGS="-std=gnu17 -O2 -D__MINGW_USE_VC2005_COMPAT -DNCURSES_STATIC -I/deps/include" \
CXXFLAGS="-O2 -D__MINGW_USE_VC2005_COMPAT -DNCURSES_STATIC -I/deps/include" \
LDFLAGS="-s -L/deps/lib" \
&& make MAKEINFO=true -j$(nproc) \
&& mkdir -p /out/bin \
@@ -727,7 +723,8 @@ RUN cmake -DCMAKE_BUILD_TYPE=Release \
FROM cross AS build-cmake
COPY --from=dl-cmake /dl/ /dl/
COPY --from=build-ncurses /deps/lib/libcurses.a /deps/lib/
COPY --from=build-ncurses /deps/include/ /deps/include/
COPY --from=build-ncurses /deps/include/curses.h /deps/include/
COPY --from=build-ncurses /deps/include/ncursesw/ /deps/include/ncursesw/
WORKDIR /cmake
COPY src/cmake-*.patch $PREFIX/src/

View File

@@ -1,5 +1,5 @@
--- a/Dockerfile 2026-03-18 12:17:21.791119253 +0000
+++ b/Dockerfile 2026-03-18 12:17:21.792788225 +0000
--- a/Dockerfile 2026-03-18 13:02:04.857926873 +0000
+++ b/Dockerfile 2026-03-18 13:02:04.859390567 +0000
@@ -190,7 +190,7 @@
# Build cross-compiler
@@ -63,7 +63,7 @@
--enable-mingw-wildcard \
CFLAGS_FOR_TARGET="-O2" \
CXXFLAGS_FOR_TARGET="-O2" \
@@ -580,7 +584,7 @@
@@ -576,7 +580,7 @@
WORKDIR /dl/busybox
COPY src/busybox-* $PREFIX/src/
RUN cat $PREFIX/src/busybox-*.patch | patch -p1 \
@@ -72,7 +72,7 @@
&& sed -ri 's/^(CONFIG_AR)=y/\1=n/' .config \
&& sed -ri 's/^(CONFIG_ASCII)=y/\1=n/' .config \
&& sed -ri 's/^(CONFIG_DPKG\w*)=y/\1=n/' .config \
@@ -738,6 +742,7 @@
@@ -735,6 +739,7 @@
-DCMAKE_CXX_COMPILER=$ARCH-g++ \
-DCMAKE_RC_COMPILER=$ARCH-windres \
-DCMAKE_EXE_LINKER_FLAGS="-s" \