Skip to content
Permalink
Browse files

xorg-server-1.18: New port, legacy version of X11 server

  • Loading branch information
cjones051073 committed Apr 4, 2019
1 parent 96b8273 commit 6746eecb6c3bbc2de9b553de097feefa3696f1f9
@@ -0,0 +1,150 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup compiler_blacklist_versions 1.0

name xorg-server-1.18
conflicts xorg-server xorg-server-devel
set my_name xorg-server
version 1.18.4
revision 0
categories x11 devel
license X11
maintainers nomaintainer
description The X.org / Xquartz X server.
homepage https://www.x.org
platforms darwin macosx
long_description The X.org X server allows you to run X11 applications on your computer.

#master_sites http://xquartz.macosforge.org/downloads/src
master_sites http://xorg.freedesktop.org/archive/individual/xserver/
#master_sites xorg:individual/xserver/

dist_subdir ${my_name}
distname ${my_name}-${version}

checksums rmd160 6f58d84d3bbc59a773e6a2e1eafc208827a5923f \
sha256 278459b2c31d61a15655d95a72fb79930c480a6bb8cf9226e48a07df8b1d31c8 \
size 6009508

use_bzip2 yes
use_parallel_build yes

# Yes, mesa is a *BUILD* dependency
depends_build \
port:pkgconfig \
port:mesa \
port:xorg-xorgproto \
port:xorg-xtrans

# This xinit dependency needs to be port: not bin: because we specifically run ${prefix}/bin/startx from bundle-main.c
depends_run \
port:xinit \
port:quartz-wm \
port:xorg-fonts \
port:xkeyboard-config

depends_lib \
path:lib/pkgconfig/pixman-1.pc:libpixman \
port:xorg-libxkbfile \
port:xorg-libXfont \
port:xorg-libXt \
port:xorg-libAppleWM \
port:xorg-libXfixes

# https://trac.macports.org/ticket/36055
# https://llvm.org/bugs/show_bug.cgi?id=30346
# https://trac.macports.org/ticket/53910
compiler.blacklist gcc-4.0 macports-clang-3.9 macports-clang-devel {clang >= 802 < 900}

platform darwin {
if {${os.major} >= 16} {
# Remove this once a version of base is released that contains macports-clang-4.0 in the default fallback list
compiler.blacklist-append macports-clang-3.7
compiler.fallback-append macports-clang-4.0
}
}

configure.args --with-apple-applications-dir=${applications_dir} \
--with-bundle-id-prefix=org.macports \
--without-dtrace \
--without-doxygen \
--without-fop \
--without-xmlto \
--disable-devel-docs \
--with-sha1=CommonCrypto \
--disable-dri2 \
--disable-dri3

# GL/internal/dri_interface.h is missing in prefix (provided by libdrm for the xorg DDX... not helpful for us)
configure.cppflags-append -I/usr/include -I${filespath}/dri -F${configure.sdkroot}/System/Library/Frameworks/ApplicationServices.framework/Frameworks

configure.env-append \
RAWCPP=${configure.cpp}

patchfiles \
0001-XQuartz-Fix-the-issue-where-the-h-key-could-be-come-.patch \
0002-XQuartz-Cleanup-CPPFLAGS-that-are-no-longer-necessar.patch \
0003-os-connection-Improve-abstraction-for-launchd-secure.patch \
1001-XQuartz-Hack-around-an-issue-that-can-occur-on-macOS.patch \
5000-sdksyms.sh-Use-CPPFLAGS-not-CFLAGS.patch \
5001-Revert-dix-Restore-PaintWindow-screen-hook.patch \
5002-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch \
5003-Use-old-miTrapezoids-and-miTriangles-routines.patch \
5004-fb-Revert-fb-changes-that-broke-XQuartz.patch \
5005-fb-Revert-fb-changes-that-broke-XQuartz.patch

patch.pre_args -p1

use_autoreconf yes
autoreconf.args -fvi

build.args V=1

depends_build-append \
port:xorg-util-macros \
port:xorg-font-util

post-destroot {
ln -s Xquartz ${destroot}${prefix}/bin/X
}

platform macosx {
if { ${os.major} < 10 } {
# Xplugin.h is missing on Tiger and incorrect on Leopard
configure.cppflags-append -I${filespath}/include
}
}

variant docs description "Install extra documentation" {
depends_build-append \
port:doxygen \
port:fop \
port:xmlto \
port:xorg-sgml-doctools

depends_skip_archcheck-append \
doxygen \
xmlto

configure.args-delete \
--without-doxygen \
--without-fop \
--without-xmlto \
--disable-devel-docs

configure.args-append \
--with-doxygen \
--with-fop \
--with-xmlto \
--enable-devel-docs

configure.env-append \
DOXYGEN=${prefix}/bin/doxygen \
FOP=${prefix}/bin/fop \
XMLTO=${prefix}/bin/xmlto
}

livecheck.type regex
livecheck.url http://xorg.freedesktop.org/archive/individual/xserver/?C=M&O=D
livecheck.regex ${name}-(\\d+\\.\\d+\\.\\d+)\\.tar
@@ -0,0 +1,42 @@
From b1ee5cc0015e702c8e13c3895f4b2344ab2aeacb Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sun, 29 May 2016 14:01:38 -0700
Subject: [PATCH 1/3] XQuartz: Fix the issue where the h key could be come
"stuck" after hiding XQuartz with cmd-h

The issue was that we set a flag to ignore the k key's up event when sent
the cmd-h down event, but because the cmd-h keycode hides XQuartz, we
became !_x_active by the time the event is delivered which caused us to
go down a differnet codepath rather than getting a chance to ignore it.
We then incorrectly ignored the next h up key.

https://bugs.freedesktop.org/show_bug.cgi?id=92648

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
hw/xquartz/X11Application.m | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index d2c5d30..9a22909 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -366,6 +366,15 @@ message_kit_thread(SEL selector, NSObject *arg)
else {
/* No kit window is focused, so send it to X. */
for_appkit = NO;
+
+ /* Reset our swallow state if we're seeing the same keyCode again.
+ * This can happen if we become !_x_active when the keyCode we
+ * intended to swallow is delivered. See:
+ * https://bugs.freedesktop.org/show_bug.cgi?id=92648
+ */
+ if ([e keyCode] == swallow_keycode) {
+ do_swallow = NO;
+ }
}
}
else { /* KeyUp */
--
2.9.3

@@ -0,0 +1,28 @@
From b863c6cc90f9e0d3db361fbc3210c34ed5298203 Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 10 Sep 2016 22:16:11 -0700
Subject: [PATCH 2/3] XQuartz: Cleanup CPPFLAGS that are no longer necessary on
darwin

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
hw/xquartz/pbproxy/Makefile.am | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/xquartz/pbproxy/Makefile.am b/hw/xquartz/pbproxy/Makefile.am
index 1b14dff..9429ea2 100644
--- a/hw/xquartz/pbproxy/Makefile.am
+++ b/hw/xquartz/pbproxy/Makefile.am
@@ -1,7 +1,6 @@
-AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
- -DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\"
+AM_CPPFLAGS=-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\"

-AM_CFLAGS=$(XPBPROXY_CFLAGS)
+AM_CFLAGS=$(XPBPROXY_CFLAGS)
AM_OBJCFLAGS=$(XPBPROXY_CFLAGS)

noinst_LTLIBRARIES = libxpbproxy.la
--
2.9.3

@@ -0,0 +1,73 @@
From 455d862774b791f4ca93f9885e1e899208a5080c Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 10 Sep 2016 22:32:56 -0700
Subject: [PATCH 3/3] os/connection: Improve abstraction for launchd secure
sockets

This changes away from hard-coding the /tmp/launch-* path to now
supporting a generic <path to unix socket>[.<screen>] format for
$DISPLAY.

cf-libxcb: d978a4f69b30b630f28d07f1003cf290284d24d8

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
os/connection.c | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/os/connection.c b/os/connection.c
index a901ebf..ac7d12b 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -79,6 +79,8 @@ SOFTWARE.
#include <stdio.h>
#include <stdlib.h>

+#include <sys/stat.h>
+
#ifndef WIN32
#include <sys/socket.h>

@@ -1112,15 +1114,34 @@ MakeClientGrabPervious(ClientPtr client)
void
ListenOnOpenFD(int fd, int noxauth)
{
- char port[256];
+ char port[PATH_MAX];
XtransConnInfo ciptr;
const char *display_env = getenv("DISPLAY");

- if (display_env && (strncmp(display_env, "/tmp/launch", 11) == 0)) {
- /* Make the path the launchd socket if our DISPLAY is set right */
- strcpy(port, display_env);
+ /* First check if display_env matches a <path to unix socket>[.<screen number>] scheme (eg: launchd) */
+ if (display_env) {
+ struct stat sbuf;
+
+ strlcpy(port, display_env, sizeof(port));
+
+ /* If the path exists, we don't have do do anything else.
+ * If it doesn't, we need to check for a .<screen number> to strip off and recheck.
+ */
+ if (0 != stat(port, &sbuf)) {
+ char *dot = strrchr(port, '.');
+ if (dot) {
+ *dot = '\0';
+
+ if (0 != stat(port, &sbuf)) {
+ display_env = NULL;
+ }
+ } else {
+ display_env = NULL;
+ }
+ }
}
- else {
+
+ if (!display_env) {
/* Just some default so things don't break and die. */
snprintf(port, sizeof(port), ":%d", atoi(display));
}
--
2.9.3

@@ -0,0 +1,59 @@
From 7c2f104ace0bfdc033145db478f17111fedaa432 Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Tue, 18 Jul 2017 21:35:49 -0700
Subject: [PATCH] XQuartz: Hack around an issue that can occur on macOS due to
background apps incorrectly stealing focus

Works around <rdar://problem/7150340>.

Tested-by: Tom Lane <tgl@sss.pgh.pa.us>
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
hw/xquartz/X11Application.m | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 768eecf68..821e1c5a1 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -275,13 +275,32 @@ message_kit_thread(SEL selector, NSObject *arg)
if (_x_active) [self activateX:NO];
}
else if ([self modalWindow] == nil) {
- /* Must be an X window. Tell appkit it doesn't have focus. */
+ /* Must be an X window. Tell appkit windows to resign main/key */
for_appkit = NO;

- if ([self isActive]) {
- [self deactivate];
- if (!_x_active && quartzProcs->IsX11Window([e windowNumber]))
- [self activateX:YES];
+ if (!_x_active && quartzProcs->IsX11Window([e windowNumber])) {
+ if ([self respondsToSelector:@selector(_setKeyWindow:)] && [self respondsToSelector:@selector(_setMainWindow:)]) {
+ NSWindow *keyWindow = [self keyWindow];
+ if (keyWindow) {
+ [self _setKeyWindow:nil];
+ [keyWindow resignKeyWindow];
+ }
+
+ NSWindow *mainWindow = [self mainWindow];
+ if (mainWindow) {
+ [self _setMainWindow:nil];
+ [mainWindow resignMainWindow];
+ }
+ } else {
+ /* This has a side effect of causing background apps to steal focus from XQuartz.
+ * Unfortunately, there is no public and stable API to do what we want, but this
+ * is a decent fallback in the off chance that the above selectors get dropped
+ * in the future.
+ */
+ [self deactivate];
+ }
+
+ [self activateX:YES];
}
}

--
2.13.2

@@ -0,0 +1,41 @@
From da0dc81ea081657dba3ba492359593ba40d7245a Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston <jeremyhu@apple.com>
Date: Fri, 13 Jan 2012 12:00:57 -0800
Subject: [PATCH 5000/5005] sdksyms.sh: Use CPPFLAGS, not CFLAGS

CFLAGS can include flags which are not useful to the preprocessor
or can even cause it to fail. This fixes a build issue on darwin
when building for more than one architecture.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
---
hw/xfree86/Makefile.am | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 85bd0be..6de7c10 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -48,8 +48,7 @@ DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
bin_PROGRAMS = Xorg
nodist_Xorg_SOURCES = sdksyms.c

-AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser \
+AM_CPPFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ $(XORG_INCS) -I$(srcdir)/parser \
-I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \
-I$(srcdir)/dri -I$(srcdir)/dri2 -I$(top_srcdir)/dri3

@@ -137,7 +136,7 @@ CLEANFILES = sdksyms.c sdksyms.dep Xorg.sh
EXTRA_DIST += sdksyms.sh

sdksyms.dep sdksyms.c: sdksyms.sh
- $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS)
+ $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CPPFLAGS) $(AM_CPPFLAGS)

SDKSYMS_DEP = sdksyms.dep
-include $(SDKSYMS_DEP)
--
2.8.1

0 comments on commit 6746eec

Please sign in to comment.
You can’t perform that action at this time.