Skip to content

Commit

Permalink
feat: 1.3.3 Add invil, bump amboso to 1.9.7 (#58)
Browse files Browse the repository at this point in the history
- Add ./anvil to .gitignore
- Adds invil to optionally replace amboso
- Add scripts/bootstrap_anvil.sh to automate linking ./anvil
- Upcoming versions may switch the default to repo_invil
  • Loading branch information
jgabaut authored Dec 10, 2023
1 parent 0499a0d commit c2abfdf
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ src/palette.h

# ignore old .txt animations files
static/animations/*.txt

# ignore anvil symlink
anvil
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "koliseo"]
path = koliseo
url = [email protected]:jgabaut/koliseo.git
[submodule "invil"]
path = invil
url = [email protected]:jgabaut/invil
6 changes: 5 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ if MINGW32_BUILD
helapordo_SOURCES += src/floor_tester.c
endif

./anvil:
@echo -e "\033[1;35m[Makefile]\e[0m Bootstrapping \"./anvil\":"
./scripts/bootstrap_anvil.sh repo_amboso
@echo -e "\033[1;33mDone.\e[0m"

./src/anvil__helapordo.c:
@echo -e "\033[1;34m[Makefile]\e[0m Using \033[1;33mamboso\e[0m to generate [\033[1;34m./src/anvil__helapordo.c\e[0m and \033[1;34m./src/anvil__helapordo.h\e[0m] for [ \033[1;36m$(VERSION)\e[0m ]:"
Expand Down Expand Up @@ -190,7 +194,7 @@ cleanob:
@echo -e "\033[1;33mDone.\e[0m"

# Default target (builds everything)
all: ./src/anvil__helapordo.c ./src/palette.c ./koliseo/src/koliseo.o ./sprites4curses/s4c-animate/animate.o $(TARGET)
all: ./anvil ./src/anvil__helapordo.c ./src/palette.c ./koliseo/src/koliseo.o ./sprites4curses/s4c-animate/animate.o $(TARGET)

# Target to clean and rebuild
rebuild: clean all
Expand Down
1 change: 0 additions & 1 deletion anvil

This file was deleted.

1 change: 1 addition & 0 deletions bin/stego.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ errortestsdir = "kulpo"
"1.3.0" = "Use std c11"
"1.3.1" = "Add Skillslot, base for OP_SKILL"
"1.3.2" = "Bump koliseo to 0.3.12, amboso to 1.9.6"
"1.3.3" = "Bump amboso to 1.9.7, add invil"
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Define the package name and version
AC_INIT([helapordo], [1.3.2], [[email protected]])
AC_INIT([helapordo], [1.3.3], [[email protected]])

# Verify automake version and enable foreign option
AM_INIT_AUTOMAKE([foreign -Wall])
Expand Down Expand Up @@ -48,7 +48,7 @@ fi
# Set a default version number if not specified externally
AC_ARG_VAR([VERSION], [Version number])
if test -z "$VERSION"; then
VERSION="1.3.2"
VERSION="1.3.3"
fi

# Output variables to the config.h header
Expand Down
2 changes: 1 addition & 1 deletion docs/helapordo.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = "helapordo"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "1.3.2"
PROJECT_NUMBER = "1.3.3"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
1 change: 1 addition & 0 deletions invil
Submodule invil added at 394cba
2 changes: 1 addition & 1 deletion kazoj/bone/const.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void fail(char* msg, int ex, int val) {

int main(void) {
int check = -1;
if ( ! (( check = strcmp(VERSION, "1.3.2") ) == 0)) {
if ( ! (( check = strcmp(VERSION, "1.3.3") ) == 0)) {
fail("VERSION",0,check);
};
if ( ! (HLP_MAX_INDEX == 30) ) {
Expand Down
113 changes: 113 additions & 0 deletions scripts/bootstrap_anvil.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-only
# Script to link binary for anvil
# Copyright (C) 2023 jgabaut
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

script_version="0.1"

print_impls() {
printf "Impl list:\n"
printf " repo_amboso\n repo_invil\n path_anvil\n\n"
}

prompt_impls() {
printf "\nSelect anvil implementation:\n"
print_impls
printf "Choice: \n"
}

usage() {
prog="$1"
printf "Usage: %s [-i] <impl>\n" "$prog"
print_impls
}

if [ "$#" -gt 3 ] ; then {
usage "$0"
exit 1
}
fi

if [ -f "./anvil" ] ; then {
printf "[INFO] ./anvil ready\n"
exit 0
}
fi

is_interactive=0

if [ "$1" = "-i" ] ; then {
is_interactive=1
printf "%s v%s\n" "$0" "$script_version"
}
fi

if [ "$is_interactive" -eq 0 ] ; then {
impl_q="$1"
if [ "$impl_q" = "repo_amboso" ] ; then {
ln -s ./amboso/amboso ./anvil
exit "$?"
} elif [ "$impl_q" = "repo_invil" ] ; then {
(cd invil || { printf "[ERROR] Failed cd to invil\n"; exit 1; } ; cargo build --release)
if [ "$?" -eq 0 ] ; then {
ln -s ./invil/target/release/invil ./anvil
exit "$?"
} else {
printf "[ERROR] Failed building invil.\n"
printf "[ERROR] Fallback to repo_amboso.\n"
exit "$("$0" repo_amboso)"
}
fi
} elif [ "$impl_q" = "path_anvil" ] ; then {
ln -s /usr/local/bin/anvil ./anvil
exit "$?"
} else {
printf "[ERROR] Invalid impl query: {%s}.\n" "$impl_q"
exit 1
}
fi
} else {
while read -p "$(prompt_impls)" line; do {
if [ -z "$line" ] ; then {
line="$2"
}
fi
impl_q="$line"
printf "[INFO] Requested impl: {%s}\n" "$impl_q"
if [ "$impl_q" = "repo_amboso" ] ; then {
ln -s ./amboso/amboso ./anvil
exit "$?"
} elif [ "$impl_q" = "repo_invil" ] ; then {
(cd invil || { printf "[ERROR] Failed cd to invil\n"; exit 1; } ; cargo build --release)
if [ "$?" -eq 0 ] ; then {
ln -s ./invil/target/release/invil ./anvil
exit "$?"
} else {
printf "[ERROR] Failed building invil.\n"
printf "[ERROR] Fallback to repo_amboso.\n"
exit "$("$0" repo_amboso)"
}
fi
} elif [ "$impl_q" = "path_anvil" ] ; then {
ln -s /usr/local/bin/anvil ./anvil
exit "$?"
} else {
printf "[ERROR] Invalid impl query: {%s}.\n" "$impl_q"
}
fi
}
done
}
fi
4 changes: 2 additions & 2 deletions src/game_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ extern int G_DOTUTORIAL_ON;
/**
* Current patch release.
*/
#define HELAPORDO_PATCH_VERSION 2
#define HELAPORDO_PATCH_VERSION 3

/**
* Current version string identifier, with MAJOR.MINOR.PATCH format.
*/
#define VERSION "1.3.2"
#define VERSION "1.3.3"

#define HELAPORDO_SAVEFILE_VERSION "0.1.7"

Expand Down

0 comments on commit c2abfdf

Please sign in to comment.