1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

Attempt to fix build of dri, libGL, and libdrm on tier-2 archs.

PR:		ports/169874
Submitted by:	marius, linimon
Tested on:	amd64, arm, i386, powerpc, sparc
Thanks to:	bz, andyt
This commit is contained in:
Mark Linimon 2012-07-30 04:36:31 +00:00
parent 36624543ed
commit 3a764317c4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=301701
10 changed files with 286 additions and 33 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= dri
PORTVERSION= ${MESAVERSION}
PORTREVISION= 1
PORTEPOCH= 2
CATEGORIES= graphics
@ -28,4 +29,92 @@ do-install:
BROKEN= Does not install on ia64
.endif
.if ${ARCH} != "amd64" || ${ARCH} != "i386"
CONFIGURE_ARGS+=--disable-gallium-intel
.endif
.if ${ARCH} == "amd64"
PLIST_SUB+= I810_DRIVER="@comment "
PLIST_SUB+= I9X5_DRIVER=""
PLIST_SUB+= MACH64_DRIVER=""
PLIST_SUB+= MGA_DRIVER=""
PLIST_SUB+= NOUVEAU_DRIVER=""
PLIST_SUB+= RADEON_DRIVERS=""
PLIST_SUB+= SAVAGE_DRIVER=""
PLIST_SUB+= SIS_DRIVER=""
PLIST_SUB+= SWRAST_DRIVER=""
PLIST_SUB+= TDFX_DRIVER=""
PLIST_SUB+= UNICHROME_DRIVER=""
.endif
.if ${ARCH} == "arm"
PLIST_SUB+= I810_DRIVER="@comment "
PLIST_SUB+= I9X5_DRIVER="@comment "
PLIST_SUB+= MACH64_DRIVER="@comment "
PLIST_SUB+= MGA_DRIVER="@comment "
PLIST_SUB+= NOUVEAU_DRIVER="@comment "
PLIST_SUB+= RADEON_DRIVERS="@comment "
PLIST_SUB+= SAVAGE_DRIVER="@comment "
PLIST_SUB+= SIS_DRIVER="@comment "
PLIST_SUB+= SWRAST_DRIVER="@comment "
PLIST_SUB+= TDFX_DRIVER="@comment "
PLIST_SUB+= UNICHROME_DRIVER="@comment "
.endif
.if ${ARCH} == "i386"
PLIST_SUB+= I810_DRIVER=""
PLIST_SUB+= I9X5_DRIVER=""
PLIST_SUB+= MACH64_DRIVER=""
PLIST_SUB+= MGA_DRIVER=""
PLIST_SUB+= NOUVEAU_DRIVER=""
PLIST_SUB+= RADEON_DRIVERS=""
PLIST_SUB+= SAVAGE_DRIVER=""
PLIST_SUB+= SIS_DRIVER=""
PLIST_SUB+= SWRAST_DRIVER=""
PLIST_SUB+= TDFX_DRIVER=""
PLIST_SUB+= UNICHROME_DRIVER=""
.endif
.if ${ARCH} == "mips"
PLIST_SUB+= I810_DRIVER="@comment "
PLIST_SUB+= I9X5_DRIVER="@comment "
PLIST_SUB+= MACH64_DRIVER="@comment "
PLIST_SUB+= MGA_DRIVER="@comment "
PLIST_SUB+= NOUVEAU_DRIVER="@comment "
PLIST_SUB+= RADEON_DRIVERS="@comment "
PLIST_SUB+= SAVAGE_DRIVER="@comment "
PLIST_SUB+= SIS_DRIVER="@comment "
PLIST_SUB+= SWRAST_DRIVER="@comment "
PLIST_SUB+= TDFX_DRIVER="@comment "
PLIST_SUB+= UNICHROME_DRIVER="@comment "
.endif
.if ${ARCH} == "powerpc"
PLIST_SUB+= I810_DRIVER="@comment "
PLIST_SUB+= I9X5_DRIVER="@comment "
PLIST_SUB+= MACH64_DRIVER=""
PLIST_SUB+= MGA_DRIVER="@comment "
PLIST_SUB+= NOUVEAU_DRIVER="@comment "
PLIST_SUB+= RADEON_DRIVERS=""
PLIST_SUB+= SAVAGE_DRIVER="@comment "
PLIST_SUB+= SIS_DRIVER="@comment "
PLIST_SUB+= SWRAST_DRIVER=""
PLIST_SUB+= TDFX_DRIVER=""
PLIST_SUB+= UNICHROME_DRIVER="@comment "
.endif
.if ${ARCH} == "sparc64"
PLIST_SUB+= I810_DRIVER="@comment "
PLIST_SUB+= I9X5_DRIVER="@comment "
PLIST_SUB+= MACH64_DRIVER=""
PLIST_SUB+= MGA_DRIVER="@comment "
PLIST_SUB+= NOUVEAU_DRIVER="@comment "
PLIST_SUB+= RADEON_DRIVERS=""
PLIST_SUB+= SAVAGE_DRIVER="@comment "
PLIST_SUB+= SIS_DRIVER="@comment "
PLIST_SUB+= SWRAST_DRIVER=""
PLIST_SUB+= TDFX_DRIVER="@comment "
PLIST_SUB+= UNICHROME_DRIVER="@comment "
.endif
.include <bsd.port.post.mk>

View File

@ -1,20 +1,20 @@
include/GL/internal/dri_interface.h
lib/dri/i810_dri.so
lib/dri/i915_dri.so
lib/dri/i965_dri.so
lib/dri/mach64_dri.so
lib/dri/mga_dri.so
%%NEW%%lib/dri/nouveau_vieux_dri.so
lib/dri/r128_dri.so
lib/dri/r200_dri.so
lib/dri/r300_dri.so
lib/dri/r600_dri.so
lib/dri/radeon_dri.so
lib/dri/savage_dri.so
lib/dri/sis_dri.so
lib/dri/swrast_dri.so
lib/dri/tdfx_dri.so
lib/dri/unichrome_dri.so
%%I810_DRIVER%%lib/dri/i810_dri.so
%%I9X5_DRIVER%%lib/dri/i915_dri.so
%%I9X5_DRIVER%%lib/dri/i965_dri.so
%%MACH64_DRIVER%%lib/dri/mach64_dri.so
%%MGA_DRIVER%%lib/dri/mga_dri.so
%%NEW%%%%NOUVEAU_DRIVER%%lib/dri/nouveau_vieux_dri.so
%%RADEON_DRIVERS%%lib/dri/r128_dri.so
%%RADEON_DRIVERS%%lib/dri/r200_dri.so
%%RADEON_DRIVERS%%lib/dri/r300_dri.so
%%RADEON_DRIVERS%%lib/dri/r600_dri.so
%%RADEON_DRIVERS%%lib/dri/radeon_dri.so
%%SAVAGE_DRIVER%%lib/dri/savage_dri.so
%%SIS_DRIVER%%lib/dri/sis_dri.so
%%SWRAST_DRIVER%%lib/dri/swrast_dri.so
%%TDFX_DRIVER%%lib/dri/tdfx_dri.so
%%UNICHROME_DRIVER%%lib/dri/unichrome_dri.so
libdata/pkgconfig/dri.pc
@dirrm lib/dri
@dirrmtry include/GL/internal

View File

@ -21,4 +21,11 @@ do-install:
cd ${WRKSRC}/src/mesa; ${GMAKE} install-libgl
.include "${.CURDIR}/bsd.mesalib.mk"
.include <bsd.port.mk>
.include <bsd.port.pre.mk>
.if ${ARCH} != "amd64" || ${ARCH} != "i386"
CONFIGURE_ARGS+=--disable-gallium-intel
.endif
.include <bsd.port.post.mk>

View File

@ -53,13 +53,18 @@ CONFIGURE_ARGS+=--enable-gallium-llvm=no --without-gallium-drivers \
--disable-egl
.if defined(WITH_NEW_XORG)
EXTRA_PATCHES+= ${PATCHDIR}/extra-mach64_context.h \
EXTRA_PATCHES+= ${PATCHDIR}/extra-configure \
${PATCHDIR}/extra-mach64_context.h \
${PATCHDIR}/extra-sis_context.h \
${PATCHDIR}/extra-src-glsl_ir_constant_expression.cpp \
${PATCHDIR}/extra-src__gallium__include__pipe__p_config.h \
${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_array.c \
${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c
${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c \
${PATCHDIR}/extra-src__mesa__drivers__dri__radeon__radeon_span.c
.else
EXTRA_PATCHES+= ${PATCHDIR}/extra-src__mesa__x86-64__glapi_x86-64.S \
EXTRA_PATCHES+= ${PATCHDIR}/extra-configure-old \
${PATCHDIR}/extra-mach64_context.h-old \
${PATCHDIR}/extra-src__mesa__x86-64__glapi_x86-64.S \
${PATCHDIR}/extra-src__mesa__x86-64__xform4.S \
${PATCHDIR}/extra-src__mesa__x86__glapi_x86.S \
${PATCHDIR}/extra-src__mesa__x86__read_rgba_span_x86.S
@ -110,6 +115,13 @@ post-patch:
${WRKSRC}/src/glw/Makefile \
${WRKSRC}/src/mesa/Makefile \
${WRKSRC}/src/mesa/drivers/dri/Makefile
.if defined(WITH_NEW_XORG)
# replace hardlinks with patched radeon_span.c
.for i in r200 r300 r600
@${CP} -fp ${WRKSRC}/src/mesa/drivers/dri/radeon/radeon_span.c \
${WRKSRC}/src/mesa/drivers/dri/${i}/
.endfor
.endif
.if ${COMPONENT:Mglut} != ""
@${REINPLACE_CMD} -e 's|[$$](INSTALL_LIB_DIR)/pkgconfig|${PREFIX}/libdata/pkgconfig|' \
${WRKSRC}/src/glut/glx/Makefile

View File

@ -0,0 +1,42 @@
--- configure.orig 2011-11-17 19:46:34.000000000 +0000
+++ configure 2012-06-28 12:53:09.000000000 +0000
@@ -7817,10 +7817,35 @@
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
- if test "x$DRI_DIRS" = "xyes"; then
- DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 \
- radeon tdfx unichrome savage sis swrast"
- fi
+ case "$host_cpu" in
+ x86_64)
+ # i810 is missing because there is no x86-64 system where it
+ # could *ever* be used.
+ if test "x$DRI_DIRS" = "xyes"; then
+ DRI_DIRS="i915 i965 mach64 mga nouveau r128 r200 r300 r600 \
+ radeon savage tdfx unichrome sis swrast"
+ fi
+ ;;
+ i*86)
+ if test "x$DRI_DIRS" = "xyes"; then
+ DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 \
+ r600 radeon savage tdfx unichrome sis swrast"
+ fi
+ ;;
+ powerpc*)
+ # Build only the drivers for cards that exist on PowerPC.
+ # At some point MGA will be added, but not yet.
+ if test "x$DRI_DIRS" = "xyes"; then
+ DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast"
+ fi
+ ;;
+ sparc*)
+ # Build only the drivers for cards that exist on SPARC.
+ if test "x$DRI_DIRS" = "xyes"; then
+ DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast"
+ fi
+ ;;
+ esac
;;
gnu*)
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"

View File

@ -0,0 +1,43 @@
--- configure.orig 2009-12-22 03:31:30.000000000 +0100
+++ configure 2012-06-27 19:49:26.000000000 +0200
@@ -6946,12 +6946,35 @@
CXXFLAGS="$CXXFLAGS -ansi -pedantic"
fi
- # ffb and gamma are missing because they have not been converted
- # to use the new interface.
- if test "x$DRI_DIRS" = "xyes"; then
- DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
+ case "$host_cpu" in
+ x86_64)
+ # i810 is missing because there is no x86-64 system where it
+ # could *ever* be used.
+ if test "x$DRI_DIRS" = "xyes"; then
+ DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
unichrome savage sis swrast"
- fi
+ fi
+ ;;
+ i*86)
+ if test "x$DRI_DIRS" = "xyes"; then
+ DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
+ unichrome savage sis swrast"
+ fi
+ ;;
+ powerpc*)
+ # Build only the drivers for cards that exist on PowerPC.
+ # At some point MGA will be added, but not yet.
+ if test "x$DRI_DIRS" = "xyes"; then
+ DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast"
+ fi
+ ;;
+ sparc*)
+ # Build only the drivers for cards that exist on SPARC.
+ if test "x$DRI_DIRS" = "xyes"; then
+ DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast"
+ fi
+ ;;
+ esac
;;
gnu*)
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"

View File

@ -0,0 +1,20 @@
--- src/mesa/drivers/dri/mach64/mach64_context.h.orig 2012-06-27 19:59:32.000000000 +0200
+++ src/mesa/drivers/dri/mach64/mach64_context.h 2012-06-27 20:08:30.000000000 +0200
@@ -294,11 +294,14 @@
#define LE32_OUT( x, y ) do { *(GLuint *)(x) = (y); } while (0)
#define LE32_OUT_FLOAT( x, y ) do { *(GLfloat *)(x) = (y); } while (0)
#else
-#ifndef __OpenBSD__
-#include <byteswap.h>
-#else
+#if defined(__OpenBSD__)
#include <machine/endian.h>
#define bswap_32 bswap32
+#elif defined(__FreeBSD__)
+#include <sys/endian.h>
+#define bswap_32 bswap32
+#else
+#include <byteswap.h>
#endif
#define LE32_IN( x ) bswap_32( *(GLuint *)(x) )

View File

@ -0,0 +1,25 @@
--- src/gallium/include/pipe/p_config.h.orig 2011-10-15 02:43:58.000000000 +0200
+++ src/gallium/include/pipe/p_config.h 2012-06-28 21:27:06.000000000 +0200
@@ -106,6 +106,13 @@
#endif
#endif
+#if defined(__sparc__) || defined(__sparc64__)
+#define PIPE_ARCH_SPARC
+#if defined(__sparc64__)
+#define PIPE_ARCH_SPARC_64
+#endif
+#endif
+
/*
* Endian detection.
@@ -133,7 +140,7 @@
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
#define PIPE_ARCH_LITTLE_ENDIAN
-#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64)
+#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64)
#define PIPE_ARCH_BIG_ENDIAN
#endif

View File

@ -0,0 +1,15 @@
--- src/mesa/drivers/dri/radeon/radeon_span.c.orig 2011-07-09 03:37:10.000000000 +0200
+++ src/mesa/drivers/dri/radeon/radeon_span.c 2012-06-28 21:44:07.000000000 +0200
@@ -55,7 +55,11 @@
#include <byteswap.h>
#define CPU_TO_LE16( x ) bswap_16( x )
#define LE16_TO_CPU( x ) bswap_16( x )
-#endif /* __linux__ */
+#elif defined(__FreeBSD__)
+#include <sys/endian.h>
+#define CPU_TO_LE16( x ) bswap16( x )
+#define LE16_TO_CPU( x ) bswap16( x )
+#endif
#else
#define CPU_TO_LE16( x ) ( x )
#define LE16_TO_CPU( x ) ( x )

View File

@ -18,21 +18,21 @@
%%NEW%%include/libdrm/drm_sarea.h
%%NEW%%include/libdrm/i915_drm.h
%%NEW%%%%X86%%include/libdrm/intel_bufmgr.h
%%NEW%%include/libdrm/intel_debug.h
%%NEW%%%%X86%%include/libdrm/intel_debug.h
%%NEW%%include/libdrm/mach64_drm.h
%%NEW%%include/libdrm/mga_drm.h
%%NEW%%include/libdrm/nouveau_drm.h
%%NEW%%include/libdrm/nouveau_drmif.h
%%NEW%%include/libdrm/r128_drm.h
%%NEW%%include/libdrm/r600_pci_ids.h
%%NEW%%include/libdrm/radeon_bo.h
%%NEW%%include/libdrm/radeon_bo_gem.h
%%NEW%%include/libdrm/radeon_bo_int.h
%%NEW%%include/libdrm/radeon_cs.h
%%NEW%%include/libdrm/radeon_cs_gem.h
%%NEW%%include/libdrm/radeon_cs_int.h
%%NEW%%%%X86%%include/libdrm/r600_pci_ids.h
%%NEW%%%%X86%%include/libdrm/radeon_bo.h
%%NEW%%%%X86%%include/libdrm/radeon_bo_gem.h
%%NEW%%%%X86%%include/libdrm/radeon_bo_int.h
%%NEW%%%%X86%%include/libdrm/radeon_cs.h
%%NEW%%%%X86%%include/libdrm/radeon_cs_gem.h
%%NEW%%%%X86%%include/libdrm/radeon_cs_int.h
%%NEW%%include/libdrm/radeon_drm.h
%%NEW%%include/libdrm/radeon_surface.h
%%NEW%%%%X86%%include/libdrm/radeon_surface.h
%%NEW%%include/libdrm/savage_drm.h
%%NEW%%include/libdrm/sis_drm.h
%%NEW%%include/libdrm/via_drm.h
@ -59,16 +59,16 @@ lib/libdrm.so.2
lib/libdrm_nouveau.la
lib/libdrm_nouveau.so
lib/libdrm_nouveau.so.1
%%NEW%%lib/libdrm_radeon.la
%%NEW%%lib/libdrm_radeon.so
%%NEW%%lib/libdrm_radeon.so.1
%%NEW%%%%X86%%lib/libdrm_radeon.la
%%NEW%%%%X86%%lib/libdrm_radeon.so
%%NEW%%%%X86%%lib/libdrm_radeon.so.1
%%NEW%%%%KMS%%lib/libkms.la
%%NEW%%%%KMS%%lib/libkms.so
%%NEW%%%%KMS%%lib/libkms.so.1
libdata/pkgconfig/libdrm.pc
%%X86%%libdata/pkgconfig/libdrm_intel.pc
libdata/pkgconfig/libdrm_nouveau.pc
%%NEW%%libdata/pkgconfig/libdrm_radeon.pc
%%NEW%%%%X86%%libdata/pkgconfig/libdrm_radeon.pc
%%NEW%%%%KMS%%libdata/pkgconfig/libkms.pc
@dirrm include/nouveau
%%NEW%%%%KMS%%@dirrm include/libkms