new package: simh
This commit is contained in:
parent
d40ac66d6d
commit
fecd26227d
25
packages/simh/LICENSE
Normal file
25
packages/simh/LICENSE
Normal file
@ -0,0 +1,25 @@
|
||||
The following copyright notice applies to the SIMH source, binary, and documentation:
|
||||
|
||||
Original code published in 1993-2005, written by Robert M Supnik
|
||||
Copyright (c) 1993-2005, Robert M Supnik
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of Robert M Supnik shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from Robert M Supnik.
|
51
packages/simh/build.sh
Normal file
51
packages/simh/build.sh
Normal file
@ -0,0 +1,51 @@
|
||||
TERMUX_PKG_HOMEPAGE=http://simh.trailing-edge.com/
|
||||
TERMUX_PKG_DESCRIPTION="A collection of simulators for computer hardware and software from the past"
|
||||
TERMUX_PKG_LICENSE="MIT, BSD 2-Clause"
|
||||
TERMUX_PKG_LICENSE_FILE="LICENSE, slirp/COPYRIGHT"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
_COMMIT=370bfe006d9f9fb87885c31f943d151013cd529f
|
||||
TERMUX_PKG_VERSION=2022.01.16
|
||||
TERMUX_PKG_SRCURL=https://github.com/simh/simh.git
|
||||
TERMUX_PKG_GIT_BRANCH=master
|
||||
TERMUX_PKG_DEPENDS="libandroid-glob"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
TERMUX_PKG_EXTRA_MAKE_ARGS="DONT_USE_ROMS=1 TESTS=0"
|
||||
|
||||
termux_step_post_get_source() {
|
||||
git fetch --unshallow
|
||||
git checkout $_COMMIT
|
||||
|
||||
local version="$(git log -1 --format=%cs | sed 's/-/./g')"
|
||||
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
|
||||
|
||||
cp $TERMUX_PKG_BUILDER_DIR/LICENSE ./
|
||||
}
|
||||
|
||||
termux_step_pre_configure() {
|
||||
CFLAGS+=" -fwrapv"
|
||||
LDFLAGS+=" -lm -landroid-glob"
|
||||
}
|
||||
|
||||
termux_step_make() {
|
||||
make -j $TERMUX_MAKE_PROCESSES \
|
||||
GCC="$CC" CFLAGS_O="$CFLAGS $CPPFLAGS" LDFLAGS="$LDFLAGS" \
|
||||
$TERMUX_PKG_EXTRA_MAKE_ARGS
|
||||
}
|
||||
|
||||
termux_step_make_install() {
|
||||
for f in BIN/*; do
|
||||
if [ -f "$f" ]; then
|
||||
local b="$(basename "$f")"
|
||||
install -Dm700 -T "$f" $TERMUX_PREFIX/bin/simh-"$b"
|
||||
fi
|
||||
done
|
||||
local sharedir=$TERMUX_PREFIX/share/simh
|
||||
mkdir -p $sharedir
|
||||
for f in */*.bin; do
|
||||
install -Dm600 -T "$f" $sharedir/"$f"
|
||||
done
|
||||
}
|
20
packages/simh/slirp-slirp.c.patch
Normal file
20
packages/simh/slirp-slirp.c.patch
Normal file
@ -0,0 +1,20 @@
|
||||
--- a/slirp/slirp.c
|
||||
+++ b/slirp/slirp.c
|
||||
@@ -121,7 +121,7 @@
|
||||
return 0;
|
||||
}
|
||||
old_stat = dns_addr_stat;
|
||||
- if (stat("/etc/resolv.conf", &dns_addr_stat) != 0)
|
||||
+ if (stat("@TERMUX_PREFIX@/etc/resolv.conf", &dns_addr_stat) != 0)
|
||||
return -1;
|
||||
if ((dns_addr_stat.st_dev == old_stat.st_dev)
|
||||
&& (dns_addr_stat.st_ino == old_stat.st_ino)
|
||||
@@ -132,7 +132,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- f = fopen("/etc/resolv.conf", "r");
|
||||
+ f = fopen("@TERMUX_PREFIX@/etc/resolv.conf", "r");
|
||||
if (!f)
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user