cygwin.newlib-cygwin-headers: init at 3.6.4

This commit is contained in:
David McFarland
2025-09-27 13:33:43 -03:00
parent 6eb63c48d2
commit dababcade0
4 changed files with 83 additions and 0 deletions
+2
View File
@@ -15,5 +15,7 @@ makeScopeWithSplicing' {
in
{
w32api-headers = callPackage ./w32api { };
newlib-cygwin-headers = callPackage ./newlib-cygwin { };
};
}
@@ -0,0 +1,48 @@
{
lib,
stdenvNoCC,
buildPackages,
fetchurl,
w32api-headers,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "newlib-cygwin-headers";
version = "3.6.4";
src = buildPackages.fetchgit {
url = "https://cygwin.com/git/newlib-cygwin.git";
rev = "cygwin-${finalAttrs.version}";
hash = "sha256-+WYKwqcDAc7286GzbgKKAxNJCOf3AeNnF8XEVPoor+g=";
};
patches = [
# newer versions of gcc don't like struct winsize being used before being
# declared.
./fix-winsize.patch
];
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/include/
cp -r newlib/libc/include/* $out/include/
cp -r winsup/cygwin/include/* $out/include/
'';
passthru.w32api = w32api-headers;
meta = {
homepage = "https://cygwin.com/";
description = "A DLL which provides substantial POSIX API functionality on Windows.";
license = with lib.licenses; [
# newlib
gpl2
# winsup
gpl3
];
platforms = lib.platforms.cygwin;
maintainers = [ lib.maintainers.corngood ];
};
})
@@ -0,0 +1,31 @@
diff --git a/winsup/cygwin/include/sys/termios.h b/winsup/cygwin/include/sys/termios.h
index d1b4a0af5..75e0c5348 100644
--- a/winsup/cygwin/include/sys/termios.h
+++ b/winsup/cygwin/include/sys/termios.h
@@ -282,6 +282,12 @@ struct termios
speed_t c_ospeed;
};
+struct winsize
+{
+ unsigned short ws_row, ws_col;
+ unsigned short ws_xpixel, ws_ypixel;
+};
+
#define termio termios
#ifdef __cplusplus
@@ -313,13 +319,6 @@ int tcsetwinsize(int fd, const struct winsize *winsz);
#define cfgetospeed(tp) ((tp)->c_ospeed)
#endif
-/* Extra stuff to make porting stuff easier. */
-struct winsize
-{
- unsigned short ws_row, ws_col;
- unsigned short ws_xpixel, ws_ypixel;
-};
-
#define TIOCGWINSZ (('T' << 8) | 1)
#define TIOCSWINSZ (('T' << 8) | 2)
#define TIOCLINUX (('T' << 8) | 3)
+2
View File
@@ -7593,6 +7593,8 @@ with pkgs;
windows.mingw_w64_headers or fallback
else if libc == "nblibc" then
netbsd.headers
else if libc == "cygwin" then
cygwin.newlib-cygwin-headers
else
null;