diff --git a/srcpkgs/sudoku/patches/musl-file.patch b/srcpkgs/sudoku/patches/musl-file.patch new file mode 100644 index 00000000000..a9e2470f027 --- /dev/null +++ b/srcpkgs/sudoku/patches/musl-file.patch @@ -0,0 +1,48 @@ +--- sudoku.c 2015-03-13 16:20:28.000000000 +0100 ++++ sudoku.c 2017-12-22 19:44:59.484598329 +0100 +@@ -369,7 +369,8 @@ + static int opt_solve = 0; + static int opt_restrict = 0; + +-static FILE default_template_file; /* We will use only the address of it. */ ++/* We will use only the address of it. */ ++static FILE* default_template_file = (FILE *)0x000000001; + static int default_template_siz = 0; + static int default_template_pos = 0; + +@@ -384,7 +385,7 @@ + && strcmp(mode, "r") == 0) { + stream = fopen(filename, "r"); + if (0 == stream && strcmp(TEMPLATE_FALLBACK, filename) == 0) { +- stream = &default_template_file; ++ stream = default_template_file; + default_template_siz = sizeof(default_template) * 4; + default_template_pos = 0; + } +@@ -397,7 +398,7 @@ + tclose (FILE * stream) + { + int ret = -1; +- if (stream == &default_template_file) { ++ if (stream == default_template_file) { + default_template_siz = 0; + default_template_pos = 0; + ret = 0; +@@ -414,7 +415,7 @@ + int origin) + { + int ret = -1; +- if (stream != &default_template_file) { ++ if (stream != default_template_file) { + ret = fseek(stream, + offset, + origin); +@@ -454,7 +455,7 @@ + FILE * stream) + { + char * ret = 0; +- if (stream == &default_template_file) { ++ if (stream == default_template_file) { + int i = 0; + if (str != 0 + && n > 0 diff --git a/srcpkgs/sudoku/template b/srcpkgs/sudoku/template new file mode 100644 index 00000000000..606bdd9557c --- /dev/null +++ b/srcpkgs/sudoku/template @@ -0,0 +1,18 @@ +# Template file for 'sudoku' +pkgname=sudoku +version=1.0.5 +revision=1 +build_style=gnu-makefile +makedepends="ncurses-devel" +short_desc="Sudoku solver based on the initial work of Michael Kennett" +maintainer="Nick Hahn " +license="Public Domain" +homepage="https://github.com/cinemast/sudoku" +distfiles="https://github.com/cinemast/sudoku/archive/v${version}.tar.gz" +checksum=3ce6d9b237546d4ac7cdb7a6bb0e47d5c99e696a710b8935bce40dc706d32ff2 + +do_install() { + vbin sudoku + vman sudoku.6 + vinstall template 644 /usr/share/sudoku/ +}