summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2021-08-10 16:45:02 +0100
committerMarek Szuba <marecki@gentoo.org>2021-08-10 17:00:36 +0100
commitc21168e7901475574942701c381d8160f303a5b4 (patch)
treefd6da222e362c984412546bb06a7c2fe51d536ea
parentapp-crypt/ccrypt: amd64 stable wrt bug #807373 (diff)
downloadgentoo-c21168e7901475574942701c381d8160f303a5b4.tar.gz
gentoo-c21168e7901475574942701c381d8160f303a5b4.tar.bz2
gentoo-c21168e7901475574942701c381d8160f303a5b4.zip
x11-misc/xorg-cf-files: add support for riscv
While both this package itself and x11-misc/imake emerge fine on riscv without this patch, the installed .cf files are useless for native RISC-V builds. Bug: https://bugs.gentoo.org/807232 Signed-off-by: Marek Szuba <marecki@gentoo.org>
-rw-r--r--x11-misc/xorg-cf-files/files/xorg-cf-files-1.0.7-linux-riscv.patch56
-rw-r--r--x11-misc/xorg-cf-files/xorg-cf-files-1.0.7-r1.ebuild46
2 files changed, 102 insertions, 0 deletions
diff --git a/x11-misc/xorg-cf-files/files/xorg-cf-files-1.0.7-linux-riscv.patch b/x11-misc/xorg-cf-files/files/xorg-cf-files-1.0.7-linux-riscv.patch
new file mode 100644
index 000000000000..143aa53a0280
--- /dev/null
+++ b/x11-misc/xorg-cf-files/files/xorg-cf-files-1.0.7-linux-riscv.patch
@@ -0,0 +1,56 @@
+--- a/Imake.cf
++++ b/Imake.cf
+@@ -1037,6 +1037,17 @@
+ # define AArch64Architecture
+ # undef __aarch64__
+ # endif
++# if defined(__riscv)
++# undef __riscv
++# if __riscv_xlen == 64
++# undef __riscv_xlen
++# define RV64Architecture
++# endif
++# if __riscv_xlen == 32
++# undef __riscv_xlen
++# define RV32Architecture
++# endif
++# endif
+ #endif /* linux || __GLIBC__ */
+
+ #if (defined(__Lynx__) || defined(Lynx)) && (defined(i386) || defined(__i386__) || defined(__x86__) || defined(__powerpc__) || defined(__sparc__) || defined(sparc))
+--- a/linux.cf
++++ b/linux.cf
+@@ -584,7 +584,7 @@
+ #define MkdirHierCmd mkdir -p
+
+ #ifndef HaveLib64
+-# if defined (AMD64Architecture) || defined (s390xArchitecture) || defined (Ppc64Architecture) || defined (AArch64Architecture)
++# if defined (AMD64Architecture) || defined (s390xArchitecture) || defined (Ppc64Architecture) || defined (AArch64Architecture) || defined (RV64Architecture)
+ # define HaveLib64 YES
+ # else
+ # define HaveLib64 NO
+@@ -1000,6 +1000,24 @@
+ # define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
+ #endif /* AArch64Architecture */
+
++#ifdef RV64Architecture
++# ifndef OptimizedCDebugFlags
++# define OptimizedCDebugFlags -O2 GccAliasingArgs
++# endif
++# define LinuxMachineDefines -D__riscv -D__riscv_xlen=64
++# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME
++# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
++#endif /* RV64Architecture */
++
++#ifdef RV32Architecture
++# ifndef OptimizedCDebugFlags
++# define OptimizedCDebugFlags -O2 GccAliasingArgs
++# endif
++# define LinuxMachineDefines -D__riscv -D__riscv_xlen=32
++# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME
++# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
++#endif /* RV32Architecture */
++
+ #ifndef StandardDefines
+ # ifdef __linux__
+ # define StandardDefines -Dlinux LinuxMachineDefines LinuxSourceDefines
diff --git a/x11-misc/xorg-cf-files/xorg-cf-files-1.0.7-r1.ebuild b/x11-misc/xorg-cf-files/xorg-cf-files-1.0.7-r1.ebuild
new file mode 100644
index 000000000000..0c86ae1b1599
--- /dev/null
+++ b/x11-misc/xorg-cf-files/xorg-cf-files-1.0.7-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Old Imake-related build files"
+HOMEPAGE="https://www.x.org/wiki/ https://gitlab.freedesktop.org/xorg/util/cf"
+SRC_URI="https://www.x.org/releases/individual/util/${P}.tar.bz2
+ https://dev.gentoo.org/~mattst88/distfiles/${PN}-1.0.6-solaris-prefix.patch.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+
+BDEPEND="
+ virtual/pkgconfig
+ app-arch/bzip2
+"
+
+PATCHES=(
+ "${WORKDIR}"/${PN}-1.0.6-solaris-prefix.patch
+ "${FILESDIR}"/${PN}-1.0.7-linux-riscv.patch
+)
+
+src_install() {
+ default
+ echo "#define ManDirectoryRoot ${EPREFIX}/usr/share/man" >> \
+ "${ED}"/usr/$(get_libdir)/X11/config/host.def || die
+ sed -i -e "s|LibDirName *lib$|LibDirName $(get_libdir)|" \
+ "${ED}"/usr/$(get_libdir)/X11/config/Imake.tmpl || die "failed libdir sed"
+ sed -i -e "s|LibDir Concat(ProjectRoot,/lib/X11)|LibDir Concat(ProjectRoot,/$(get_libdir)/X11)|" \
+ "${ED}"/usr/$(get_libdir)/X11/config/X11.tmpl || die "failed libdir sed"
+ sed -i -e "s|\(EtcX11Directory \)\(/etc/X11$\)|\1${EPREFIX}\2|" \
+ "${ED}"/usr/$(get_libdir)/X11/config/X11.tmpl || die "failed etcx11dir sed"
+ sed -i -e "/# define Solaris64bitSubdir/d" \
+ "${ED}"/usr/$(get_libdir)/X11/config/sun.cf || die
+ sed -i -e 's/-DNOSTDHDRS//g' \
+ "${ED}"/usr/$(get_libdir)/X11/config/sun.cf || die
+
+ sed -r -i -e "s|LibDirName[[:space:]]+lib.*$|LibDirName $(get_libdir)|" \
+ "${ED}"/usr/$(get_libdir)/X11/config/linux.cf || die "failed libdir sed"
+ sed -r -i -e "s|SystemUsrLibDir[[:space:]]+/usr/lib.*$|SystemUsrLibDir /usr/$(get_libdir)|" \
+ "${ED}"/usr/$(get_libdir)/X11/config/linux.cf || die "failed libdir sed"
+ sed -r -i -e "s|TkLibDir[[:space:]]+/usr/lib.*$|TkLibDir /usr/$(get_libdir)|" \
+ "${ED}"/usr/$(get_libdir)/X11/config/linux.cf || die "failed libdir sed"
+}