Skip to content

Commit

Permalink
vte: fix build on < 10.7
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed May 12, 2024
1 parent cd90aeb commit 8c6cbd6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gnome/vte/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ maintainers {devans @dbevans} {mascguy @mascguy} openmaintainer
description VTE is a library (libvte) implementing a terminal emulator widget for GTK+, \
and a minimal sample application (vte) using that.
long_description ${description} \
Vte is mainly used in gnome-terminal, but can also be used to embed a \
console/terminal in games, editors, IDEs, etc.
Vte is mainly used in gnome-terminal, but can also be used to embed \
a console/terminal in games, editors, IDEs, etc.
homepage https://wiki.gnome.org/Apps/Terminal/VTE

set branch [join [lrange [split $version .] 0 1] .]
Expand All @@ -38,6 +38,9 @@ meson.wrap_mode nodownload
# so for now, patch meson.build to reduce the massive number of warnings.
patchfiles-append patch-meson-warnings.diff

# https://trac.macports.org/ticket/69963
patchfiles-append patch-F_DUPFD_CLOEXEC.diff

depends_build-append \
port:gettext \
port:intltool \
Expand Down
16 changes: 16 additions & 0 deletions gnome/vte/files/patch-F_DUPFD_CLOEXEC.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- src/libc-glue.hh 2024-03-16 05:20:18.000000000 +0800
+++ src/libc-glue.hh 2024-05-12 13:25:23.000000000 +0800
@@ -220,7 +220,13 @@
{
auto r = int{};
do {
+#ifdef F_DUPFD_CLOEXEC
r = fcntl(oldfd, F_DUPFD_CLOEXEC, newfd);
+#else
+ r = fcntl(oldfd, F_DUPFD, newfd);
+ if (r > 0)
+ fcntl(r, F_SETFD, FD_CLOEXEC);
+#endif
} while (r == -1 && errno == EINTR);
return r;
}

0 comments on commit 8c6cbd6

Please sign in to comment.