Last active
March 29, 2026 07:48
-
-
Save deton/c9520a36344123596f309346a37cf7f4 to your computer and use it in GitHub Desktop.
GNU screen for MSYS2 and git-for-windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pkgname=screen | |
| pkgver=4.9.1 | |
| pkgrel=1 | |
| pkgdesc='A terminal multiplexer' | |
| url='https://www.gnu.org/software/screen/' | |
| msys2_repository_url="http://ftp.gnu.org/gnu/screen/" | |
| msys2_references=( | |
| "cpe: cpe:/a:gnu:screen" | |
| ) | |
| arch=('i686' 'x86_64') | |
| license=('GPL') | |
| #depends=('ncurses') | |
| makedepends=('autotools' 'gcc') | |
| source=("https://ftp.gnu.org/gnu/screen/${pkgname}-${pkgver}.tar.gz"{,.sig} | |
| 'screen-4.9.1-msys2.patch') | |
| noextract=('screen-4.9.1.tar.gz') | |
| sha256sums=('26cef3e3c42571c0d484ad6faf110c5c15091fbf872b06fa7aa4766c7405ac69' | |
| 'SKIP' | |
| '2af248b8611adb08d0096d229b48dd67dfc336ebe3384ba104e662e376251273') | |
| validpgpkeys=('50B861B3E930EC33750D90ED910832974A92A11C') | |
| # to be used for git-for-windows too | |
| prefix=/c/opt/screen | |
| prepare() { | |
| MSYS=winsymlinks:lnk tar zxf "${srcdir}/${pkgname}-${pkgver}.tar.gz" | |
| cd "${srcdir}/${pkgname}-${pkgver}" | |
| patch --forward --strip=1 --input="${srcdir}/screen-4.9.1-msys2.patch" | |
| } | |
| build() { | |
| cd "${srcdir}/${pkgname}-${pkgver}" | |
| ./configure \ | |
| --build=${CHOST} \ | |
| --prefix=${prefix} \ | |
| --enable-colors256 | |
| make | |
| } | |
| package() { | |
| cd "${srcdir}/${pkgname}-${pkgver}" | |
| make DESTDIR="${pkgdir}" install | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff -urp ../orig/screen-4.9.1/logfile.c ./logfile.c | |
| --- ../orig/screen-4.9.1/logfile.c 2023-08-16 09:29:26.000000000 +0900 | |
| +++ ./logfile.c 2026-03-28 15:21:45.018669900 +0900 | |
| @@ -85,7 +85,7 @@ static int logfile_reopen(char *name, in | |
| return 0; | |
| } | |
| -static int (* lf_reopen_fn)() = logfile_reopen; | |
| +static int (* lf_reopen_fn)(char *name, int wantfd, struct logfile *l) = logfile_reopen; | |
| /* | |
| * Whenever logfwrite discoveres that it is required to close and | |
| diff -urp ../orig/screen-4.9.1/pty.c ./pty.c | |
| --- ../orig/screen-4.9.1/pty.c 2023-08-16 09:29:26.000000000 +0900 | |
| +++ ./pty.c 2026-03-28 15:19:47.033243700 +0900 | |
| @@ -256,7 +256,7 @@ OpenPTY(ttyn) | |
| char **ttyn; | |
| { | |
| register int f; | |
| - char *m, *ptsname(); | |
| + char *m; //, *ptsname(); | |
| int unlockpt __P((int)), grantpt __P((int)); | |
| #if defined(HAVE_GETPT) && defined(linux) | |
| int getpt __P((void)); | |
| diff -urp ../orig/screen-4.9.1/screen.c ./screen.c | |
| --- ../orig/screen-4.9.1/screen.c 2023-08-16 09:29:26.000000000 +0900 | |
| +++ ./screen.c 2026-03-29 15:29:40.113591200 +0900 | |
| @@ -1114,8 +1114,10 @@ int main(int ac, char** av) | |
| Panic(0, "Directory '%s' must be owned by root.", SockDir); | |
| n = (eff_uid == 0 && (real_uid || (st.st_mode & 0775) != 0775)) ? 0755 : | |
| (eff_gid == (int)st.st_gid && eff_gid != real_gid) ? 0775 : 0777; | |
| +#ifndef __MSYS__ | |
| if (((int)st.st_mode & 0777) != n) | |
| Panic(0, "Directory '%s' must have mode %03o.", SockDir, n); | |
| +#endif | |
| } | |
| sprintf(SockPath, "%s/S-%s", SockDir, LoginName); | |
| if (access(SockPath, F_OK)) { | |
| @@ -1150,8 +1152,10 @@ int main(int ac, char** av) | |
| #endif | |
| } | |
| +#ifndef __MSYS__ | |
| if ((st.st_mode & 0777) != 0700) | |
| Panic(0, "Directory %s must have mode 700.", SockPath); | |
| +#endif | |
| if (SockMatch && index(SockMatch, '/')) | |
| Panic(0, "Bad session name '%s'", SockMatch); | |
| SockName = SockPath + strlen(SockPath) + 1; | |
| diff -urp ../orig/screen-4.9.1/socket.c ./socket.c | |
| --- ../orig/screen-4.9.1/socket.c 2023-08-16 09:29:26.000000000 +0900 | |
| +++ ./socket.c 2026-03-28 15:18:48.702165600 +0900 | |
| @@ -89,7 +89,7 @@ extern char *multi; | |
| #endif | |
| extern int maxwin; | |
| -extern char *getenv(); | |
| +//extern char *getenv(); | |
| extern char SockPath[]; | |
| extern struct event serv_read; | |
| diff -urp ../orig/screen-4.9.1/term.sh ./term.sh | |
| --- ../orig/screen-4.9.1/term.sh 2023-08-16 09:29:26.000000000 +0900 | |
| +++ ./term.sh 2026-03-28 15:25:45.911509900 +0900 | |
| @@ -7,7 +7,7 @@ if test -z "$srcdir"; then | |
| srcdir=. | |
| fi | |
| -LC_ALL=C | |
| +LC_ALL=en_US.UTF-8 | |
| export LC_ALL | |
| rm -f term.h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment