Re: [UPDATE] math/lrs -> 071a

2020-11-21 Thread Dimitri Karamazov
On Sat, November 21, 2020 13:05, Stuart Henderson wrote:
> Now it's committed here's some clean-up.
>
>
> - don't patch away upstream's INCLUDEDIR/LIBDIR mechanism to replace
> it with something using CPPFLAGS/LDFLAGS which does exactly the same; 
> simplifies the patch
>
> patch-makefile |  115 +++--- 1 file changed, 
> 23 insertions(+), 92 deletions(-)
>
>
> - building the targets chosen for the port requires a compiler with
> 128-bit int support; afaik this requires clang, or GCC 4.6 or newer,
> and a 64-bit arch. So I've set the compiler and restricted archs. 
> (alternatively we could use "ALL_TARGETS=lrs64" on
> those archs but that would mean extra mess with arch-specific PLISTs).
>
> - simplify the test target
>
>
> ok?
>
Works fine here, but what's the significance of COMPILER_LANGS?
What could break without it?

>
> Index: Makefile
> ===
> RCS file: /cvs/ports/math/lrs/Makefile,v
> retrieving revision 1.7 diff -u -p -r1.7 Makefile --- Makefile20 Nov 
> 2020 19:16:18 -  1.7
> +++ Makefile  21 Nov 2020 12:59:07 -
> @@ -3,6 +3,7 @@
> COMMENT = solve vertex enumeration and convex hull problems
>
>
> V =   071a
> +REVISION =   0
> DISTNAME =lrslib-${V}
> PKGNAME = lrs-${V}
> FIX_EXTRACT_PERMISSIONS=Yes
> @@ -25,22 +26,24 @@ MASTER_SITES =http://cgm.cs.mcgill.ca/
> USE_GMAKE =   Yes
>
>
> MAKE_FILE =   makefile
> -MAKE_FLAGS = CPPFLAGS=-I${LOCALBASE}/include \
> - LDFLAGS=-L${LOCALBASE}/lib \
> +MAKE_FLAGS = INCLUDEDIR="${LOCALBASE}/include" \
> + LIBDIR="${LOCALBASE}/lib" \
> CFLAGS="${CFLAGS} -Wall" \
> SONAME="liblrs.so.${LIBlrs_VERSION:R}" \
> SOMINOR=".${LIBlrs_VERSION:E}"
>
>
> -ALL_TARGET = lrs lrsnash single all-shared
> -
> LIB_DEPENDS = devel/gmp
>
>
> +# targets "lrs", "lrsnash", "single", "all-shared" require 128-bit ints
> +COMPILER =   base-clang ports-gcc
> +COMPILER_LANGS = c
> +ONLY_FOR_ARCHS = ${LP64_ARCHS}
> +ALL_TARGET = lrs lrsnash single all-shared
> +
> # A simple test to check it works
> -REGRESS_FILES =  test.ine expected_outcome.ine openbsd_regress.sh
> do-test:
> -.for i in ${REGRESS_FILES}
> - cp ${FILESDIR}/${i} ${WRKBUILD}
> -.endfor
> + cd ${FILESDIR} && \
> + cp test.ine expected_outcome.ine openbsd_regress.sh ${WRKBUILD}
> cd ${WRKBUILD} && sh openbsd_regress.sh
>
> .include 
> Index: patches/patch-makefile
> ===
> RCS file: /cvs/ports/math/lrs/patches/patch-makefile,v
> retrieving revision 1.2 diff -u -p -r1.2 patch-makefile --- 
> patches/patch-makefile20 Nov 2020 19:16:18 -  1.2
> +++ patches/patch-makefile21 Nov 2020 12:59:07 -
> @@ -1,95 +1,39 @@
> $OpenBSD: patch-makefile,v 1.2 2020/11/20 19:16:18 edd Exp $
>
>
> -Honour CFLAGS, LDFLAGS, CPPFLAGS
> +Honour CFLAGS
> Avoid library symlinks
> Rectify install targets
>
>
>  makefile.origSat Oct 17 11:48:42 2020
> -+++ makefile Thu Nov 19 07:01:15 2020
> -@@ -51,14 +51,14 @@ LRSOBJ64=lrs64.o lrslong1.o lrslib1.o lrslibgmp.o lrsg
> - MPLRSOBJ64=lrslong1-mplrs.o lrslib1-mplrs.o lrslibgmp-mplrs.o 
> lrsgmp-mplrs.o lrsdriver-mplrs.o mplrs64.o
> +Index: makefile
> +--- makefile.orig
>  makefile
> +@@ -52,8 +52,8 @@ MPLRSOBJ64=lrslong1-mplrs.o lrslib1-mplrs.o lrslibgmp-
>
>
> lrs: ${LRSOBJ}
> --$(CC) ${CFLAGS} -DMA -DB128 -L${LIBDIR} -o lrs ${LRSOBJ} -lgmp
> + $(CC) ${CFLAGS} -DMA -DB128 -L${LIBDIR} -o lrs ${LRSOBJ} -lgmp
> - $(CC)  -O3   -DGMP -I${INCLUDEDIR} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
> lrsdriver.c -L${LIBDIR}  -lgmp
> - $(CC) -O3 hvref.c -o hvref
> -+$(CC) ${CFLAGS} -DMA -DB128 ${LDFLAGS} -o lrs ${LRSOBJ} -lgmp
> -+$(CC) ${CFLAGS} -DGMP ${CPPFLAGS} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
> lrsdriver.c ${LDFLAGS} -lgmp
> ++$(CC) ${CFLAGS} -DGMP -I${INCLUDEDIR} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
> lrsdriver.c -L${LIBDIR} -lgmp
> + $(CC) ${CFLAGS} hvref.c -o hvref
> ln -s -f lrs redund ln -s -f lrsgmp redundgmp
>
> - lrs64: ${LRSOBJ64}
> --$(CC) ${CFLAGS} -DMA -L${LIBDIR} -o lrs ${LRSOBJ64} -lgmp
> -+$(CC) ${CFLAGS} -DMA ${LDFLAGS} -o lrs ${LRSOBJ64} -lgmp
> -
> - lrs.o: lrs.c
> - $(CC) ${CFLAGS} -DMA -DB128 -c -o lrs.o lrs.c
> -@@ -79,10 +79,10 @@ lrslib2.o: lrslib.c lrslib.h
> - $(CC) ${CFLAGS} -DMA -DSAFE -DB128 -DLRSLONG -c -o lrslib2.o lrslib.c
> -
> - lrslibgmp.o: lrslib.c lrslib.h
> --$(CC) ${CFLAGS} -DMA -DGMP -I${INCLUDEDIR} -c -o lrslibgmp.o lrslib.c
> -+$(CC) ${CFLAGS} -DMA -DGMP ${CPPFLAGS} -c -o lrslibgmp.o lrslib.c
> -
> - lrsgmp.o: lrsgmp.c lrsgmp.h
> --$(CC) ${CFLAGS} -DMA -DGMP -I${INCLUDEDIR} -c -o lrsgmp.o lrsgmp.c
> -+$(CC) ${CFLAGS} -DMA -DGMP ${CPPFLAGS} -c -o lrsgmp.o lrsgmp.c
> -
> -
> - lrslong1-mplrs.o: lrslong.c 

Re: [UPDATE] math/lrs -> 071a

2020-11-21 Thread Stuart Henderson
On 2020/11/21 14:08, Dimitri Karamazov wrote:
> On Sat, November 21, 2020 13:05, Stuart Henderson wrote:
> > Now it's committed here's some clean-up.
> >
> >
> > - don't patch away upstream's INCLUDEDIR/LIBDIR mechanism to replace
> > it with something using CPPFLAGS/LDFLAGS which does exactly the same; 
> > simplifies the patch
> >
> > patch-makefile |  115 +++--- 1 file 
> > changed, 23 insertions(+), 92 deletions(-)
> >
> >
> > - building the targets chosen for the port requires a compiler with
> > 128-bit int support; afaik this requires clang, or GCC 4.6 or newer,
> > and a 64-bit arch. So I've set the compiler and restricted archs. 
> > (alternatively we could use "ALL_TARGETS=lrs64" on
> > those archs but that would mean extra mess with arch-specific PLISTs).
> >
> > - simplify the test target
> >
> >
> > ok?
> >
> Works fine here, but what's the significance of COMPILER_LANGS?
> What could break without it?

The port will still work without it, but it will add an unnecessary
LIB_DEPENDS on gcc-libs for libestdc++.


> > Index: Makefile
> > ===
> > RCS file: /cvs/ports/math/lrs/Makefile,v
> > retrieving revision 1.7 diff -u -p -r1.7 Makefile --- Makefile  20 Nov 
> > 2020 19:16:18 -  1.7
> > +++ Makefile21 Nov 2020 12:59:07 -
> > @@ -3,6 +3,7 @@
> > COMMENT =   solve vertex enumeration and convex hull problems
> >
> >
> > V = 071a
> > +REVISION = 0
> > DISTNAME =  lrslib-${V}
> > PKGNAME =   lrs-${V}
> > FIX_EXTRACT_PERMISSIONS=Yes
> > @@ -25,22 +26,24 @@ MASTER_SITES =  http://cgm.cs.mcgill.ca/
> > USE_GMAKE = Yes
> >
> >
> > MAKE_FILE = makefile
> > -MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include \
> > -   LDFLAGS=-L${LOCALBASE}/lib \
> > +MAKE_FLAGS =   INCLUDEDIR="${LOCALBASE}/include" \
> > +   LIBDIR="${LOCALBASE}/lib" \
> > CFLAGS="${CFLAGS} -Wall" \
> > SONAME="liblrs.so.${LIBlrs_VERSION:R}" \
> > SOMINOR=".${LIBlrs_VERSION:E}"
> >
> >
> > -ALL_TARGET =   lrs lrsnash single all-shared
> > -
> > LIB_DEPENDS =   devel/gmp
> >
> >
> > +# targets "lrs", "lrsnash", "single", "all-shared" require 128-bit ints
> > +COMPILER = base-clang ports-gcc
> > +COMPILER_LANGS =   c
> > +ONLY_FOR_ARCHS =   ${LP64_ARCHS}
> > +ALL_TARGET =   lrs lrsnash single all-shared
> > +
> > # A simple test to check it works
> > -REGRESS_FILES =test.ine expected_outcome.ine openbsd_regress.sh
> > do-test:
> > -.for i in ${REGRESS_FILES}
> > -   cp ${FILESDIR}/${i} ${WRKBUILD}
> > -.endfor
> > +   cd ${FILESDIR} && \
> > +   cp test.ine expected_outcome.ine openbsd_regress.sh ${WRKBUILD}
> > cd ${WRKBUILD} && sh openbsd_regress.sh
> >
> > .include 
> > Index: patches/patch-makefile
> > ===
> > RCS file: /cvs/ports/math/lrs/patches/patch-makefile,v
> > retrieving revision 1.2 diff -u -p -r1.2 patch-makefile --- 
> > patches/patch-makefile  20 Nov 2020 19:16:18 -  1.2
> > +++ patches/patch-makefile  21 Nov 2020 12:59:07 -
> > @@ -1,95 +1,39 @@
> > $OpenBSD: patch-makefile,v 1.2 2020/11/20 19:16:18 edd Exp $
> >
> >
> > -Honour CFLAGS, LDFLAGS, CPPFLAGS
> > +Honour CFLAGS
> > Avoid library symlinks
> > Rectify install targets
> >
> >
> >  makefile.orig  Sat Oct 17 11:48:42 2020
> > -+++ makefile   Thu Nov 19 07:01:15 2020
> > -@@ -51,14 +51,14 @@ LRSOBJ64=lrs64.o lrslong1.o lrslib1.o lrslibgmp.o lrsg
> > - MPLRSOBJ64=lrslong1-mplrs.o lrslib1-mplrs.o lrslibgmp-mplrs.o 
> > lrsgmp-mplrs.o lrsdriver-mplrs.o mplrs64.o
> > +Index: makefile
> > +--- makefile.orig
> >  makefile
> > +@@ -52,8 +52,8 @@ MPLRSOBJ64=lrslong1-mplrs.o lrslib1-mplrs.o lrslibgmp-
> >
> >
> > lrs: ${LRSOBJ}
> > --  $(CC) ${CFLAGS} -DMA -DB128 -L${LIBDIR} -o lrs ${LRSOBJ} -lgmp
> > +   $(CC) ${CFLAGS} -DMA -DB128 -L${LIBDIR} -o lrs ${LRSOBJ} -lgmp
> > -   $(CC)  -O3   -DGMP -I${INCLUDEDIR} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
> > lrsdriver.c -L${LIBDIR}  -lgmp
> > -   $(CC) -O3 hvref.c -o hvref
> > -+  $(CC) ${CFLAGS} -DMA -DB128 ${LDFLAGS} -o lrs ${LRSOBJ} -lgmp
> > -+  $(CC) ${CFLAGS} -DGMP ${CPPFLAGS} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
> > lrsdriver.c ${LDFLAGS} -lgmp
> > ++  $(CC) ${CFLAGS} -DGMP -I${INCLUDEDIR} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
> > lrsdriver.c -L${LIBDIR} -lgmp
> > +   $(CC) ${CFLAGS} hvref.c -o hvref
> > ln -s -f lrs redund ln -s -f lrsgmp redundgmp
> >
> > - lrs64: ${LRSOBJ64}
> > --  $(CC) ${CFLAGS} -DMA -L${LIBDIR} -o lrs ${LRSOBJ64} -lgmp
> > -+  $(CC) ${CFLAGS} -DMA ${LDFLAGS} -o lrs ${LRSOBJ64} -lgmp
> > -
> > - lrs.o: lrs.c
> > -   $(CC) ${CFLAGS} -DMA -DB128 -c -o lrs.o lrs.c
> > -@@ -79,10 +79,10 @@ lrslib2.o: lrslib.c lrslib.h
> > -   $(CC) ${CFLAGS} -DMA -DSAFE -DB128 -DLRSLONG -c -o lrslib2.o lrslib.c
> > -
> > - lrslibgmp.o: lrslib.c 

Re: [UPDATE] math/lrs -> 071a

2020-11-21 Thread Stuart Henderson
Now it's committed here's some clean-up.

- don't patch away upstream's INCLUDEDIR/LIBDIR mechanism to replace
it with something using CPPFLAGS/LDFLAGS which does exactly the same;
simplifies the patch

 patch-makefile |  115 +++---
 1 file changed, 23 insertions(+), 92 deletions(-)

- building the targets chosen for the port requires a compiler with
128-bit int support; afaik this requires clang, or GCC 4.6 or newer,
and a 64-bit arch. So I've set the compiler and restricted archs.
(alternatively we could use "ALL_TARGETS=lrs64" on those archs but that
would mean extra mess with arch-specific PLISTs).

- simplify the test target

ok?


Index: Makefile
===
RCS file: /cvs/ports/math/lrs/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- Makefile20 Nov 2020 19:16:18 -  1.7
+++ Makefile21 Nov 2020 12:59:07 -
@@ -3,6 +3,7 @@
 COMMENT =  solve vertex enumeration and convex hull problems
 
 V =071a
+REVISION = 0
 DISTNAME = lrslib-${V}
 PKGNAME =  lrs-${V}
 FIX_EXTRACT_PERMISSIONS=Yes
@@ -25,22 +26,24 @@ MASTER_SITES =  http://cgm.cs.mcgill.ca/
 USE_GMAKE =Yes
 
 MAKE_FILE =makefile
-MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include \
-   LDFLAGS=-L${LOCALBASE}/lib \
+MAKE_FLAGS =   INCLUDEDIR="${LOCALBASE}/include" \
+   LIBDIR="${LOCALBASE}/lib" \
CFLAGS="${CFLAGS} -Wall" \
SONAME="liblrs.so.${LIBlrs_VERSION:R}" \
SOMINOR=".${LIBlrs_VERSION:E}"
 
-ALL_TARGET =   lrs lrsnash single all-shared
-
 LIB_DEPENDS =  devel/gmp
 
+# targets "lrs", "lrsnash", "single", "all-shared" require 128-bit ints
+COMPILER = base-clang ports-gcc
+COMPILER_LANGS =   c
+ONLY_FOR_ARCHS =   ${LP64_ARCHS}
+ALL_TARGET =   lrs lrsnash single all-shared
+
 # A simple test to check it works
-REGRESS_FILES =test.ine expected_outcome.ine openbsd_regress.sh
 do-test:
-.for i in ${REGRESS_FILES}
-   cp ${FILESDIR}/${i} ${WRKBUILD}
-.endfor
+   cd ${FILESDIR} && \
+   cp test.ine expected_outcome.ine openbsd_regress.sh ${WRKBUILD}
cd ${WRKBUILD} && sh openbsd_regress.sh
 
 .include 
Index: patches/patch-makefile
===
RCS file: /cvs/ports/math/lrs/patches/patch-makefile,v
retrieving revision 1.2
diff -u -p -r1.2 patch-makefile
--- patches/patch-makefile  20 Nov 2020 19:16:18 -  1.2
+++ patches/patch-makefile  21 Nov 2020 12:59:07 -
@@ -1,95 +1,39 @@
 $OpenBSD: patch-makefile,v 1.2 2020/11/20 19:16:18 edd Exp $
 
-Honour CFLAGS, LDFLAGS, CPPFLAGS
+Honour CFLAGS
 Avoid library symlinks
 Rectify install targets
 
 makefile.orig  Sat Oct 17 11:48:42 2020
-+++ makefile   Thu Nov 19 07:01:15 2020
-@@ -51,14 +51,14 @@ LRSOBJ64=lrs64.o lrslong1.o lrslib1.o lrslibgmp.o lrsg
- MPLRSOBJ64=lrslong1-mplrs.o lrslib1-mplrs.o lrslibgmp-mplrs.o lrsgmp-mplrs.o 
lrsdriver-mplrs.o mplrs64.o
+Index: makefile
+--- makefile.orig
 makefile
+@@ -52,8 +52,8 @@ MPLRSOBJ64=lrslong1-mplrs.o lrslib1-mplrs.o lrslibgmp-
  
  lrs: ${LRSOBJ}
--  $(CC) ${CFLAGS} -DMA -DB128 -L${LIBDIR} -o lrs ${LRSOBJ} -lgmp
+   $(CC) ${CFLAGS} -DMA -DB128 -L${LIBDIR} -o lrs ${LRSOBJ} -lgmp
 -  $(CC)  -O3   -DGMP -I${INCLUDEDIR} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
lrsdriver.c -L${LIBDIR}  -lgmp
 -  $(CC) -O3 hvref.c -o hvref
-+  $(CC) ${CFLAGS} -DMA -DB128 ${LDFLAGS} -o lrs ${LRSOBJ} -lgmp
-+  $(CC) ${CFLAGS} -DGMP ${CPPFLAGS} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
lrsdriver.c ${LDFLAGS} -lgmp
++  $(CC) ${CFLAGS} -DGMP -I${INCLUDEDIR} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
lrsdriver.c -L${LIBDIR} -lgmp
 +  $(CC) ${CFLAGS} hvref.c -o hvref
ln -s -f lrs redund
ln -s -f lrsgmp redundgmp
  
- lrs64: ${LRSOBJ64}
--  $(CC) ${CFLAGS} -DMA -L${LIBDIR} -o lrs ${LRSOBJ64} -lgmp
-+  $(CC) ${CFLAGS} -DMA ${LDFLAGS} -o lrs ${LRSOBJ64} -lgmp
- 
- lrs.o: lrs.c
-   $(CC) ${CFLAGS} -DMA -DB128 -c -o lrs.o lrs.c
-@@ -79,10 +79,10 @@ lrslib2.o: lrslib.c lrslib.h
-   $(CC) ${CFLAGS} -DMA -DSAFE -DB128 -DLRSLONG -c -o lrslib2.o lrslib.c
- 
- lrslibgmp.o: lrslib.c lrslib.h
--  $(CC) ${CFLAGS} -DMA -DGMP -I${INCLUDEDIR} -c -o lrslibgmp.o lrslib.c
-+  $(CC) ${CFLAGS} -DMA -DGMP ${CPPFLAGS} -c -o lrslibgmp.o lrslib.c
- 
- lrsgmp.o: lrsgmp.c lrsgmp.h
--  $(CC) ${CFLAGS} -DMA -DGMP -I${INCLUDEDIR} -c -o lrsgmp.o lrsgmp.c
-+  $(CC) ${CFLAGS} -DMA -DGMP ${CPPFLAGS} -c -o lrsgmp.o lrsgmp.c
- 
- 
- lrslong1-mplrs.o: lrslong.c lrslong.h
-@@ -98,28 +98,28 @@ lrslib2-mplrs.o: lrslib.c lrslib.h
-   $(mpicxx) ${CFLAGS} -DTIMES -DSIGNALS -DMA -DSAFE -DB128 -DLRSLONG 
-DPLRS -c -o lrslib2-mplrs.o lrslib.c
- 
- lrslibgmp-mplrs.o: 

Re: [UPDATE] math/lrs -> 071a

2020-11-18 Thread Dimitri Karamazov
On Wed, November 18, 2020 22:02, Stuart Henderson wrote:
> On 2020/11/18 21:14, Edd Barrett wrote:
>
>> On Wed, Nov 18, 2020 at 10:42:17AM -, Dimitri Karamazov wrote:
>>
>>> diff attached below with all the rest of the changes.
>>
>> Thanks!
>>
>>
>> I was about to commit this when I noticed that there's a sole compiler
>> invocation which is not honouring our flags:
>>
>> ```
>> cc -DGMP -DMA lrsnash.c  lrsnashlib.c -I/usr/local/include -o lrsnash-shared 
>> -L . -L/usr/local/lib -llrs -lgmp ```
>>
>>
>> If you can fix that, I'll commit the diff :)
Fixed

>
> btw there are some other parts of the Makefile patch that can be simplified 
> but they could be handled later.
> Specifically, unlike
> CFLAGS/CXXFLAGS, ports doesn't have any claim to honour CPPFLAGS or
> LDFLAGS as user settings so there's no need to change the existing
> -L${LIBDIR} -> ${LDFLAGS} or -I${INCLUDEDIR} -> ${CPPFLAGS},
> as long as it's using the correct dir.
>
> Many ports do use CPPFLAGS/LDFLAGS to pass things in but this is
> normally where the upstream build system already honours them. Where upstream 
> uses another mechanism (like
> LIBDIR/INCLUDEDIR here)
> it's less hassle to work with that instead.
>
Upstream is less likely to accept since it is just another mechanism,
I guess it is not possible/unlikely to change location of LOCALBASE so
it will be redundant anyway.

diff with LDFLAGS and CPPFLAGS defined exists as an attachment, just in
case.

This one simply introduces CFLAGS based on Stuart's comments.
Hope there is no confusion :)

Index: Makefile
===
RCS file: /cvs/ports/math/lrs/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile12 Jul 2019 20:47:42 -  1.6
+++ Makefile19 Nov 2020 02:22:25 -
@@ -2,35 +2,36 @@

 COMMENT =  solve vertex enumeration and convex hull problems

-DISTNAME = lrslib-042c
-PKGNAME =  lrs-042
-REVISION = 1
+V =071a
+DISTNAME = lrslib-${V}
+PKGNAME =  lrs-${V}
 FIX_EXTRACT_PERMISSIONS=Yes

+SHARED_LIBS =  lrs 0.0 # 1.0
+
 CATEGORIES =   math

 HOMEPAGE = http://cgm.cs.mcgill.ca/~avis/C/lrs.html

-MAINTAINER =   Edd Barrett 
+MAINTAINER =   Dimitri Karamazov 

 # GPLv2
 PERMIT_PACKAGE =   Yes

 WANTLIB =  c gmp

-MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/
+MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/
+
+USE_GMAKE =Yes

 MAKE_FILE =makefile
-MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include 
LDFLAGS=-L${LOCALBASE}/lib
-ALL_TARGET =   gmp # build with arbitrary precision numbers
+MAKE_FLAGS =   CFLAGS="${CFLAGS} -Wall" \
+   SONAME="liblrs.so.${LIBlrs_VERSION:R}" \
+   SOMINOR=".${LIBlrs_VERSION:E}"

-LIB_DEPENDS =  devel/gmp
+ALL_TARGET =   lrs lrsnash single all-shared

-BINARIES = 2gnash buffer gfourier glrs gnash gredund
-do-install:
-.for i in ${BINARIES}
-   ${INSTALL_PROGRAM} ${WRKBUILD}/${i} ${PREFIX}/bin/
-.endfor
+LIB_DEPENDS =  devel/gmp

 # A simple test to check it works
 REGRESS_FILES =test.ine expected_outcome.ine openbsd_regress.sh
@@ -39,10 +40,5 @@ do-test:
cp ${FILESDIR}/${i} ${WRKBUILD}
 .endfor
cd ${WRKBUILD} && sh openbsd_regress.sh
-
-# resolve conflict with www/gnash and misc/buffer
-post-install:
-   mv ${PREFIX}/bin/gnash ${PREFIX}/bin/lrsgnash
-   mv ${PREFIX}/bin/buffer ${PREFIX}/bin/lrsbuffer

 .include 
Index: distinfo
===
RCS file: /cvs/ports/math/lrs/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo18 Jan 2015 03:14:27 -  1.2
+++ distinfo19 Nov 2020 02:22:25 -
@@ -1,2 +1,2 @@
-SHA256 (lrslib-042c.tar.gz) = U/mbUnE5e7XzF8lvo2Xtwaxx+ny6ApXIvXngiC9cOko=
-SIZE (lrslib-042c.tar.gz) = 168765
+SHA256 (lrslib-071a.tar.gz) = kmY26mjeRmJfFB9uAl3OlnzH5oz0v0pZc3XAY/XBFnM=
+SIZE (lrslib-071a.tar.gz) = 458590
Index: files/openbsd_regress.sh
===
RCS file: /cvs/ports/math/lrs/files/openbsd_regress.sh,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 openbsd_regress.sh
--- files/openbsd_regress.sh7 Oct 2011 08:58:42 -   1.1.1.1
+++ files/openbsd_regress.sh19 Nov 2020 02:22:25 -
@@ -5,7 +5,7 @@ IN=test.ine
 OUT=actual_outcome.ine
 EXPECT=expected_outcome.ine

-./glrs ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}
+./lrsgmp ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}

 DIFF=`diff -u ${OUT} ${EXPECT}`
 if [ -n "${DIFF}" ]; then
Index: patches/patch-makefile
===
RCS file: /cvs/ports/math/lrs/patches/patch-makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 

Re: [UPDATE] math/lrs -> 071a

2020-11-18 Thread Stuart Henderson
On 2020/11/18 21:14, Edd Barrett wrote:
> On Wed, Nov 18, 2020 at 10:42:17AM -, Dimitri Karamazov wrote:
> > diff attached below with all the rest of the changes.
> 
> Thanks!
> 
> I was about to commit this when I noticed that there's a sole compiler
> invocation which is not honouring our flags:
> 
> ```
> cc -DGMP -DMA lrsnash.c  lrsnashlib.c -I/usr/local/include -o lrsnash-shared 
> -L . -L/usr/local/lib -llrs -lgmp
> ```
> 
> If you can fix that, I'll commit the diff :)
> 
> -- 
> Best Regards
> Edd Barrett
> 
> http://www.theunixzoo.co.uk

btw there are some other parts of the Makefile patch that can be
simplified but they could be handled later. Specifically, unlike
CFLAGS/CXXFLAGS, ports doesn't have any claim to honour CPPFLAGS or
LDFLAGS as user settings so there's no need to change the existing
-L${LIBDIR} -> ${LDFLAGS} or -I${INCLUDEDIR} -> ${CPPFLAGS},
as long as it's using the correct dir.

Many ports do use CPPFLAGS/LDFLAGS to pass things in but this is
normally where the upstream build system already honours them.
Where upstream uses another mechanism (like LIBDIR/INCLUDEDIR here)
it's less hassle to work with that instead.



Re: [UPDATE] math/lrs -> 071a

2020-11-18 Thread Edd Barrett
On Wed, Nov 18, 2020 at 10:42:17AM -, Dimitri Karamazov wrote:
> diff attached below with all the rest of the changes.

Thanks!

I was about to commit this when I noticed that there's a sole compiler
invocation which is not honouring our flags:

```
cc -DGMP -DMA lrsnash.c  lrsnashlib.c -I/usr/local/include -o lrsnash-shared -L 
. -L/usr/local/lib -llrs -lgmp
```

If you can fix that, I'll commit the diff :)

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



Re: [UPDATE] math/lrs -> 071a

2020-11-18 Thread Dimitri Karamazov
On Wed, November 18, 2020 11:14, Stuart Henderson wrote:
> On 2020/11/18 02:39, Dimitri Karamazov wrote:
>
>> On Tue, November 17, 2020 21:01, Edd Barrett wrote:
>>
>>> If another dev OKs this (and specifically checks the 'a' suffix on the
>>> version number), I'd be happy to commit it.
>>>
>
> lrs-042 -> lrs-071a is fine and treated as expected. If in doubt you can tweak
> /usr/src/regress/usr.sbin/pkg_add/check-name (see check_order right
> at the bottom) to test.
It does well for lrs-071 -> lrs-071a too, so there is no error to expect from 
upstream
versions

>
> usually there's no need to patch to change = to ?= like this, just pass 
> CFLAGS in via MAKE_FLAGS - these are passed on
> the command line rather than environment, and override things in the 
> makefile. Sometimes you do need to patch for ?=
> but usually only when one makefile is explicitly calling a child make process 
> and you need to pass things through the
> environment instead.
Noted, so MAKE_FLAGS is passed on only for the primary MAKEFILE during each 
call to compiler, nice.

diff attached below with all the rest of the changes.

Index: Makefile
===
RCS file: /cvs/ports/math/lrs/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile12 Jul 2019 20:47:42 -  1.6
+++ Makefile18 Nov 2020 13:20:12 -
@@ -2,35 +2,38 @@

 COMMENT =  solve vertex enumeration and convex hull problems

-DISTNAME = lrslib-042c
-PKGNAME =  lrs-042
-REVISION = 1
+V =071a
+DISTNAME = lrslib-${V}
+PKGNAME =  lrs-${V}
 FIX_EXTRACT_PERMISSIONS=Yes

+SHARED_LIBS =  lrs 0.0 # 1.0
+
 CATEGORIES =   math

 HOMEPAGE = http://cgm.cs.mcgill.ca/~avis/C/lrs.html

-MAINTAINER =   Edd Barrett 
+MAINTAINER =   Dimitri Karamazov 

 # GPLv2
 PERMIT_PACKAGE =   Yes

 WANTLIB =  c gmp

-MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/
+MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/
+
+USE_GMAKE =Yes

 MAKE_FILE =makefile
-MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include 
LDFLAGS=-L${LOCALBASE}/lib
-ALL_TARGET =   gmp # build with arbitrary precision numbers
+MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include \
+   LDFLAGS=-L${LOCALBASE}/lib \
+   CFLAGS="${CFLAGS} -Wall" \
+   SONAME="liblrs.so.${LIBlrs_VERSION:R}" \
+   SOMINOR=".${LIBlrs_VERSION:E}"

-LIB_DEPENDS =  devel/gmp
+ALL_TARGET =   lrs lrsnash single all-shared

-BINARIES = 2gnash buffer gfourier glrs gnash gredund
-do-install:
-.for i in ${BINARIES}
-   ${INSTALL_PROGRAM} ${WRKBUILD}/${i} ${PREFIX}/bin/
-.endfor
+LIB_DEPENDS =  devel/gmp

 # A simple test to check it works
 REGRESS_FILES =test.ine expected_outcome.ine openbsd_regress.sh
@@ -39,10 +42,5 @@ do-test:
cp ${FILESDIR}/${i} ${WRKBUILD}
 .endfor
cd ${WRKBUILD} && sh openbsd_regress.sh
-
-# resolve conflict with www/gnash and misc/buffer
-post-install:
-   mv ${PREFIX}/bin/gnash ${PREFIX}/bin/lrsgnash
-   mv ${PREFIX}/bin/buffer ${PREFIX}/bin/lrsbuffer

 .include 
Index: distinfo
===
RCS file: /cvs/ports/math/lrs/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo18 Jan 2015 03:14:27 -  1.2
+++ distinfo18 Nov 2020 13:20:12 -
@@ -1,2 +1,2 @@
-SHA256 (lrslib-042c.tar.gz) = U/mbUnE5e7XzF8lvo2Xtwaxx+ny6ApXIvXngiC9cOko=
-SIZE (lrslib-042c.tar.gz) = 168765
+SHA256 (lrslib-071a.tar.gz) = kmY26mjeRmJfFB9uAl3OlnzH5oz0v0pZc3XAY/XBFnM=
+SIZE (lrslib-071a.tar.gz) = 458590
Index: files/openbsd_regress.sh
===
RCS file: /cvs/ports/math/lrs/files/openbsd_regress.sh,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 openbsd_regress.sh
--- files/openbsd_regress.sh7 Oct 2011 08:58:42 -   1.1.1.1
+++ files/openbsd_regress.sh18 Nov 2020 13:20:12 -
@@ -5,7 +5,7 @@ IN=test.ine
 OUT=actual_outcome.ine
 EXPECT=expected_outcome.ine

-./glrs ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}
+./lrsgmp ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}

 DIFF=`diff -u ${OUT} ${EXPECT}`
 if [ -n "${DIFF}" ]; then
Index: patches/patch-makefile
===
RCS file: /cvs/ports/math/lrs/patches/patch-makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-makefile
--- patches/patch-makefile  7 Oct 2011 08:58:42 -   1.1.1.1
+++ patches/patch-makefile  18 Nov 2020 13:20:12 -
@@ -1,153 +1,208 @@
-$OpenBSD: patch-makefile,v 1.1.1.1 2011/10/07 08:58:42 edd Exp $
+$OpenBSD$

-Honour CFLAGS, LDFLAGS, CPPFLAGS. Use dynamic linking.
+Honour CFLAGS, 

Re: [UPDATE] math/lrs -> 071a

2020-11-18 Thread Stuart Henderson
On 2020/11/18 02:39, Dimitri Karamazov wrote:
> On Tue, November 17, 2020 21:01, Edd Barrett wrote:
> > I think the comment should say 1.0, since before you patched it the
> > makefile was like:
> >
> Attached below with given changes
> 
> >
> > You might want to try to feed parts of that makefile patch upstream btw.
> >
> Will do
> 
> >
> > If another dev OKs this (and specifically checks the 'a' suffix on the
> > version number), I'd be happy to commit it.
> >
> Parts can also be numbers with an optional letter appended (packages-specs)
> Also I don't see any reservation for letter 'a'. Only thing which comes
> close to it is 'alpha' which has to be in long-form.

lrs-042 -> lrs-071a is fine and treated as expected. If in doubt you can
tweak /usr/src/regress/usr.sbin/pkg_add/check-name (see check_order right
at the bottom) to test.

quick comments on the rest, I haven't looked closely

>  makefile Sun Nov 15 22:58:52 2020
> +@@ -35,7 +35,7 @@ default: lrs
> + INCLUDEDIR = /usr/local/include
> + LIBDIR = /usr/local/lib
> +
> +-CFLAGS = -O3 -Wall
> ++CFLAGS ?= -O3 -Wall

usually there's no need to patch to change = to ?= like this, just pass
CFLAGS in via MAKE_FLAGS - these are passed on the command line rather
than environment, and override things in the makefile. Sometimes you do
need to patch for ?= but usually only when one makefile is explicitly
calling a child make process and you need to pass things through the
environment instead.

> + lrs: ${LRSOBJ}
> +-$(CC) ${CFLAGS} -DMA -DB128 -L${LIBDIR} -o lrs ${LRSOBJ} -lgmp
> +-$(CC)  -O3   -DGMP -I${INCLUDEDIR} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
> lrsdriver.c -L${LIBDIR}  -lgmp
> +-$(CC) -O3 hvref.c -o hvref
> ++$(CC) -Wall ${CFLAGS} -DMA -DB128 ${LDFLAGS} -o lrs ${LRSOBJ} -lgmp
> ++$(CC) ${CFLAGS} -DGMP ${CPPFLAGS} -o lrsgmp lrs.c lrslib.c lrsgmp.c 
> lrsdriver.c ${LDFLAGS} -lgmp
> ++$(CC) ${CFLAGS} hvref.c -o hvref
> + ln -s -f lrs redund
> + ln -s -f lrsgmp redundgmp
> +
> + lrs64: ${LRSOBJ64}
> +-$(CC) ${CFLAGS} -DMA -L${LIBDIR} -o lrs ${LRSOBJ64} -lgmp
> ++$(CC) -Wall ${CFLAGS} -DMA ${LDFLAGS} -o lrs ${LRSOBJ64} -lgmp
> +
> + lrs.o: lrs.c
> +-$(CC) ${CFLAGS} -DMA -DB128 -c -o lrs.o lrs.c
> ++$(CC) -Wall ${CFLAGS} -DMA -DB128 -c -o lrs.o lrs.c
> +
> + lrs64.o: lrs.c
> +-$(CC) ${CFLAGS} -DMA -c -o lrs64.o lrs.c
> ++$(CC) -Wall ${CFLAGS} -DMA -c -o lrs64.o lrs.c

Removing -O3 is correct for ports, but these many additions of -Wall
seem unnecessary churn - apart from being a pain for updates, they also
make it hard to see what the rest of the patch is doing.

If you want extra warnings just add -Wall to CFLAGS when passed in.

> + ##
> + # From here on the author is David Bremner  to whom you 
> should turn for help
> + #
> + # Shared library variables
> +-SONAME ?=liblrs.so.1
> +-SOMINOR ?=.0.0
> ++SONAME ?=liblrs.so.${LMAJ}
> ++SOMINOR ?=.${LMIN}
> + SHLIB ?=$(SONAME)$(SOMINOR)
> + SHLINK ?=liblrs.so

You can probably pass this in via MAKE_FLAGS too.



Re: [UPDATE] math/lrs -> 071a

2020-11-17 Thread Dimitri Karamazov
On Tue, November 17, 2020 21:01, Edd Barrett wrote:
> I think the comment should say 1.0, since before you patched it the
> makefile was like:
>
Attached below with given changes

>
> You might want to try to feed parts of that makefile patch upstream btw.
>
Will do

>
> If another dev OKs this (and specifically checks the 'a' suffix on the
> version number), I'd be happy to commit it.
>
Parts can also be numbers with an optional letter appended (packages-specs)
Also I don't see any reservation for letter 'a'. Only thing which comes
close to it is 'alpha' which has to be in long-form.

Index: Makefile
===
RCS file: /cvs/ports/math/lrs/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile12 Jul 2019 20:47:42 -  1.6
+++ Makefile18 Nov 2020 02:27:42 -
@@ -2,36 +2,36 @@

 COMMENT =  solve vertex enumeration and convex hull problems

-DISTNAME = lrslib-042c
-PKGNAME =  lrs-042
-REVISION = 1
+V =071a
+DISTNAME = lrslib-${V}
+PKGNAME =  lrs-${V}
 FIX_EXTRACT_PERMISSIONS=Yes

+SHARED_LIBS =  lrs 0.0 # 1.0
+
 CATEGORIES =   math

 HOMEPAGE = http://cgm.cs.mcgill.ca/~avis/C/lrs.html

-MAINTAINER =   Edd Barrett 
+MAINTAINER =   Dimitri Karamazov 

 # GPLv2
 PERMIT_PACKAGE =   Yes

 WANTLIB =  c gmp

-MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/
+MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/
+
+USE_GMAKE =Yes

 MAKE_FILE =makefile
-MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include 
LDFLAGS=-L${LOCALBASE}/lib
-ALL_TARGET =   gmp # build with arbitrary precision numbers
+MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include \
+   LDFLAGS=-L${LOCALBASE}/lib \
+   LMAJ="${LIBlrs_VERSION:R}" LMIN="${LIBlrs_VERSION:E}"
+ALL_TARGET =   lrs lrsnash single all-shared

 LIB_DEPENDS =  devel/gmp

-BINARIES = 2gnash buffer gfourier glrs gnash gredund
-do-install:
-.for i in ${BINARIES}
-   ${INSTALL_PROGRAM} ${WRKBUILD}/${i} ${PREFIX}/bin/
-.endfor
-
 # A simple test to check it works
 REGRESS_FILES =test.ine expected_outcome.ine openbsd_regress.sh
 do-test:
@@ -39,10 +39,5 @@ do-test:
cp ${FILESDIR}/${i} ${WRKBUILD}
 .endfor
cd ${WRKBUILD} && sh openbsd_regress.sh
-
-# resolve conflict with www/gnash and misc/buffer
-post-install:
-   mv ${PREFIX}/bin/gnash ${PREFIX}/bin/lrsgnash
-   mv ${PREFIX}/bin/buffer ${PREFIX}/bin/lrsbuffer

 .include 
Index: distinfo
===
RCS file: /cvs/ports/math/lrs/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo18 Jan 2015 03:14:27 -  1.2
+++ distinfo18 Nov 2020 02:27:42 -
@@ -1,2 +1,2 @@
-SHA256 (lrslib-042c.tar.gz) = U/mbUnE5e7XzF8lvo2Xtwaxx+ny6ApXIvXngiC9cOko=
-SIZE (lrslib-042c.tar.gz) = 168765
+SHA256 (lrslib-071a.tar.gz) = kmY26mjeRmJfFB9uAl3OlnzH5oz0v0pZc3XAY/XBFnM=
+SIZE (lrslib-071a.tar.gz) = 458590
Index: files/openbsd_regress.sh
===
RCS file: /cvs/ports/math/lrs/files/openbsd_regress.sh,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 openbsd_regress.sh
--- files/openbsd_regress.sh7 Oct 2011 08:58:42 -   1.1.1.1
+++ files/openbsd_regress.sh18 Nov 2020 02:27:42 -
@@ -5,7 +5,7 @@ IN=test.ine
 OUT=actual_outcome.ine
 EXPECT=expected_outcome.ine

-./glrs ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}
+./lrsgmp ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}

 DIFF=`diff -u ${OUT} ${EXPECT}`
 if [ -n "${DIFF}" ]; then
Index: patches/patch-makefile
===
RCS file: /cvs/ports/math/lrs/patches/patch-makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-makefile
--- patches/patch-makefile  7 Oct 2011 08:58:42 -   1.1.1.1
+++ patches/patch-makefile  18 Nov 2020 02:27:42 -
@@ -1,153 +1,283 @@
-$OpenBSD: patch-makefile,v 1.1.1.1 2011/10/07 08:58:42 edd Exp $
+$OpenBSD$

-Honour CFLAGS, LDFLAGS, CPPFLAGS. Use dynamic linking.
+correct soname
+set LDFLAGS to fix build
+avoid library symlinks
+correct install target

 makefile.orig  Mon Apr 26 03:12:56 2010
-+++ makefile   Mon Oct  3 12:14:16 2011
-@@ -15,87 +15,76 @@
- # make cleanto clean all executables
-
-
--#Select one of the following INCLUDE,LIB paths only needed for gmp version
--
--#linux at mcgill with gmp version 3
--INCLUDEDIR = /usr/local/include
--LIBDIR = /usr/local/lib
--
--#linux at mcgill with gmp version 2
--#INCLUDEDIR = /labs/cgm/gmp2/include
--#LIBDIR = /labs/cgm/gmp2/lib
--
--
- all:  lrs.c lrslib.c lrslib.h lrsmp.c lrsmp.h lrslong.c lrslong.h redund.c 
buffer.c nash.c 2nash.c
--  

Re: [UPDATE] math/lrs -> 071a

2020-11-17 Thread Edd Barrett
Hi,

On Mon, Nov 16, 2020 at 10:58:35AM -, Dimitri Karamazov wrote:
> 'make update' works just fine here, I don't what happened in your case.

Well, I tested using `pkg_add -u` and it worked.

> +SHARED_LIBS =lrs 0.0 # 0.0

I think the comment should say 1.0, since before you patched it the
makefile was like:

```
SONAME ?=liblrs.so.1
SOMINOR ?=.0.0
```

i.e. 1.0.0 on a linux machine.

You might want to try to feed parts of that makefile patch upstream btw.

Other than that this looks good.

If another dev OKs this (and specifically checks the 'a' suffix on the
version number), I'd be happy to commit it.

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



Re: [UPDATE] math/lrs -> 071a

2020-11-16 Thread Dimitri Karamazov
On Mon, November 16, 2020 10:01, Edd Barrett wrote:
> Hi,
>
>
> On Mon, Nov 16, 2020 at 04:45:49AM -, Dimitri Karamazov wrote:
>
>> +V = 071a
>> +PKGNAME =   lrs-${V}lpha
>>
>
I should've tested because making changes.
'make update' works just fine here, I don't what happened in your case.
I've just added one more compile target which was being called during 'make 
fake',
so now 'make fake' only does what it is supposed to do.

Any comments/ OK's?

Index: Makefile
===
RCS file: /cvs/ports/math/lrs/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile12 Jul 2019 20:47:42 -  1.6
+++ Makefile16 Nov 2020 10:53:39 -
@@ -2,36 +2,36 @@

 COMMENT =  solve vertex enumeration and convex hull problems

-DISTNAME = lrslib-042c
-PKGNAME =  lrs-042
-REVISION = 1
+V =071a
+DISTNAME = lrslib-${V}
+PKGNAME =  lrs-${V}
 FIX_EXTRACT_PERMISSIONS=Yes

+SHARED_LIBS =  lrs 0.0 # 0.0
+
 CATEGORIES =   math

 HOMEPAGE = http://cgm.cs.mcgill.ca/~avis/C/lrs.html

-MAINTAINER =   Edd Barrett 
+MAINTAINER =   Dimitri Karamazov 

 # GPLv2
 PERMIT_PACKAGE =   Yes

 WANTLIB =  c gmp

-MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/
+MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/
+
+USE_GMAKE =Yes

 MAKE_FILE =makefile
-MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include 
LDFLAGS=-L${LOCALBASE}/lib
-ALL_TARGET =   gmp # build with arbitrary precision numbers
+MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include \
+   LDFLAGS=-L${LOCALBASE}/lib \
+   LMAJ="${LIBlrs_VERSION:R}" LMIN="${LIBlrs_VERSION:E}"
+ALL_TARGET =   lrs lrsnash single all-shared

 LIB_DEPENDS =  devel/gmp

-BINARIES = 2gnash buffer gfourier glrs gnash gredund
-do-install:
-.for i in ${BINARIES}
-   ${INSTALL_PROGRAM} ${WRKBUILD}/${i} ${PREFIX}/bin/
-.endfor
-
 # A simple test to check it works
 REGRESS_FILES =test.ine expected_outcome.ine openbsd_regress.sh
 do-test:
@@ -39,10 +39,5 @@ do-test:
cp ${FILESDIR}/${i} ${WRKBUILD}
 .endfor
cd ${WRKBUILD} && sh openbsd_regress.sh
-
-# resolve conflict with www/gnash and misc/buffer
-post-install:
-   mv ${PREFIX}/bin/gnash ${PREFIX}/bin/lrsgnash
-   mv ${PREFIX}/bin/buffer ${PREFIX}/bin/lrsbuffer

 .include 
Index: distinfo
===
RCS file: /cvs/ports/math/lrs/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo18 Jan 2015 03:14:27 -  1.2
+++ distinfo16 Nov 2020 10:53:39 -
@@ -1,2 +1,2 @@
-SHA256 (lrslib-042c.tar.gz) = U/mbUnE5e7XzF8lvo2Xtwaxx+ny6ApXIvXngiC9cOko=
-SIZE (lrslib-042c.tar.gz) = 168765
+SHA256 (lrslib-071a.tar.gz) = kmY26mjeRmJfFB9uAl3OlnzH5oz0v0pZc3XAY/XBFnM=
+SIZE (lrslib-071a.tar.gz) = 458590
Index: files/openbsd_regress.sh
===
RCS file: /cvs/ports/math/lrs/files/openbsd_regress.sh,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 openbsd_regress.sh
--- files/openbsd_regress.sh7 Oct 2011 08:58:42 -   1.1.1.1
+++ files/openbsd_regress.sh16 Nov 2020 10:53:39 -
@@ -5,7 +5,7 @@ IN=test.ine
 OUT=actual_outcome.ine
 EXPECT=expected_outcome.ine

-./glrs ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}
+./lrsgmp ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}

 DIFF=`diff -u ${OUT} ${EXPECT}`
 if [ -n "${DIFF}" ]; then
Index: patches/patch-makefile
===
RCS file: /cvs/ports/math/lrs/patches/patch-makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-makefile
--- patches/patch-makefile  7 Oct 2011 08:58:42 -   1.1.1.1
+++ patches/patch-makefile  16 Nov 2020 10:53:39 -
@@ -1,153 +1,283 @@
-$OpenBSD: patch-makefile,v 1.1.1.1 2011/10/07 08:58:42 edd Exp $
+$OpenBSD$

-Honour CFLAGS, LDFLAGS, CPPFLAGS. Use dynamic linking.
+correct soname
+set LDFLAGS to fix build
+avoid library symlinks
+correct install target

 makefile.orig  Mon Apr 26 03:12:56 2010
-+++ makefile   Mon Oct  3 12:14:16 2011
-@@ -15,87 +15,76 @@
- # make cleanto clean all executables
-
-
--#Select one of the following INCLUDE,LIB paths only needed for gmp version
--
--#linux at mcgill with gmp version 3
--INCLUDEDIR = /usr/local/include
--LIBDIR = /usr/local/lib
--
--#linux at mcgill with gmp version 2
--#INCLUDEDIR = /labs/cgm/gmp2/include
--#LIBDIR = /labs/cgm/gmp2/lib
--
--
- all:  lrs.c lrslib.c lrslib.h lrsmp.c lrsmp.h lrslong.c lrslong.h redund.c 
buffer.c nash.c 2nash.c
--  gcc -O3 -DTIMES -DSIGNALS -o lrs  lrs.c lrslib.c lrsmp.c
--  gcc -O3 -DTIMES -DSIGNALS -o redund  redund.c 

Re: [UPDATE] math/lrs -> 071a

2020-11-16 Thread Edd Barrett
Hi,

On Mon, Nov 16, 2020 at 04:45:49AM -, Dimitri Karamazov wrote:
> +V =  071a
> +PKGNAME =lrs-${V}lpha

That's not right. Looking at the releases directory, 071a came *after*
071, so it's not an alpha as far as I can see:

http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/

And if I read packages-specs(7) right, '071a' and '071alpha' should both
be greater than '042c' (the version we have in-tree). So unless I
misunderstand, both '071a' and '071alpha' should be valid upgrade paths
from '042c'.

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



Re: [UPDATE] math/lrs -> 071a

2020-11-16 Thread Dimitri Karamazov
On Sun, November 15, 2020 21:58, Edd Barrett wrote:
> Hi,
>
>
> Thanks for looking at this.
>
>
> On Sun, Nov 15, 2020 at 05:38:53PM -, Dimitri Karamazov wrote:
>
>> Any comments/OK's?
>>
>
> This looks good to me.
>
>
> I'm a little confused as to why `make update` doesn't work, but `make
> install` does an update:

The followinng diff executes 'make update' nicely, let me know if
it does so for you.

Index: Makefile
===
RCS file: /cvs/ports/math/lrs/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile12 Jul 2019 20:47:42 -  1.6
+++ Makefile16 Nov 2020 04:30:37 -
@@ -2,36 +2,36 @@

 COMMENT =  solve vertex enumeration and convex hull problems

-DISTNAME = lrslib-042c
-PKGNAME =  lrs-042
-REVISION = 1
+V =071a
+DISTNAME = lrslib-${V}
+PKGNAME =  lrs-${V}lpha
 FIX_EXTRACT_PERMISSIONS=Yes

+SHARED_LIBS =  lrs 0.0 # 0.0
+
 CATEGORIES =   math

 HOMEPAGE = http://cgm.cs.mcgill.ca/~avis/C/lrs.html

-MAINTAINER =   Edd Barrett 
+MAINTAINER =   Dimitri Karamazov 

 # GPLv2
 PERMIT_PACKAGE =   Yes

 WANTLIB =  c gmp

-MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/
+MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/
+
+USE_GMAKE =Yes

 MAKE_FILE =makefile
-MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include 
LDFLAGS=-L${LOCALBASE}/lib
-ALL_TARGET =   gmp # build with arbitrary precision numbers
+MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include \
+   LDFLAGS=-L${LOCALBASE}/lib \
+   LMAJ="${LIBlrs_VERSION:R}" LMIN="${LIBlrs_VERSION:E}"
+ALL_TARGET =   lrs lrsnash single all-shared

 LIB_DEPENDS =  devel/gmp

-BINARIES = 2gnash buffer gfourier glrs gnash gredund
-do-install:
-.for i in ${BINARIES}
-   ${INSTALL_PROGRAM} ${WRKBUILD}/${i} ${PREFIX}/bin/
-.endfor
-
 # A simple test to check it works
 REGRESS_FILES =test.ine expected_outcome.ine openbsd_regress.sh
 do-test:
@@ -39,10 +39,5 @@ do-test:
cp ${FILESDIR}/${i} ${WRKBUILD}
 .endfor
cd ${WRKBUILD} && sh openbsd_regress.sh
-
-# resolve conflict with www/gnash and misc/buffer
-post-install:
-   mv ${PREFIX}/bin/gnash ${PREFIX}/bin/lrsgnash
-   mv ${PREFIX}/bin/buffer ${PREFIX}/bin/lrsbuffer

 .include 
Index: distinfo
===
RCS file: /cvs/ports/math/lrs/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo18 Jan 2015 03:14:27 -  1.2
+++ distinfo16 Nov 2020 04:30:37 -
@@ -1,2 +1,2 @@
-SHA256 (lrslib-042c.tar.gz) = U/mbUnE5e7XzF8lvo2Xtwaxx+ny6ApXIvXngiC9cOko=
-SIZE (lrslib-042c.tar.gz) = 168765
+SHA256 (lrslib-071a.tar.gz) = kmY26mjeRmJfFB9uAl3OlnzH5oz0v0pZc3XAY/XBFnM=
+SIZE (lrslib-071a.tar.gz) = 458590
Index: files/openbsd_regress.sh
===
RCS file: /cvs/ports/math/lrs/files/openbsd_regress.sh,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 openbsd_regress.sh
--- files/openbsd_regress.sh7 Oct 2011 08:58:42 -   1.1.1.1
+++ files/openbsd_regress.sh16 Nov 2020 04:30:37 -
@@ -5,7 +5,7 @@ IN=test.ine
 OUT=actual_outcome.ine
 EXPECT=expected_outcome.ine

-./glrs ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}
+./lrsgmp ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}

 DIFF=`diff -u ${OUT} ${EXPECT}`
 if [ -n "${DIFF}" ]; then
Index: patches/patch-makefile
===
RCS file: /cvs/ports/math/lrs/patches/patch-makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-makefile
--- patches/patch-makefile  7 Oct 2011 08:58:42 -   1.1.1.1
+++ patches/patch-makefile  16 Nov 2020 04:30:38 -
@@ -1,153 +1,283 @@
-$OpenBSD: patch-makefile,v 1.1.1.1 2011/10/07 08:58:42 edd Exp $
+$OpenBSD$

-Honour CFLAGS, LDFLAGS, CPPFLAGS. Use dynamic linking.
+correct soname
+set LDFLAGS to fix build
+avoid library symlinks
+correct install target

 makefile.orig  Mon Apr 26 03:12:56 2010
-+++ makefile   Mon Oct  3 12:14:16 2011
-@@ -15,87 +15,76 @@
- # make cleanto clean all executables
-
-
--#Select one of the following INCLUDE,LIB paths only needed for gmp version
--
--#linux at mcgill with gmp version 3
--INCLUDEDIR = /usr/local/include
--LIBDIR = /usr/local/lib
--
--#linux at mcgill with gmp version 2
--#INCLUDEDIR = /labs/cgm/gmp2/include
--#LIBDIR = /labs/cgm/gmp2/lib
--
--
- all:  lrs.c lrslib.c lrslib.h lrsmp.c lrsmp.h lrslong.c lrslong.h redund.c 
buffer.c nash.c 2nash.c
--  gcc -O3 -DTIMES -DSIGNALS -o lrs  lrs.c lrslib.c lrsmp.c
--  gcc -O3 -DTIMES -DSIGNALS -o redund  redund.c lrslib.c lrsmp.c
--  gcc -O3 -DTIMES -DSIGNALS -DLONG -o lrs1  

Re: [UPDATE] math/lrs -> 071a

2020-11-15 Thread Edd Barrett
Hi,

Thanks for looking at this.

On Sun, Nov 15, 2020 at 05:38:53PM -, Dimitri Karamazov wrote:
> Any comments/OK's?

This looks good to me.

I'm a little confused as to why `make update` doesn't work, but `make
install` does an update:

```
$ make update
$ make install
===> lrs-071a depends on: gmp-* -> gmp-6.2.0
===> lrs-071a depends on: gmake-* -> gmake-4.3
===>  Verifying specs: c gmp
===>  found c.96.0 gmp.11.0
===>  Installing lrs-071a from /usr/ports/packages/amd64/all/
lrs-042p1->071a: ok
```

Reading packages-specs(7), it seems the `a` suffix should be ok here.

Perhaps another porter can chime in. Is that normal?

P.S.

Dimitri, if you care about lrs, do you want to take MAINTAINER? I don't
use this any more.

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



[UPDATE] math/lrs -> 071a

2020-11-15 Thread Dimitri Karamazov
I made a port for lrslib didn't know it already existed under a different guise.
Let me know if I'm missing something in here.
Your tests are successful

Update lrs 042 to 071a
Version 7.1 is a major revision completing the move to an all C library begun
in 7.0 which was work in progress and has been removed from distribution.

Major changes to lrs:
1. redund function is now performed by lrs via options, but legacy redund 
maintained
2. extract option to extract columns from the input especially with linearities
3. hvref makes a cross reference list between H and V representations

Major changes to mplrs:
1. Temporary files no longer used for communicating with workers.
2. Parallel version of redund is now available

Any comments/OK's?

Index: Makefile
===
RCS file: /cvs/ports/math/lrs/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile12 Jul 2019 20:47:42 -  1.6
+++ Makefile15 Nov 2020 17:31:45 -
@@ -2,11 +2,13 @@

 COMMENT =  solve vertex enumeration and convex hull problems

-DISTNAME = lrslib-042c
-PKGNAME =  lrs-042
-REVISION = 1
+V =071a
+DISTNAME = lrslib-${V}
+PKGNAME =  lrs-${V}
 FIX_EXTRACT_PERMISSIONS=Yes

+SHARED_LIBS =  lrs 0.0 # 0.0
+
 CATEGORIES =   math

 HOMEPAGE = http://cgm.cs.mcgill.ca/~avis/C/lrs.html
@@ -18,20 +20,18 @@ PERMIT_PACKAGE =Yes

 WANTLIB =  c gmp

-MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/
+MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/
+
+USE_GMAKE =Yes

 MAKE_FILE =makefile
-MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include 
LDFLAGS=-L${LOCALBASE}/lib
-ALL_TARGET =   gmp # build with arbitrary precision numbers
+MAKE_FLAGS =   CPPFLAGS=-I${LOCALBASE}/include \
+   LDFLAGS=-L${LOCALBASE}/lib \
+   LMAJ="${LIBlrs_VERSION:R}" LMIN="${LIBlrs_VERSION:E}"
+ALL_TARGET =   lrs lrsnash single

 LIB_DEPENDS =  devel/gmp

-BINARIES = 2gnash buffer gfourier glrs gnash gredund
-do-install:
-.for i in ${BINARIES}
-   ${INSTALL_PROGRAM} ${WRKBUILD}/${i} ${PREFIX}/bin/
-.endfor
-
 # A simple test to check it works
 REGRESS_FILES =test.ine expected_outcome.ine openbsd_regress.sh
 do-test:
@@ -39,10 +39,5 @@ do-test:
cp ${FILESDIR}/${i} ${WRKBUILD}
 .endfor
cd ${WRKBUILD} && sh openbsd_regress.sh
-
-# resolve conflict with www/gnash and misc/buffer
-post-install:
-   mv ${PREFIX}/bin/gnash ${PREFIX}/bin/lrsgnash
-   mv ${PREFIX}/bin/buffer ${PREFIX}/bin/lrsbuffer

 .include 
Index: distinfo
===
RCS file: /cvs/ports/math/lrs/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo18 Jan 2015 03:14:27 -  1.2
+++ distinfo15 Nov 2020 17:31:45 -
@@ -1,2 +1,2 @@
-SHA256 (lrslib-042c.tar.gz) = U/mbUnE5e7XzF8lvo2Xtwaxx+ny6ApXIvXngiC9cOko=
-SIZE (lrslib-042c.tar.gz) = 168765
+SHA256 (lrslib-071a.tar.gz) = kmY26mjeRmJfFB9uAl3OlnzH5oz0v0pZc3XAY/XBFnM=
+SIZE (lrslib-071a.tar.gz) = 458590
Index: files/openbsd_regress.sh
===
RCS file: /cvs/ports/math/lrs/files/openbsd_regress.sh,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 openbsd_regress.sh
--- files/openbsd_regress.sh7 Oct 2011 08:58:42 -   1.1.1.1
+++ files/openbsd_regress.sh15 Nov 2020 17:31:45 -
@@ -5,7 +5,7 @@ IN=test.ine
 OUT=actual_outcome.ine
 EXPECT=expected_outcome.ine

-./glrs ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}
+./lrsgmp ${IN} | grep -e '^ 1' 2>&1 | tee ${OUT}

 DIFF=`diff -u ${OUT} ${EXPECT}`
 if [ -n "${DIFF}" ]; then
Index: patches/patch-makefile
===
RCS file: /cvs/ports/math/lrs/patches/patch-makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-makefile
--- patches/patch-makefile  7 Oct 2011 08:58:42 -   1.1.1.1
+++ patches/patch-makefile  15 Nov 2020 17:31:45 -
@@ -1,153 +1,283 @@
-$OpenBSD: patch-makefile,v 1.1.1.1 2011/10/07 08:58:42 edd Exp $
+$OpenBSD$

-Honour CFLAGS, LDFLAGS, CPPFLAGS. Use dynamic linking.
+correct soname
+set LDFLAGS to fix build
+avoid library symlinks
+correct install target

 makefile.orig  Mon Apr 26 03:12:56 2010
-+++ makefile   Mon Oct  3 12:14:16 2011
-@@ -15,87 +15,76 @@
- # make cleanto clean all executables
-
-
--#Select one of the following INCLUDE,LIB paths only needed for gmp version
--
--#linux at mcgill with gmp version 3
--INCLUDEDIR = /usr/local/include
--LIBDIR = /usr/local/lib
--
--#linux at mcgill with gmp version 2
--#INCLUDEDIR = /labs/cgm/gmp2/include
--#LIBDIR = /labs/cgm/gmp2/lib
--
--
- all:  lrs.c lrslib.c lrslib.h lrsmp.c