diff options
author | Jieao Song | 2021-03-11 22:06:54 +0100 |
---|---|---|
committer | Jieao Song | 2021-03-11 22:38:50 +0100 |
commit | 759f4e9a5ca3ee219e18c9d3d1b33111d7c204b8 (patch) | |
tree | 78d40aca8bf2635b4f66c08916ec6507cc50e728 | |
download | aur-759f4e9a5ca3ee219e18c9d3d1b33111d7c204b8.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | surf.patch | 41 |
3 files changed, 95 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..916555939b89 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = surf-geometry + pkgdesc = Visualization of real algebraic geometry + pkgver = 1.0.6 + pkgrel = 1 + url = http://surf.sourceforge.net/ + arch = i686 + arch = x86_64 + license = GPL + optdepends = gtk + conflicts = surf + source = https://downloads.sourceforge.net/surf/surf-1.0.6.tar.gz + source = surf.patch + sha1sums = b901a4640c5fe321d9161bcbd99cf93141be59d9 + sha1sums = c3e05a36413281ac1581585aad18f44381fa2472 + +pkgname = surf-geometry + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..6023b9b4b817 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: Jieao Song <8d1h at tutanota dot com> + +pkgname=surf-geometry +pkgver=1.0.6 +pkgrel=1 +pkgdesc="Visualization of real algebraic geometry" +arch=('i686' 'x86_64') +url="http://surf.sourceforge.net/" +license=('GPL') +optdepends=('gtk') +conflicts=('surf') +source=("https://downloads.sourceforge.net/surf/surf-$pkgver.tar.gz" 'surf.patch') +sha1sums=('b901a4640c5fe321d9161bcbd99cf93141be59d9' 'c3e05a36413281ac1581585aad18f44381fa2472') + +prepare() { + cd "$srcdir/surf-$pkgver" + patch --forward --strip=1 --input="$srcdir"/surf.patch +} + +build() { + cd "$srcdir/surf-$pkgver" + export CXXFLAGS="-std=c++14 $CFLAGS" + + # add the flag --disable-gui if gtk is not available + if [[ -z $(command -v "gtk-config") ]]; then + ./configure --prefix=/usr --disable-gui + else + ./configure --prefix=/usr + fi + make clean + make +} + +package() { + cd "$srcdir/surf-$pkgver" + make DESTDIR="$pkgdir" install +} diff --git a/surf.patch b/surf.patch new file mode 100644 index 000000000000..54a8b0859213 --- /dev/null +++ b/surf.patch @@ -0,0 +1,41 @@ +diff -upr surf-1.0.6.orig/Makefile.in surf-1.0.6/Makefile.in +--- surf-1.0.6.orig/Makefile.in 2021-03-11 20:15:21.526463425 +0100 ++++ surf-1.0.6/Makefile.in 2021-03-11 20:18:49.824063612 +0100 +@@ -496,8 +496,10 @@ installdirs mostlyclean-generic distclea + maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +-@CUPS_TRUE@surf: $(LOCAL_OBJECTS) $(GTKGUI_OBJ) +-@CUPS_TRUE@ $(CXX) $(LOCAL_OBJECTS) $(GTKGUI_OBJ) -o surf $(LDFLAGS) -lXmu -lXext -lXt @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ $(LIBS) -lfl @GTK_LIBS@ -lcups ++@CUPS_TRUE@@GUI_TRUE@surf: $(LOCAL_OBJECTS) $(GTKGUI_OBJ) ++@CUPS_TRUE@@GUI_TRUE@ $(CXX) $(LOCAL_OBJECTS) $(GTKGUI_OBJ) -o surf $(LDFLAGS) -lXmu -lXext -lXt @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ $(LIBS) -lfl @GTK_LIBS@ -lcups ++@CUPS_TRUE@@GUI_FALSE@surf: $(LOCAL_OBJECTS) ++@CUPS_TRUE@@GUI_FALSE@ $(CXX) $(LOCAL_OBJECTS) -o surf $(LDFLAGS) $(LIBS) -lfl -lcups + @CUPS_FALSE@@GUI_TRUE@surf: $(LOCAL_OBJECTS) $(GTKGUI_OBJ) + @CUPS_FALSE@@GUI_TRUE@ $(CXX) $(LOCAL_OBJECTS) $(GTKGUI_OBJ) -o surf $(LDFLAGS) -lXmu -lXext -lXt @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ $(LIBS) -lfl @GTK_LIBS@ + @CUPS_FALSE@@GUI_FALSE@surf: $(LOCAL_OBJECTS) +diff -upr surf-1.0.6.orig/src/def.h surf-1.0.6/src/def.h +--- surf-1.0.6.orig/src/def.h 2021-03-11 20:15:21.509796951 +0100 ++++ surf-1.0.6/src/def.h 2021-03-11 20:16:13.329195822 +0100 +@@ -83,7 +83,9 @@ enum {red,green,blue}; /* sk */ + + #define MIN(a,b) ( ((a)<(b))?(a):(b) ) + #ifndef min +-#define min(a,b) ( ((a)<(b))?(a):(b) ) ++static inline int min(int a, int b) { return MIN(a,b); } ++static inline float min(float a, float b) { return MIN(a,b); } ++static inline double min(double a, double b) { return MIN(a,b); } + #endif + + #ifdef MAX +@@ -92,7 +94,9 @@ enum {red,green,blue}; /* sk */ + + #define MAX(a,b) ( ((a)<(b))?(b):(a) ) + #ifndef max +-#define max(a,b) ( ((a)<(b))?(b):(a) ) ++static inline int max(int a, int b) { return MAX(a,b); } ++static inline float max(float a, float b) { return MAX(a,b); } ++static inline double max(double a, double b) { return MAX(a,b); } + #endif + + |