simulavr: Refactor build.sh

This commit is contained in:
Tee KOBAYASHI 2022-12-26 01:48:36 +09:00 committed by xtkoba
parent e785eaadbc
commit 74cd8c60ec
3 changed files with 25 additions and 26 deletions

View File

@ -2,11 +2,12 @@ TERMUX_PKG_HOMEPAGE="https://www.nongnu.org/simulavr"
TERMUX_PKG_DESCRIPTION="Simulator for Microchip AVR (formerly Atmel) microcontrollers"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
_VERSION_MAJOR=1
_VERSION_MINOR=1
_VERSION_PATCH=0
TERMUX_PKG_VERSION=1:${_VERSION_MAJOR}.${_VERSION_MINOR}.${_VERSION_PATCH}
TERMUX_PKG_SRCURL="https://git.savannah.nongnu.org/git/simulavr.git"
TERMUX_PKG_GIT_BRANCH="master"
# tag: release-1.1.0
_COMMIT="e6eac877e8eb497e1620adfd48f5bc85099d306f"
TERMUX_PKG_VERSION="2019.12.20"
TERMUX_PKG_GIT_BRANCH=release-${TERMUX_PKG_VERSION#*:}
TERMUX_PKG_DEPENDS="libc++"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS='
@ -17,13 +18,11 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS='
'
termux_step_post_get_source() {
git fetch --unshallow
git checkout $_COMMIT
local version="$(git log -1 --date=format:"%Y.%m.%d" --format="%ad")"
if [ "$version" != "$TERMUX_PKG_VERSION" ]; then
echo -n "ERROR: The specified version \"$TERMUX_PKG_VERSION\""
echo " is different from what is expected to be: \"$version\""
return 1
fi
echo "Applying hardcode-version.diff"
sed \
-e "s|@VERSION_MAJOR@|${_VERSION_MAJOR}|g" \
-e "s|@VERSION_MINOR@|${_VERSION_MINOR}|g" \
-e "s|@VERSION_PATCH@|${_VERSION_PATCH}|g" \
$TERMUX_PKG_BUILDER_DIR/hardcode-version.diff \
| patch --silent -p1
}

View File

@ -1,5 +1,3 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98f80df..12386ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,10 +12,11 @@ include(FindPythonModule)
@ -9,20 +7,11 @@ index 98f80df..12386ff 100644
-get_git_info()
-set(PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+# get_git_info()
+set(PACKAGE_VERSION "1.1.0")
+set(PACKAGE_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@")
+
+message(STATUS "version major 1 / minor 1 / patch 0")
+message(STATUS "version major @VERSION_MAJOR@ / minor @VERSION_MINOR@ / patch @VERSION_PATCH@")
-message(STATUS "version major ${VERSION_MAJOR} / minor ${VERSION_MINOR} / patch ${VERSION_PATCH}")
# build options
option(BUILD_TCL "build TCL SWIG module" OFF)
@@ -81,7 +82,7 @@ endif()
if(BUILD_PYTHON)
add_subdirectory(pysimulavr)
endif()
-add_subdirectory(doc)
+# add_subdirectory(doc)
add_subdirectory(kbdgentables)
# check targets

View File

@ -0,0 +1,11 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,7 +82,7 @@ endif()
if(BUILD_PYTHON)
add_subdirectory(pysimulavr)
endif()
-add_subdirectory(doc)
+# add_subdirectory(doc)
add_subdirectory(kbdgentables)
# check targets