Skip to content

Commit

Permalink
Add some fixes and make 'how-to-build' scripts runnable
Browse files Browse the repository at this point in the history
  • Loading branch information
octaspire committed Jun 15, 2017
1 parent a2e8bfb commit 47cc1ba
Show file tree
Hide file tree
Showing 22 changed files with 64 additions and 30 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 2.8.12)
project(octaspire-dern C)

set(OCTASPIRE_DERN_CONFIG_VERSION_MAJOR 0)
set(OCTASPIRE_DERN_CONFIG_VERSION_MINOR 133)
set(OCTASPIRE_DERN_CONFIG_VERSION_MINOR 134)
set(OCTASPIRE_DERN_CONFIG_VERSION_PATCH 0)

message("== Building ${PROJECT_NAME} ${OCTASPIRE_DERN_CONFIG_VERSION_MAJOR}.${OCTASPIRE_DERN_CONFIG_VERSION_MINOR}.${OCTASPIRE_DERN_CONFIG_VERSION_PATCH}")
Expand Down
2 changes: 1 addition & 1 deletion doc/book/Programming_in_Octaspire_Dern.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Programming in Octaspire Dern
:lang: en
:toc:

Documentation for Octaspire Dern programming language version 0.133.0
Documentation for Octaspire Dern programming language version 0.134.0

== About

Expand Down
4 changes: 2 additions & 2 deletions doc/book/Programming_in_Octaspire_Dern.html
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ <h1>Programming in Octaspire Dern</h1>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>Documentation for Octaspire Dern programming language version 0.133.0</p></div>
<div class="paragraph"><p>Documentation for Octaspire Dern programming language version 0.134.0</p></div>
</div>
</div>
<div class="sect1">
Expand Down Expand Up @@ -1753,7 +1753,7 @@ <h2 id="_using_the_amalgamated_source">Using the amalgamated source</h2>
<div id="footer">
<div id="footer-text">
Last updated
2017-06-15 16:46:14 EEST
2017-06-15 22:01:56 EEST
</div>
</div>
</body>
Expand Down
2 changes: 2 additions & 0 deletions etc/how-to-build/FreeBSD.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

Expand Down
6 changes: 4 additions & 2 deletions etc/how-to-build/NetBSD.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

Expand Down Expand Up @@ -65,12 +67,12 @@ cat << EnDoFmEsSaGe
binary plugin 'dern_ncurses', you don't have to do anything. Otherwise,
to install development version of library 'ncurses':
- NetBSD: sudo pkgin install devel/ncurses
- NetBSD: sudo pkgin install ncurses
-------------------------------------------------------------------------------
EnDoFmEsSaGe
echoToDefs
echoAndRun $CC -O2 -std=c99 -Wall -Wextra -fPIC -I . -c plugins/dern_ncurses.c
echoAndRun $CC -O2 -std=c99 -Wall -Wextra -shared -I . -o libdern_ncurses.so dern_ncurses.o -lncurses
echoAndRun $CC -O2 -std=c99 -Wall -Wextra -shared -I . -o libdern_ncurses.so dern_ncurses.o -lcurses -lterminfo



Expand Down
2 changes: 2 additions & 0 deletions etc/how-to-build/OpenBSD.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput sgr0)" ; }

Expand Down
2 changes: 2 additions & 0 deletions etc/how-to-build/haiku.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

Expand Down
2 changes: 2 additions & 0 deletions etc/how-to-build/linux.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

Expand Down
2 changes: 2 additions & 0 deletions etc/how-to-build/minix3.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

Expand Down
4 changes: 2 additions & 2 deletions etc/octaspire_dern_amalgamated.c
Original file line number Diff line number Diff line change
Expand Up @@ -16007,10 +16007,10 @@ limitations under the License.
#define OCTASPIRE_DERN_CONFIG_H

#define OCTASPIRE_DERN_CONFIG_VERSION_MAJOR "0"
#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "133"
#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "134"
#define OCTASPIRE_DERN_CONFIG_VERSION_PATCH "0"

#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.133.0"
#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.134.0"



Expand Down
17 changes: 11 additions & 6 deletions etc/plugins/dern_ncurses.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "octaspire-dern-amalgamated.c"

#ifdef __NetBSD__
#include <curses.h>
#else
#include <ncurses.h>
#endif

static char const * const DERN_NCURSES_PLUGIN_NAME = "dern_ncurses";

Expand Down Expand Up @@ -251,9 +256,9 @@ octaspire_dern_value_t *dern_ncurses_set_cursor(
if (result == ERR)
{
octaspire_helpers_verify(stackLength == octaspire_dern_vm_get_stack_length(vm));
return octaspire_dern_vm_create_new_value_error_from_c_string(
return octaspire_dern_vm_create_new_value_string_from_c_string(
vm,
"Builtin 'ncurses-set-cursor' failed to make cursor 'invisible'. ");
"Builtin 'ncurses-set-cursor' failed to make cursor 'invisible'.");
}
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(arg, "normal"))
Expand All @@ -263,9 +268,9 @@ octaspire_dern_value_t *dern_ncurses_set_cursor(
if (result == ERR)
{
octaspire_helpers_verify(stackLength == octaspire_dern_vm_get_stack_length(vm));
return octaspire_dern_vm_create_new_value_error_from_c_string(
return octaspire_dern_vm_create_new_value_string_from_c_string(
vm,
"Builtin 'ncurses-set-cursor' failed to make cursor 'normal'. ");
"Builtin 'ncurses-set-cursor' failed to make cursor 'normal'.");
}
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(arg, "very-visible"))
Expand All @@ -275,7 +280,7 @@ octaspire_dern_value_t *dern_ncurses_set_cursor(
if (result == ERR)
{
octaspire_helpers_verify(stackLength == octaspire_dern_vm_get_stack_length(vm));
return octaspire_dern_vm_create_new_value_error_from_c_string(
return octaspire_dern_vm_create_new_value_string_from_c_string(
vm,
"Builtin 'ncurses-set-cursor' failed to make cursor 'very-visible'. ");
}
Expand Down Expand Up @@ -1398,7 +1403,7 @@ bool dern_ncurses_init(
"ncurses-set-cursor",
dern_ncurses_set_cursor,
1,
"(ncurses-set-cursor boolean) -> boolean",
"(ncurses-set-cursor boolean) -> symbol of previous mode or error string",
targetEnv))
{
return false;
Expand Down
6 changes: 3 additions & 3 deletions release/README
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
This is amalgamated single file source release for Octaspire Dern programming
language version 0.133.0. File 'octaspire-dern-amalgamated.c'
language version 0.134.0. File 'octaspire-dern-amalgamated.c'
is all that is needed; it has no other dependencies than a C compiler and
standard library supporting C99.

SHA-512 checksums for this and older releases can be found from:
https://octaspire.github.io/dern/
If you want to check this release, download checksums for version 0.133.0 from:
https://octaspire.github.io/dern/checksums-0.133.0
If you want to check this release, download checksums for version 0.134.0 from:
https://octaspire.github.io/dern/checksums-0.134.0

Building instructions for all supported platforms (and scripts for building
automatically) can be found in directory 'how-to-build'. Look for a file that
Expand Down
4 changes: 2 additions & 2 deletions release/documentation/Programming_in_Octaspire_Dern.html
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ <h1>Programming in Octaspire Dern</h1>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>Documentation for Octaspire Dern programming language version 0.133.0</p></div>
<div class="paragraph"><p>Documentation for Octaspire Dern programming language version 0.134.0</p></div>
</div>
</div>
<div class="sect1">
Expand Down Expand Up @@ -1753,7 +1753,7 @@ <h2 id="_using_the_amalgamated_source">Using the amalgamated source</h2>
<div id="footer">
<div id="footer-text">
Last updated
2017-06-15 16:46:14 EEST
2017-06-15 22:01:56 EEST
</div>
</div>
</body>
Expand Down
2 changes: 2 additions & 0 deletions release/how-to-build/FreeBSD.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

Expand Down
6 changes: 4 additions & 2 deletions release/how-to-build/NetBSD.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

Expand Down Expand Up @@ -65,12 +67,12 @@ cat << EnDoFmEsSaGe
binary plugin 'dern_ncurses', you don't have to do anything. Otherwise,
to install development version of library 'ncurses':
- NetBSD: sudo pkgin install devel/ncurses
- NetBSD: sudo pkgin install ncurses
-------------------------------------------------------------------------------
EnDoFmEsSaGe
echoToDefs
echoAndRun $CC -O2 -std=c99 -Wall -Wextra -fPIC -I . -c plugins/dern_ncurses.c
echoAndRun $CC -O2 -std=c99 -Wall -Wextra -shared -I . -o libdern_ncurses.so dern_ncurses.o -lncurses
echoAndRun $CC -O2 -std=c99 -Wall -Wextra -shared -I . -o libdern_ncurses.so dern_ncurses.o -lcurses -lterminfo



Expand Down
2 changes: 2 additions & 0 deletions release/how-to-build/OpenBSD.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput sgr0)" ; }

Expand Down
2 changes: 2 additions & 0 deletions release/how-to-build/haiku.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

Expand Down
2 changes: 2 additions & 0 deletions release/how-to-build/linux.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

Expand Down
2 changes: 2 additions & 0 deletions release/how-to-build/minix3.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

Expand Down
4 changes: 2 additions & 2 deletions release/octaspire-dern-amalgamated.c
Original file line number Diff line number Diff line change
Expand Up @@ -16007,10 +16007,10 @@ limitations under the License.
#define OCTASPIRE_DERN_CONFIG_H

#define OCTASPIRE_DERN_CONFIG_VERSION_MAJOR "0"
#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "133"
#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "134"
#define OCTASPIRE_DERN_CONFIG_VERSION_PATCH "0"

#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.133.0"
#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.134.0"



Expand Down
17 changes: 11 additions & 6 deletions release/plugins/dern_ncurses.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "octaspire-dern-amalgamated.c"

#ifdef __NetBSD__
#include <curses.h>
#else
#include <ncurses.h>
#endif

static char const * const DERN_NCURSES_PLUGIN_NAME = "dern_ncurses";

Expand Down Expand Up @@ -251,9 +256,9 @@ octaspire_dern_value_t *dern_ncurses_set_cursor(
if (result == ERR)
{
octaspire_helpers_verify(stackLength == octaspire_dern_vm_get_stack_length(vm));
return octaspire_dern_vm_create_new_value_error_from_c_string(
return octaspire_dern_vm_create_new_value_string_from_c_string(
vm,
"Builtin 'ncurses-set-cursor' failed to make cursor 'invisible'. ");
"Builtin 'ncurses-set-cursor' failed to make cursor 'invisible'.");
}
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(arg, "normal"))
Expand All @@ -263,9 +268,9 @@ octaspire_dern_value_t *dern_ncurses_set_cursor(
if (result == ERR)
{
octaspire_helpers_verify(stackLength == octaspire_dern_vm_get_stack_length(vm));
return octaspire_dern_vm_create_new_value_error_from_c_string(
return octaspire_dern_vm_create_new_value_string_from_c_string(
vm,
"Builtin 'ncurses-set-cursor' failed to make cursor 'normal'. ");
"Builtin 'ncurses-set-cursor' failed to make cursor 'normal'.");
}
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(arg, "very-visible"))
Expand All @@ -275,7 +280,7 @@ octaspire_dern_value_t *dern_ncurses_set_cursor(
if (result == ERR)
{
octaspire_helpers_verify(stackLength == octaspire_dern_vm_get_stack_length(vm));
return octaspire_dern_vm_create_new_value_error_from_c_string(
return octaspire_dern_vm_create_new_value_string_from_c_string(
vm,
"Builtin 'ncurses-set-cursor' failed to make cursor 'very-visible'. ");
}
Expand Down Expand Up @@ -1398,7 +1403,7 @@ bool dern_ncurses_init(
"ncurses-set-cursor",
dern_ncurses_set_cursor,
1,
"(ncurses-set-cursor boolean) -> boolean",
"(ncurses-set-cursor boolean) -> symbol of previous mode or error string",
targetEnv))
{
return false;
Expand Down
2 changes: 1 addition & 1 deletion test/REPL/octaspire-dern-repl.exp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set timeout 4

spawn ../../build/octaspire-dern-repl -v
expect {
"Octaspire Dern version 0.133.0"
"Octaspire Dern version 0.134.0"
{puts "\n\x1B\[32m---------- TEST PASS ----------\x1B\[0m\n" }

default
Expand Down

0 comments on commit 47cc1ba

Please sign in to comment.