summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD31
-rw-r--r--llvm-system-libs.patch12
3 files changed, 60 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d045d6bf911c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = sparse
+ pkgdesc = Semantic parser for C
+ pkgver = 0.5.0
+ pkgrel = 2
+ url = http://sparse.wiki.kernel.org/
+ arch = i686
+ arch = x86_64
+ license = custom:OSL
+ depends = perl
+ depends = libxml2
+ source = https://kernel.org/pub/software/devel/sparse/dist/sparse-0.5.0.tar.xz
+ source = llvm-system-libs.patch
+ sha256sums = 921fcf918c6778d1359f3886ac8cb4cf632faa6242627bc2ae2db75e983488d5
+ sha256sums = 7a924373612b1ee81472e831667e6997df9befd9f88791c916a9d1ca18c725b0
+
+pkgname = sparse
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..3886ecc9e735
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,31 @@
+# Maintainer: Omar Sandoval <osandov AT cs DOT washington DOT edu>
+# Contributor: Bartłomiej Piotrowski <bpiotrowski AT archlinux.org>
+# Contributor: Dan McGee <dpmcgee AT gmail.com>
+
+pkgname=sparse
+pkgver=0.5.0
+pkgrel=2
+pkgdesc='Semantic parser for C'
+arch=('i686' 'x86_64')
+url='http://sparse.wiki.kernel.org/'
+license=('custom:OSL')
+depends=('perl' 'libxml2')
+source=(https://kernel.org/pub/software/devel/sparse/dist/sparse-$pkgver.tar.xz
+ llvm-system-libs.patch)
+sha256sums=('921fcf918c6778d1359f3886ac8cb4cf632faa6242627bc2ae2db75e983488d5'
+ '7a924373612b1ee81472e831667e6997df9befd9f88791c916a9d1ca18c725b0')
+
+prepare() {
+ cd $pkgbase-$pkgver
+ patch -Np1 -i ../llvm-system-libs.patch
+}
+
+build() {
+ make -C $pkgname-$pkgver
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make PREFIX=/usr DESTDIR="$pkgdir" install
+ install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/sparse/LICENSE
+}
diff --git a/llvm-system-libs.patch b/llvm-system-libs.patch
new file mode 100644
index 000000000000..b001b8ea400b
--- /dev/null
+++ b/llvm-system-libs.patch
@@ -0,0 +1,12 @@
+diff --git a/Makefile b/Makefile
+index c3f3104..17bce6f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -87,6 +87,7 @@ $(LLVM_PROGS): LD := g++
+ LLVM_LDFLAGS := $(shell llvm-config --ldflags)
+ LLVM_CFLAGS := $(shell llvm-config --cflags | sed -e "s/-DNDEBUG//g")
+ LLVM_LIBS := $(shell llvm-config --libs)
++LLVM_LIBS += $(shell llvm-config --system-libs 2>/dev/null)
+ PROGRAMS += $(LLVM_PROGS)
+ INST_PROGRAMS += sparse-llvm sparsec
+ sparse-llvm.o: BASIC_CFLAGS += $(LLVM_CFLAGS)