aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-20 17:15:27 +0100
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-20 17:15:27 +0100
commit4b06b666a98ea0239b0c72a579f8434246fb2d39 (patch)
treed0adfbdc7902bde91d0730a650bb614218e8d9b4
parent4183d854092f2254ce5e421c5f10a33a70565285 (diff)
downloadnissy-4b06b666a98ea0239b0c72a579f8434246fb2d39.tar.gz
nissy-4b06b666a98ea0239b0c72a579f8434246fb2d39.zip
Added windows binary
Diffstat (limited to '')
-rw-r--r--INSTALL10
-rw-r--r--Makefile5
-rw-r--r--doc/nissy.13
-rw-r--r--nissy-2.0beta3.tar.gzbin53146 -> 53230 bytes
-rwxr-xr-xnissy.exebin0 -> 684963 bytes
-rw-r--r--src/env.c23
6 files changed, 34 insertions, 7 deletions
diff --git a/INSTALL b/INSTALL
index 59c1b83..0717a0a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -8,6 +8,16 @@ pruning table. If so, about 200Mb should be enough.
8 8
9# Installation 9# Installation
10 10
11## On Windows
12
13Try downloading and executing in a terminal the file nissy.exe, then
14follow the instructions in the UNIX section below for downloading and
15installing the pruning tables.
16If nissy.exe does not work, you can try following the UNIX instructions
17in WSL (Windows Subsystem for Linux) or in a similar environment.
18
19Sorry for the inconvenience, I don't have a Windows machine to test this on.
20
11## On a UNIX system: 21## On a UNIX system:
12 22
13Edit the Makefile to match your local configuration (usually not necessary, but you 23Edit the Makefile to match your local configuration (usually not necessary, but you
diff --git a/Makefile b/Makefile
index 4ffef70..89d866b 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,9 @@ options:
22nissy: 22nissy:
23 ${CC} ${CFLAGS} -o nissy.o src/*.c 23 ${CC} ${CFLAGS} -o nissy.o src/*.c
24 24
25win:
26 x86_64-w64-mingw32-gcc ${CFLAGS} -static -o nissy.exe src/*.c
27
25debug: 28debug:
26 ${CC} ${DBGFLAGS} -o nissy.o src/*.c 29 ${CC} ${DBGFLAGS} -o nissy.o src/*.c
27 30
@@ -50,5 +53,5 @@ uninstall:
50 rm -rf ${DESTDIR}${PREFIX}/bin/nissy ${DESTDIR}${MANPREFIX}/man1/nissy.1 53 rm -rf ${DESTDIR}${PREFIX}/bin/nissy ${DESTDIR}${MANPREFIX}/man1/nissy.1
51 for s in ${SCRIPTS}; do rm -rf ${DESTDIR}${PREFIX}/bin/$$s; done 54 for s in ${SCRIPTS}; do rm -rf ${DESTDIR}${PREFIX}/bin/$$s; done
52 55
53.PHONY: all options nissy debug clean dist install uninstall 56.PHONY: all options nissy win debug clean dist install uninstall
54 57
diff --git a/doc/nissy.1 b/doc/nissy.1
index 5bfa930..e8ce7ea 100644
--- a/doc/nissy.1
+++ b/doc/nissy.1
@@ -127,7 +127,8 @@ If that variable is unset the folder
127.Nm $XDG_DATA_HOME/nissy 127.Nm $XDG_DATA_HOME/nissy
128or 128or
129.Nm $HOME/.nissy 129.Nm $HOME/.nissy
130is used instead. 130is used instead. If none of this environment variables is defined
131(e.g. in a non-UNIX system), the current folder is used.
131. 132.
132.Sh EXAMPLES 133.Sh EXAMPLES
133. 134.
diff --git a/nissy-2.0beta3.tar.gz b/nissy-2.0beta3.tar.gz
index bd7dd17..91c9e5e 100644
--- a/nissy-2.0beta3.tar.gz
+++ b/nissy-2.0beta3.tar.gz
Binary files differ
diff --git a/nissy.exe b/nissy.exe
new file mode 100755
index 0000000..400d674
--- /dev/null
+++ b/nissy.exe
Binary files differ
diff --git a/src/env.c b/src/env.c
index d13642f..282bc8f 100644
--- a/src/env.c
+++ b/src/env.c
@@ -4,6 +4,16 @@ bool initialized_env = false;
4char *tabledir; 4char *tabledir;
5 5
6void 6void
7mymkdir(char *d, int m)
8{
9#ifdef _WIN32
10 mkdir(d);
11#else
12 mkdir(d, m);
13#endif
14}
15
16void
7init_env() 17init_env()
8{ 18{
9 char *nissydata = getenv("NISSYDATA"); 19 char *nissydata = getenv("NISSYDATA");
@@ -15,21 +25,24 @@ init_env()
15 return; 25 return;
16 26
17 if (nissydata != NULL) { 27 if (nissydata != NULL) {
18 tabledir = malloc(strlen(nissydata) * sizeof(char) + 20); 28 tabledir = malloc((strlen(nissydata) + 20) * sizeof(char));
19 strcpy(tabledir, nissydata); 29 strcpy(tabledir, nissydata);
20 } else if (localdata != NULL) { 30 } else if (localdata != NULL) {
21 tabledir = malloc(strlen(localdata) * sizeof(char) + 20); 31 tabledir = malloc((strlen(localdata) + 20) * sizeof(char));
22 strcpy(tabledir, localdata); 32 strcpy(tabledir, localdata);
23 strcat(tabledir, "/nissy"); 33 strcat(tabledir, "/nissy");
24 } else if (home != NULL) { 34 } else if (home != NULL) {
25 tabledir = malloc(strlen(home) * sizeof(char) + 20); 35 tabledir = malloc((strlen(home) + 20) * sizeof(char));
26 strcpy(tabledir, home); 36 strcpy(tabledir, home);
27 strcat(tabledir, "/.nissy"); 37 strcat(tabledir, "/.nissy");
38 } else {
39 tabledir = malloc(20 * sizeof(char));
40 strcpy(tabledir, ".");
28 } 41 }
29 42
30 mkdir(tabledir, 0777); 43 mymkdir(tabledir, 0777);
31 strcat(tabledir, "/tables"); 44 strcat(tabledir, "/tables");
32 mkdir(tabledir, 0777); 45 mymkdir(tabledir, 0777);
33 46
34 read = !access(tabledir, R_OK); 47 read = !access(tabledir, R_OK);
35 write = !access(tabledir, W_OK); 48 write = !access(tabledir, W_OK);

Generated with cgit - Back to sebastiano.tronto.net