From 265ce370775094f4e816210046c05ea9420744b1 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 09:41:44 -0800 Subject: [PATCH 01/10] Fix download caching, only download missing or currently empty files --- xorg/X11R7.6/buildx.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xorg/X11R7.6/buildx.sh b/xorg/X11R7.6/buildx.sh index 0c61b5e1..56a3b29f 100755 --- a/xorg/X11R7.6/buildx.sh +++ b/xorg/X11R7.6/buildx.sh @@ -25,15 +25,23 @@ download_all_files() { - # download files parallelly using keepalive - # a little bit faster than calling wget with single file more than 100 times - < x11_file_list.txt cut -f1 -d: | sed -e "s|^|${download_url}/|" | \ + # download files in parallel using keepalive - a little bit faster + # than calling wget for a single file more than 100 times + urls= + for f in `cut -f1 -d: x11_file_list.txt`; do + if ! test -s "downloads/$f"; then + urls="$urls ${download_url}/$f" + fi + done + if test -n "$urls"; then + echo $urls | \ xargs -P2 -n $(expr $num_modules / 2 + 1) \ wget \ --directory-prefix=downloads \ --no-verbose \ --timestamping \ --continue + fi status=$? return $status From 5c32e7960569ddeaa2ff5b847652d38ae6a1c07a Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 09:45:08 -0800 Subject: [PATCH 02/10] Fix libpciaccess compilation on non-Linux systems Both gcc and clang have __builtin_bswap16 and __builtin_bswap32. --- xorg/X11R7.6/libpciaccess-0.12.0.patch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 xorg/X11R7.6/libpciaccess-0.12.0.patch diff --git a/xorg/X11R7.6/libpciaccess-0.12.0.patch b/xorg/X11R7.6/libpciaccess-0.12.0.patch new file mode 100644 index 00000000..7d45d0b2 --- /dev/null +++ b/xorg/X11R7.6/libpciaccess-0.12.0.patch @@ -0,0 +1,24 @@ +diff -ur a/src/common_interface.c b/src/common_interface.c +--- a/src/common_interface.c ++++ b/src/common_interface.c +@@ -51,6 +51,20 @@ + # define HTOLE_32(x) (x) + #endif /* linux */ + ++#elif defined(__GNUC__) || defined(__clang__) ++ ++#if __BYTE_ORDER == __BIG_ENDIAN ++# define LETOH_16(x) __builtin_bswap16(x) ++# define HTOLE_16(x) __builtin_bswap16(x) ++# define LETOH_32(x) __builtin_bswap32(x) ++# define HTOLE_32(x) __builtin_bswap32(x) ++#else ++# define LETOH_16(x) (x) ++# define HTOLE_16(x) (x) ++# define LETOH_32(x) (x) ++# define HTOLE_32(x) (x) ++#endif /* gcc or clang */ ++ + #elif defined(__sun) + + #include From 5d3197618e0ad334fffa5400927472c66c5fb43f Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 10:21:53 -0800 Subject: [PATCH 03/10] Fix pixmap compilation with clang Clang does not allow a variable to be used for the "K" register, even if all uses of the inlined function use a constant value. The current version of pixmap doesn't use the inline function. It uses a macro regardless of the optimization level. There should be no performance overhead from using the macro. --- xorg/X11R7.6/pixman-0.30.0.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 xorg/X11R7.6/pixman-0.30.0.patch diff --git a/xorg/X11R7.6/pixman-0.30.0.patch b/xorg/X11R7.6/pixman-0.30.0.patch new file mode 100644 index 00000000..35acdc51 --- /dev/null +++ b/xorg/X11R7.6/pixman-0.30.0.patch @@ -0,0 +1,11 @@ +--- a/pixman/pixman-mmx.c ++++ b/pixman/pixman-mmx.c +@@ -89,7 +89,7 @@ _mm_mulhi_pu16 (__m64 __A, __m64 __B) + return __A; + } + +-# ifdef __OPTIMIZE__ ++# if defined(__OPTIMIZE__) && !defined(__clang__) + extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) + _mm_shuffle_pi16 (__m64 __A, int8_t const __N) + { From 8db3de08eb8570ac920f3dba87920bf0a0458483 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 11:21:51 -0800 Subject: [PATCH 04/10] Remove missing directories from the include path for X11rdp --- xorg/X11R7.6/rdp/Makefile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/xorg/X11R7.6/rdp/Makefile b/xorg/X11R7.6/rdp/Makefile index cdfea385..5debf3d2 100644 --- a/xorg/X11R7.6/rdp/Makefile +++ b/xorg/X11R7.6/rdp/Makefile @@ -49,20 +49,12 @@ LLIBS = -Wl,-rpath=$(LIBBASE) -lfreetype -lz -lm -lXfont -lXau \ -lXdmcp -lpixman-1 -lrt -ldl -lcrypto -lGL -lXdamage CFLAGS = -g -O2 -Wall -fno-strength-reduce \ - -I../../include \ - -I../../cfb \ - -I../../mfb \ - -I../../mi \ -I$(INCBASE) \ -I$(INCBASE)/X11 \ -I$(INCBASE)/X11/fonts \ -I$(INCBASE)/X11/extensions \ -I$(INCBASE)/xorg \ -I$(INCBASE)/pixman-1 \ - -I../../os \ - -I../../render \ - -I../xfree86/common \ - -I../xfree86/os-support \ -I../../../common \ -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_REENTRANT \ -DGLX_USE_MESA -DXRECORD -D_GNU_SOURCE -DXAPPGROUP \ From bbe718bd3ac540cafe9c45b3e654cf1a75a6950d Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 11:23:04 -0800 Subject: [PATCH 05/10] Don't define RDP_IS_XORG and RDP_IS_XFREE86, they are unused --- xorg/X11R7.6/rdp/rdp.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/xorg/X11R7.6/rdp/rdp.h b/xorg/X11R7.6/rdp/rdp.h index 9c373068..d1735c70 100644 --- a/xorg/X11R7.6/rdp/rdp.h +++ b/xorg/X11R7.6/rdp/rdp.h @@ -76,20 +76,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. //#include "colormapst.h" -/* test to see if this is xorg source or xfree86 */ -#ifdef XORGSERVER -# define RDP_IS_XORG -#else -# include -# if (XF86_VERSION_MAJOR == 4 && XF86_VERSION_MINOR > 3) -# define RDP_IS_XFREE86 -# elif (XF86_VERSION_MAJOR > 4) -# define RDP_IS_XFREE86 -# else -# define RDP_IS_XORG -# endif -#endif - #define X11RDPVER "0.9.1" #define PixelDPI 100 From 983a7073bff0d39e8d6923146cb5acbebd3e4aa6 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 11:27:40 -0800 Subject: [PATCH 06/10] Use OPENSSL_CFLAGS even if -lcrypto is used directly OpenSSL headers are used even when the full set of OpenSSL libraries is not used. --- xorg/X11R7.6/xorg-server-1.9.3.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 xorg/X11R7.6/xorg-server-1.9.3.patch diff --git a/xorg/X11R7.6/xorg-server-1.9.3.patch b/xorg/X11R7.6/xorg-server-1.9.3.patch new file mode 100644 index 00000000..db6591b9 --- /dev/null +++ b/xorg/X11R7.6/xorg-server-1.9.3.patch @@ -0,0 +1,10 @@ +--- a/configure ++++ b/configure +@@ -21551,6 +21551,7 @@ + if test "x$with_sha1" = xlibcrypto; then + if test "x$HAVE_LIBCRYPTO" = xyes; then + SHA1_LIBS=-lcrypto ++ SHA1_CFLAGS="$OPENSSL_CFLAGS" + else + SHA1_LIBS="$OPENSSL_LIBS" + SHA1_CFLAGS="$OPENSSL_CFLAGS" From 9c83414a9c4bc7c9852260bda3ad13f137c49601 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 20:47:09 -0800 Subject: [PATCH 07/10] Make sure X11rdp is not copied to a file called "bin" It can happen if buildx.sh is run with one argument and them with another without removing build_dir in between. --- xorg/X11R7.6/buildx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xorg/X11R7.6/buildx.sh b/xorg/X11R7.6/buildx.sh index 56a3b29f..bf871744 100755 --- a/xorg/X11R7.6/buildx.sh +++ b/xorg/X11R7.6/buildx.sh @@ -286,7 +286,7 @@ fi # this will copy the build X server with the other X server binaries cd rdp -cp X11rdp $X11RDPBASE/bin +cp X11rdp $X11RDPBASE/bin/X11rdp strip $X11RDPBASE/bin/X11rdp if [ "$2" = "drop" ]; then From 1e83db964b5ceb8fc6f1e8cf09a32048e8d1ad19 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 21:16:38 -0800 Subject: [PATCH 08/10] Fix Mesa compatibility with clang --- xorg/X11R7.6/Mesa-7.10.3.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 xorg/X11R7.6/Mesa-7.10.3.patch diff --git a/xorg/X11R7.6/Mesa-7.10.3.patch b/xorg/X11R7.6/Mesa-7.10.3.patch new file mode 100644 index 00000000..5171d388 --- /dev/null +++ b/xorg/X11R7.6/Mesa-7.10.3.patch @@ -0,0 +1,11 @@ +--- a/src/mesa/x86-64/xform4.S ++++ b/src/mesa/x86-64/xform4.S +@@ -118,7 +118,7 @@ + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 +-.float 0f+1.0 ++.float 1.0 + + .text + .align 16 From 3b52a36afd2944ec04d6954131cfe159676330ef Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 22:05:08 -0800 Subject: [PATCH 09/10] Use fonts installed as part of X11rdp --- xorg/X11R7.6/x11_file_list.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xorg/X11R7.6/x11_file_list.txt b/xorg/X11R7.6/x11_file_list.txt index c4e9b986..b27ff04c 100644 --- a/xorg/X11R7.6/x11_file_list.txt +++ b/xorg/X11R7.6/x11_file_list.txt @@ -58,7 +58,7 @@ mkfontdir-1.0.6.tar.bz2 : mkfontdir-1.0.6 mkfontscale-1.0.8.tar.bz2 : mkfontscale-1.0.8 : xkbcomp-1.2.0.tar.bz2 : xkbcomp-1.2.0 : xdriinfo-1.0.4.tar.bz2 : xdriinfo-1.0.4 : -xorg-server-1.9.3.tar.bz2 : xorg-server-1.9.3 : --with-sha1=libcrypto --disable-dmx --without-dtrace +xorg-server-1.9.3.tar.bz2 : xorg-server-1.9.3 : --with-fontrootdir=$PREFIX_DIR/share/fonts/X11 --with-sha1=libcrypto --disable-dmx --without-dtrace applewmproto-1.4.1.tar.bz2 : applewmproto-1.4.1 : bdftopcf-1.0.3.tar.bz2 : bdftopcf-1.0.3 : intltool-0.41.1.tar.gz : intltool-0.41.1 : From ec1655d3caf1382d15545be40fbf4969a75fe373 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 22:18:47 -0800 Subject: [PATCH 10/10] Compile applewmproto before xorg-server xorg-server can use applewmproto if it's available. --- xorg/X11R7.6/x11_file_list.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xorg/X11R7.6/x11_file_list.txt b/xorg/X11R7.6/x11_file_list.txt index b27ff04c..c1c7de80 100644 --- a/xorg/X11R7.6/x11_file_list.txt +++ b/xorg/X11R7.6/x11_file_list.txt @@ -58,8 +58,8 @@ mkfontdir-1.0.6.tar.bz2 : mkfontdir-1.0.6 mkfontscale-1.0.8.tar.bz2 : mkfontscale-1.0.8 : xkbcomp-1.2.0.tar.bz2 : xkbcomp-1.2.0 : xdriinfo-1.0.4.tar.bz2 : xdriinfo-1.0.4 : -xorg-server-1.9.3.tar.bz2 : xorg-server-1.9.3 : --with-fontrootdir=$PREFIX_DIR/share/fonts/X11 --with-sha1=libcrypto --disable-dmx --without-dtrace applewmproto-1.4.1.tar.bz2 : applewmproto-1.4.1 : +xorg-server-1.9.3.tar.bz2 : xorg-server-1.9.3 : --with-fontrootdir=$PREFIX_DIR/share/fonts/X11 --with-sha1=libcrypto --disable-dmx --without-dtrace bdftopcf-1.0.3.tar.bz2 : bdftopcf-1.0.3 : intltool-0.41.1.tar.gz : intltool-0.41.1 : xkeyboard-config-2.0.tar.bz2 : xkeyboard-config-2.0 :