From f0bf4619659148820818cd7aa4e919b8f165079c Mon Sep 17 00:00:00 2001 From: steven Date: Thu, 4 Oct 2007 07:17:40 +0000 Subject: [PATCH] sudognu is a command line sudoku solver and creator. --- games/sudognu/Makefile | 31 +++++++++++++++++++++++ games/sudognu/distinfo | 5 ++++ games/sudognu/patches/patch-Makefile | 33 +++++++++++++++++++++++++ games/sudognu/patches/patch-getopt_c | 12 +++++++++ games/sudognu/patches/patch-print_svg_c | 29 ++++++++++++++++++++++ games/sudognu/pkg/DESCR | 4 +++ games/sudognu/pkg/PLIST | 8 ++++++ 7 files changed, 122 insertions(+) create mode 100644 games/sudognu/Makefile create mode 100644 games/sudognu/distinfo create mode 100644 games/sudognu/patches/patch-Makefile create mode 100644 games/sudognu/patches/patch-getopt_c create mode 100644 games/sudognu/patches/patch-print_svg_c create mode 100644 games/sudognu/pkg/DESCR create mode 100644 games/sudognu/pkg/PLIST diff --git a/games/sudognu/Makefile b/games/sudognu/Makefile new file mode 100644 index 00000000000..fc5f5142a4b --- /dev/null +++ b/games/sudognu/Makefile @@ -0,0 +1,31 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2007/10/04 07:17:40 steven Exp $ + +COMMENT= sudoku solver and creator + +DISTNAME= sudognu-1.05 +CATEGORIES= games + +HOMEPAGE= http://sudognu.sourceforge.net/ + +MAINTAINER= Steven Mestdagh + +# GPLv2 +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +WANTLIB= c m z pthread + +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=sudognu/} + +USE_GMAKE= Yes +NO_REGRESS= Yes + +do-install: + ${INSTALL_PROGRAM} ${WRKBUILD}/sudognu ${PREFIX}/bin + ${INSTALL_MAN} ${WRKBUILD}/sudognu.1 ${PREFIX}/man/man1 + ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/sudognu + ${INSTALL_SCRIPT} ${WRKSRC}/*.cgi ${PREFIX}/share/examples/sudognu + +.include diff --git a/games/sudognu/distinfo b/games/sudognu/distinfo new file mode 100644 index 00000000000..8c87b33d78e --- /dev/null +++ b/games/sudognu/distinfo @@ -0,0 +1,5 @@ +MD5 (sudognu-1.05.tar.gz) = 2jdAt5ALbUSPcAAL/J+6Ig== +RMD160 (sudognu-1.05.tar.gz) = yI8EU6W2JaU7bOVksbikg4oTFJs= +SHA1 (sudognu-1.05.tar.gz) = SsXAkHH0+W/pYFR0rlA2M1UMC54= +SHA256 (sudognu-1.05.tar.gz) = 8WyJ+4hN97hRlD0OKX1h6i7/jWAKNgUva6F8aw2LFQ8= +SIZE (sudognu-1.05.tar.gz) = 40031 diff --git a/games/sudognu/patches/patch-Makefile b/games/sudognu/patches/patch-Makefile new file mode 100644 index 00000000000..1408cc77d00 --- /dev/null +++ b/games/sudognu/patches/patch-Makefile @@ -0,0 +1,33 @@ +$OpenBSD: patch-Makefile,v 1.1.1.1 2007/10/04 07:17:40 steven Exp $ +--- Makefile.orig Sat Sep 22 20:21:19 2007 ++++ Makefile Sat Sep 29 15:04:07 2007 +@@ -14,12 +14,12 @@ CGI_DIR=$(HOME)/public_html/cgi-bin + # libharu include files and library. + # + # to build without pdf support use the following +-#HARULIB_LDFLAG= +-#HARULIB_CFLAG= ++HARULIB_LDFLAG= ++HARULIB_CFLAG= + + # use the following, if you have libharu in standard location +-HARULIB_LDFLAG=-lhpdf +-HARULIB_CFLAG=-D HARULIB ++#HARULIB_LDFLAG=-lhpdf ++#HARULIB_CFLAG=-D HARULIB + + # use this to specify location of library and include files explicitly + #HARULIB_LDFLAG=-L$(HOME)/lib -lhpdf +@@ -39,9 +39,9 @@ CGIBINS=$(wildcard *.cgi) + MANPAGE=$(PROGNAME).1 + DOCS=$(wildcard *.html) COPYING README INSTALL + +-CC=gcc +-LDFLAGS=$(HARULIB_LDFLAG) -lm -lz -lpthread +-CFLAGS=-g -I. $(HARULIB_CFLAG) -Wall ++#CC=gcc ++LDFLAGS=$(HARULIB_LDFLAG) -lm -lz -pthread ++CFLAGS+= -I. $(HARULIB_CFLAG) -Wall -pthread + + all: $(PROGNAME) + diff --git a/games/sudognu/patches/patch-getopt_c b/games/sudognu/patches/patch-getopt_c new file mode 100644 index 00000000000..cd91b0a0cf9 --- /dev/null +++ b/games/sudognu/patches/patch-getopt_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-getopt_c,v 1.1.1.1 2007/10/04 07:17:40 steven Exp $ +--- getopt.c.orig Sat Sep 29 15:02:33 2007 ++++ getopt.c Sat Sep 29 15:02:42 2007 +@@ -76,7 +76,7 @@ int getoptions(int argc, char *argv[]) { + symmgrid = 1; + break; + case 't': +- nthread = sysconf(_SC_NPROCESSORS_ONLN); ++ nthread = 0; + break; + case 'w': + action = 4; diff --git a/games/sudognu/patches/patch-print_svg_c b/games/sudognu/patches/patch-print_svg_c new file mode 100644 index 00000000000..68b93142a2d --- /dev/null +++ b/games/sudognu/patches/patch-print_svg_c @@ -0,0 +1,29 @@ +$OpenBSD: patch-print_svg_c,v 1.1.1.1 2007/10/04 07:17:40 steven Exp $ +--- print_svg.c.orig Sat Sep 22 20:21:19 2007 ++++ print_svg.c Sat Sep 29 15:29:03 2007 +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + #include "sudoku.h" + + /* +@@ -35,6 +36,7 @@ void sudokus_to_svg(char *fn, t_sudoku sudokus[4]) { + float pagePadH = (pageHeight - 6) - squareSize * (2*size+5); + + float x0, y0; ++ FILE *f; + + // svg file name + if (fn == NULL) +@@ -42,7 +44,8 @@ void sudokus_to_svg(char *fn, t_sudoku sudokus[4]) { + else + strcat(fn,".svg"); + +- FILE *f=fopen(fn,"w"); ++ if ((f=fopen(fn,"w")) == NULL) ++ err(1, "fopen: %s", fn); + + // print xml / svg head + fprintf(f,"\n\ diff --git a/games/sudognu/pkg/DESCR b/games/sudognu/pkg/DESCR new file mode 100644 index 00000000000..20f22d5b6ed --- /dev/null +++ b/games/sudognu/pkg/DESCR @@ -0,0 +1,4 @@ +Sudognu is a command line sudoku solver and creator. Sudognu can display +the logical steps it uses to find the solution. It can print four +sudokus to a PDF page and it comes with example CGI scripts for +integration into web sites. diff --git a/games/sudognu/pkg/PLIST b/games/sudognu/pkg/PLIST new file mode 100644 index 00000000000..d862f034888 --- /dev/null +++ b/games/sudognu/pkg/PLIST @@ -0,0 +1,8 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2007/10/04 07:17:40 steven Exp $ +bin/sudognu +@man man/man1/sudognu.1 +share/examples/sudognu/ +share/examples/sudognu/csudognu.cgi +share/examples/sudognu/psudognu.cgi +share/examples/sudognu/ssudognu.cgi +share/examples/sudognu/wsudognu.cgi