From 12f03474272ecdcd01912ae8b8c650ce8fe0ab49 Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Wed, 28 Feb 2018 19:12:36 -0500 Subject: [PATCH] Add mprime --- src/mprime/PKGBUILD | 41 ++++++++++++++++++++++++++++++++ src/mprime/unfuck_makefile.patch | 24 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 src/mprime/PKGBUILD create mode 100644 src/mprime/unfuck_makefile.patch diff --git a/src/mprime/PKGBUILD b/src/mprime/PKGBUILD new file mode 100644 index 0000000..d52a3f4 --- /dev/null +++ b/src/mprime/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: graysky +# Contributer: xyne +# Contributer: TryA - https://bbs.archlinux.org/viewtopic.php?id=114996 + +pkgname=mprime +pkgver=294b7 +pkgrel=1 +pkgdesc="A GIMPS, distributed computing project client, dedicated to finding Mersenne primes." +arch=('x86_64') +url="http://www.mersenne.org" +license=('custom') +depends=('curl' 'hwloc') +conflicts=('mprime-bin') +source=("http://www.mersenne.org/ftp_root/gimps/p95v${pkgver}.source.zip" +unfuck_makefile.patch) +sha256sums=('15682e9587af2b86647de9786f97dc8c5d7a4a679a0440f7d1d1936a48c5aa45' + 'c94417f35f988e32693f9002792cbf21da85c2345670cb377066c9b799341528') + +prepare () { + patch -Np1 -i unfuck_makefile.patch +} + +build() { + cd "$srcdir/gwnum" + make -f make64 + + cd "$srcdir/linux64" + make +} + +package() { + install -Dm755 linux64/mprime "$pkgdir/usr/bin/mprime" + + # license and documentation + # x86_64 tarball for 279 includes none of these + #install -Dm644 license.txt "$pkgdir/usr/share/licenses/$pkgname/license.txt" + #install -Dm644 readme.txt "$pkgdir/usr/share/doc/$pkgname/readme.txt" + #install -Dm644 stress.txt "$pkgdir/usr/share/doc/$pkgname/stress.txt" + #install -Dm644 undoc.txt "$pkgdir/usr/share/doc/$pkgname/undoc.txt" + #install -Dm644 whatsnew.txt "$pkgdir/usr/share/doc/$pkgname/whatsnew.txt" +} diff --git a/src/mprime/unfuck_makefile.patch b/src/mprime/unfuck_makefile.patch new file mode 100644 index 0000000..c62a208 --- /dev/null +++ b/src/mprime/unfuck_makefile.patch @@ -0,0 +1,24 @@ +diff --git a/linux64/makefile b/linux64/makefile +index 329cb51..88acbc6 100644 +--- a/linux64/makefile ++++ b/linux64/makefile +@@ -20,15 +20,15 @@ + # LFLAGS = -Wl,-M + # LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic $(shell pkg-config --static --libs libhwloc) -Wl,-Bstatic $(shell pkg-config --static --libs libcurl) -lstdc++ -Wl,-Bdynamic -ldl + ++MPRIME_FLAGS=-I.. -I../gwnum -DX86_64 -march=x86-64 -O2 -Wno-unused-result + CC = gcc +-CFLAGS = -I.. -I../gwnum -I/usr/local/include -DX86_64 -O2 ++CFLAGS = ${MPRIME_FLAGS} + + CPP = g++ +-CPPFLAGS = -I.. -I../gwnum -DX86_64 -O2 ++CPPFLAGS = ${MPRIME_FLAGS} + + LFLAGS = -Wl,-M -Wl,-L/usr/local/lib +-#LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic -lhwloc -Wl,-Bstatic -lcurl -Wl,-Bdynamic -lrt -lstdc++ -lz -lxml2 -ldl -lgmp +-LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic -lhwloc -Wl,-Bstatic -lcurl -Wl,-Bdynamic -lrt -lstdc++ -ldl -lgmp ++LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread $(shell pkg-config --libs libcurl) -lstdc++ $(shell pkg-config --static --libs hwloc) -lgmp + + FACTOROBJ = factor64.o + LINUXOBJS = prime.o menu.o