aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2012-11-15 09:08:03 +0400
committerAlexey Shvetsov <alexxy@gentoo.org>2012-11-15 09:08:03 +0400
commit64d227b92e113405cc8fb2525608158160d9486f (patch)
tree1a29531b5a5d6a7d979b307c8d43e96df5d3e35a /dev-libs/libcuda
parentinitial import of libcuda (diff)
downloadsci-64d227b92e113405cc8fb2525608158160d9486f.tar.gz
sci-64d227b92e113405cc8fb2525608158160d9486f.tar.bz2
sci-64d227b92e113405cc8fb2525608158160d9486f.zip
Move to dev-libs
Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
Diffstat (limited to 'dev-libs/libcuda')
-rw-r--r--dev-libs/libcuda/ChangeLog13
-rw-r--r--dev-libs/libcuda/files/0001-Fix-detection-of-nouveau-in-case-its-builtin.patch26
-rw-r--r--dev-libs/libcuda/files/0002-Fix-install-target-for-gdev-lib-userspace.patch36
-rw-r--r--dev-libs/libcuda/files/0003-Fix-install-target-for-gdev-lib-userspace-part2.patch35
-rw-r--r--dev-libs/libcuda/files/0004-Respect-extra-CFLAGS-and-LDFLAGS.patch26
-rw-r--r--dev-libs/libcuda/files/0005-Fix-install-target-for-cuda-lib.patch47
-rw-r--r--dev-libs/libcuda/libcuda-9999.ebuild53
-rw-r--r--dev-libs/libcuda/metadata.xml8
8 files changed, 244 insertions, 0 deletions
diff --git a/dev-libs/libcuda/ChangeLog b/dev-libs/libcuda/ChangeLog
new file mode 100644
index 000000000..031ee7c4c
--- /dev/null
+++ b/dev-libs/libcuda/ChangeLog
@@ -0,0 +1,13 @@
+# ChangeLog for dev-util/libgdev
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*libgdev-9999 (15 Nov 2012)
+
+ 15 Nov 2012; Alexey Shvetsov <alexxy@gentoo.org>
+ +files/0001-Fix-detection-of-nouveau-in-case-its-builtin.patch,
+ +files/0002-Fix-install-target-for-gdev-lib-userspace.patch,
+ +files/0003-Fix-install-target-for-gdev-lib-userspace-part2.patch,
+ +files/0004-Respect-extra-CFLAGS-and-LDFLAGS.patch, +libgdev-9999.ebuild,
+ +metadata.xml:
+ Initial import of libgdev
diff --git a/dev-libs/libcuda/files/0001-Fix-detection-of-nouveau-in-case-its-builtin.patch b/dev-libs/libcuda/files/0001-Fix-detection-of-nouveau-in-case-its-builtin.patch
new file mode 100644
index 000000000..aaafd7da7
--- /dev/null
+++ b/dev-libs/libcuda/files/0001-Fix-detection-of-nouveau-in-case-its-builtin.patch
@@ -0,0 +1,26 @@
+From 605e69e70ce7b4c505be91696612e98649ec383f Mon Sep 17 00:00:00 2001
+From: Alexey Shvetsov <alexxy@gentoo.org>
+Date: Thu, 15 Nov 2012 08:29:04 +0400
+Subject: [PATCH 1/5] Fix detection of nouveau in case its builtin
+
+Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
+---
+ common/autogen.sh | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/common/autogen.sh b/common/autogen.sh
+index 469d3d8..1dca70f 100644
+--- a/common/autogen.sh
++++ b/common/autogen.sh
+@@ -4,6 +4,8 @@ if [ ! $(lsmod | grep nvidia | wc -l) -eq 0 ] ; then
+ driver='nvi'
+ elif [ ! $(lsmod | grep nouveau | wc -l) -eq 0 ] ; then
+ driver='nouveau'
++elif [ ! $(zgrep NOUVEAU /proc/config.gz | grep y | wc -l) -eq 0 ] ; then
++ driver='nouveau'
+ elif [ ! $(lsmod | grep pscnv | wc -l) -eq 0 ] ; then
+ driver='pscnv'
+ else
+--
+1.7.12.3
+
diff --git a/dev-libs/libcuda/files/0002-Fix-install-target-for-gdev-lib-userspace.patch b/dev-libs/libcuda/files/0002-Fix-install-target-for-gdev-lib-userspace.patch
new file mode 100644
index 000000000..797136fae
--- /dev/null
+++ b/dev-libs/libcuda/files/0002-Fix-install-target-for-gdev-lib-userspace.patch
@@ -0,0 +1,36 @@
+From 870f4cddb0233188ec1613a44eb9feb8c94469da Mon Sep 17 00:00:00 2001
+From: Alexey Shvetsov <alexxy@gentoo.org>
+Date: Thu, 15 Nov 2012 08:34:55 +0400
+Subject: [PATCH 2/5] Fix install target for gdev lib userspace
+
+Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
+---
+ lib/user/gdev/Makefile | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/lib/user/gdev/Makefile b/lib/user/gdev/Makefile
+index d602fa9..5440469 100644
+--- a/lib/user/gdev/Makefile
++++ b/lib/user/gdev/Makefile
+@@ -22,12 +22,12 @@ all: $(OBJS)
+ $(CC) -fPIC -c $^ -o $@ $(CFLAGS) $(EXTRA_LIBS)
+
+ install:
+- @if test ! -d $(GDEVDIR) ; then mkdir $(GDEVDIR) ; fi ;
+- @if test ! -d $(GDEVDIR)/lib64 ; then mkdir $(GDEVDIR)/lib64 ; fi ;
+- @if test ! -d $(GDEVDIR)/include ; then mkdir $(GDEVDIR)/include ; fi ;
+- cp -f ./$(TARGET).so.1.0.0 $(GDEVDIR)/lib64/
+- ln -sf $(GDEVDIR)/lib64/$(TARGET).so.1.0.0 $(GDEVDIR)/lib64/$(TARGET).so.1
+- ln -sf $(GDEVDIR)/lib64/$(TARGET).so.1 $(GDEVDIR)/lib64/$(TARGET).so
++ @if test ! -d $(GDEVDIR) ; then mkdir $(DESTDIR)/$(GDEVDIR) ; fi ;
++ @if test ! -d $(GDEVDIR)/lib64 ; then mkdir $(DESTDIR)/$(GDEVDIR)/lib64 ; fi ;
++ @if test ! -d $(GDEVDIR)/include ; then mkdir $(DESTDIR)/$(GDEVDIR)/include ; fi ;
++ cp -f ./$(TARGET).so.1.0.0 $(DESTDIR)/$(GDEVDIR)/lib64/
++ ln -sf $(GDEVDIR)/lib64/$(TARGET).so.1.0.0 $(DESTDIR)/$(GDEVDIR)/lib64/$(TARGET).so.1
++ ln -sf $(GDEVDIR)/lib64/$(TARGET).so.1 $(DESTDIR)/$(GDEVDIR)/lib64/$(TARGET).so
+ cp -f $(HEADERS) $(GDEVDIR)/include
+
+ uninstall:
+--
+1.7.12.3
+
diff --git a/dev-libs/libcuda/files/0003-Fix-install-target-for-gdev-lib-userspace-part2.patch b/dev-libs/libcuda/files/0003-Fix-install-target-for-gdev-lib-userspace-part2.patch
new file mode 100644
index 000000000..159ebd737
--- /dev/null
+++ b/dev-libs/libcuda/files/0003-Fix-install-target-for-gdev-lib-userspace-part2.patch
@@ -0,0 +1,35 @@
+From d99538f4e1f313c385a40ccff6aa3adff62ec55e Mon Sep 17 00:00:00 2001
+From: Alexey Shvetsov <alexxy@gentoo.org>
+Date: Thu, 15 Nov 2012 08:41:13 +0400
+Subject: [PATCH 3/5] Fix install target for gdev lib userspace part2
+
+Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
+---
+ lib/user/gdev/Makefile | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/lib/user/gdev/Makefile b/lib/user/gdev/Makefile
+index 5440469..31bee51 100644
+--- a/lib/user/gdev/Makefile
++++ b/lib/user/gdev/Makefile
+@@ -22,13 +22,13 @@ all: $(OBJS)
+ $(CC) -fPIC -c $^ -o $@ $(CFLAGS) $(EXTRA_LIBS)
+
+ install:
+- @if test ! -d $(GDEVDIR) ; then mkdir $(DESTDIR)/$(GDEVDIR) ; fi ;
+- @if test ! -d $(GDEVDIR)/lib64 ; then mkdir $(DESTDIR)/$(GDEVDIR)/lib64 ; fi ;
+- @if test ! -d $(GDEVDIR)/include ; then mkdir $(DESTDIR)/$(GDEVDIR)/include ; fi ;
++ @if test ! -d $(DESTDIR)/$(GDEVDIR) ; then mkdir $(DESTDIR)/$(GDEVDIR) ; fi ;
++ @if test ! -d $(DESTDIR)/$(GDEVDIR)/lib64 ; then mkdir $(DESTDIR)/$(GDEVDIR)/lib64 ; fi ;
++ @if test ! -d $(DESTDIR)/$(GDEVDIR)/include ; then mkdir $(DESTDIR)/$(GDEVDIR)/include ; fi ;
+ cp -f ./$(TARGET).so.1.0.0 $(DESTDIR)/$(GDEVDIR)/lib64/
+ ln -sf $(GDEVDIR)/lib64/$(TARGET).so.1.0.0 $(DESTDIR)/$(GDEVDIR)/lib64/$(TARGET).so.1
+ ln -sf $(GDEVDIR)/lib64/$(TARGET).so.1 $(DESTDIR)/$(GDEVDIR)/lib64/$(TARGET).so
+- cp -f $(HEADERS) $(GDEVDIR)/include
++ cp -f $(HEADERS) $(DESTDIR)/$(GDEVDIR)/include
+
+ uninstall:
+ rm -f $(GDEVDIR)/lib64/$(TARGET).*
+--
+1.7.12.3
+
diff --git a/dev-libs/libcuda/files/0004-Respect-extra-CFLAGS-and-LDFLAGS.patch b/dev-libs/libcuda/files/0004-Respect-extra-CFLAGS-and-LDFLAGS.patch
new file mode 100644
index 000000000..199da0bd2
--- /dev/null
+++ b/dev-libs/libcuda/files/0004-Respect-extra-CFLAGS-and-LDFLAGS.patch
@@ -0,0 +1,26 @@
+From 4f97a0ec262d190741f16d5d75c9305ee6a4318b Mon Sep 17 00:00:00 2001
+From: Alexey Shvetsov <alexxy@gentoo.org>
+Date: Thu, 15 Nov 2012 08:43:59 +0400
+Subject: [PATCH 4/5] Respect extra CFLAGS and LDFLAGS
+
+Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
+---
+ lib/user/gdev/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/user/gdev/Makefile b/lib/user/gdev/Makefile
+index 31bee51..d9c2200 100644
+--- a/lib/user/gdev/Makefile
++++ b/lib/user/gdev/Makefile
+@@ -16,7 +16,7 @@ OBJS = $(DRIVER_NAME)_gdev.o lib$(DRIVER_NAME).o lib$(DRIVER_NAME)_ib.o \
+ ZOMBIE = $(wildcard ./*~)
+
+ all: $(OBJS)
+- $(CC) -shared -Wl,-soname,$(TARGET).so.1 -o ./$(TARGET).so.1.0.0 $(OBJS) $(EXTRA_LIBS)
++ $(CC) $(LDFLAGS) -shared -Wl,-soname,$(TARGET).so.1 -o ./$(TARGET).so.1.0.0 $(OBJS) $(EXTRA_LIBS)
+
+ %.o:%.c
+ $(CC) -fPIC -c $^ -o $@ $(CFLAGS) $(EXTRA_LIBS)
+--
+1.7.12.3
+
diff --git a/dev-libs/libcuda/files/0005-Fix-install-target-for-cuda-lib.patch b/dev-libs/libcuda/files/0005-Fix-install-target-for-cuda-lib.patch
new file mode 100644
index 000000000..783f3c78b
--- /dev/null
+++ b/dev-libs/libcuda/files/0005-Fix-install-target-for-cuda-lib.patch
@@ -0,0 +1,47 @@
+From 720760c6a69cd3d8a3d7682327dbb234a5a473f5 Mon Sep 17 00:00:00 2001
+From: Alexey Shvetsov <alexxy@gentoo.org>
+Date: Thu, 15 Nov 2012 09:00:25 +0400
+Subject: [PATCH 5/5] Fix install target for cuda lib
+
+Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
+---
+ cuda/libcuda/Makefile | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/cuda/libcuda/Makefile b/cuda/libcuda/Makefile
+index 1a296bb..cdfd360 100644
+--- a/cuda/libcuda/Makefile
++++ b/cuda/libcuda/Makefile
+@@ -12,19 +12,21 @@ CUDUMP_OBJS = cudump.o gdev_cuda.o
+ ZOMBIE = $(wildcard ./*~)
+
+ all: $(OBJS)
+- $(CC) -shared -Wl,-soname,$(TARGET).so.1 -o ./$(TARGET).so.1.0.0 $(OBJS)
+- $(CC) $(CFLAGS) -o ./$(CUDUMP) $(CUDUMP).c gdev_cuda.c
++ $(CC) $(LDFLAGS) -shared -Wl,-soname,$(TARGET).so.1 -o ./$(TARGET).so.1.0.0 $(OBJS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o ./$(CUDUMP) $(CUDUMP).c gdev_cuda.c
+
+ %.o:%.c
+ $(CC) -fPIC -c $^ -o $@ $(CFLAGS)
+
+ install:
+- @if test ! -d $(GDEVDIR)/bin ; then mkdir $(GDEVDIR)/bin ; fi ;
+- cp -f ./$(CUDUMP) $(GDEVDIR)/bin/
+- cp -f ./$(TARGET).so.1.0.0 $(GDEVDIR)/lib64/
+- ln -sf $(GDEVDIR)/lib64/$(TARGET).so.1.0.0 $(GDEVDIR)/lib64/$(TARGET).so.1
+- ln -sf $(GDEVDIR)/lib64/$(TARGET).so.1 $(GDEVDIR)/lib64/$(TARGET).so
+- cp -f ./cuda.h $(GDEVDIR)/include
++ @if test ! -d $(DESTDIR)/$(GDEVDIR)/bin ; then mkdir -p $(DESTDIR)/$(GDEVDIR)/bin ; fi ;
++ @if test ! -d $(DESTDIR)/$(GDEVDIR)/lib64 ; then mkdir -p $(DESTDIR)/$(GDEVDIR)/lib64 ; fi ;
++ @if test ! -d $(DESTDIR)/$(GDEVDIR)/include ; then mkdir -p $(DESTDIR)/$(GDEVDIR)/include ; fi ;
++ cp -f ./$(CUDUMP) $(DESTDIR)/$(GDEVDIR)/bin/
++ cp -f ./$(TARGET).so.1.0.0 $(DESTDIR)/$(GDEVDIR)/lib64/
++ ln -sf $(GDEVDIR)/lib64/$(TARGET).so.1.0.0 $(DESTDIR)/$(GDEVDIR)/lib64/$(TARGET).so.1
++ ln -sf $(GDEVDIR)/lib64/$(TARGET).so.1 $(DESTDIR)/$(GDEVDIR)/lib64/$(TARGET).so
++ cp -f ./cuda.h $(DESTDIR)/$(GDEVDIR)/include
+
+ uninstall:
+ rm -f $(GDEVDIR)/lib64/$(TARGET).*
+--
+1.7.12.3
+
diff --git a/dev-libs/libcuda/libcuda-9999.ebuild b/dev-libs/libcuda/libcuda-9999.ebuild
new file mode 100644
index 000000000..cab476209
--- /dev/null
+++ b/dev-libs/libcuda/libcuda-9999.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+EGIT_PROJECT="gdev"
+
+inherit base git-2
+
+DESCRIPTION="Gdev is open-source GPGPU runtime"
+HOMEPAGE="https://github.com/shinpei0208/gdev"
+SRC_URI=""
+EGIT_REPO_URI="
+ git://github.com/shinpei0208/gdev.git
+ https://github.com/shinpei0208/gdev.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+RDEPEND="
+ dev-libs/libgdev
+ x11-libs/libdrm[video_cards_nouveau]
+ x11-misc/envytools"
+DEPEND="
+ virtual/pkgconfig
+ ${RDEPEND}"
+
+PATCHES=( "${FILESDIR}/0001-Fix-detection-of-nouveau-in-case-its-builtin.patch"
+ "${FILESDIR}/0002-Fix-install-target-for-gdev-lib-userspace.patch"
+ "${FILESDIR}/0003-Fix-install-target-for-gdev-lib-userspace-part2.patch"
+ "${FILESDIR}/0004-Respect-extra-CFLAGS-and-LDFLAGS.patch"
+ "${FILESDIR}/0005-Fix-install-target-for-cuda-lib.patch"
+ )
+
+src_configure() {
+ cd cuda
+ mkdir build
+ cd build
+ ../configure
+}
+
+src_compile() {
+ cd cuda/build
+ emake GDEVDIR="${EPREFIX}/usr"
+}
+
+src_install() {
+ cd cuda/build
+ emake GDEVDIR="${EPREFIX}/usr" DESTDIR="${D}" install
+}
diff --git a/dev-libs/libcuda/metadata.xml b/dev-libs/libcuda/metadata.xml
new file mode 100644
index 000000000..247f45889
--- /dev/null
+++ b/dev-libs/libcuda/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>alexxy@gentoo.org</email>
+ <name>Alexey Shvetsov</name>
+ </maintainer>
+</pkgmetadata>