+DIST simhv311-0.zip 2790607 BLAKE2B f9399977093f07d7f58067ed40e22f60e43228bbb1e0fdaa6b04408956962d9ea14b6dc57d758b819cee59f3bade9505a6802d42804df49622990402c0f22600 SHA512 e5fb6915c050e7402363cd9c1f99feb00874c3693905067ce901ffa86fc29a0cd2648684f111216b09a3c847f75812e2db2e2f2fa9f9d0db5dc932d53ec832fa
DIST simhv39-0.zip 3103657 BLAKE2B 3b5fcaa7f1aa24bd5afa78452fb2d5e2822654bcaa3caa478dbdf939770c13f7f1d3f95859674fc02e2cc35a4cfff239bb9ee6a726fb9e31586f639cdf40ca10 SHA512 5e8cbf92e980b7cb40d68ff60a266f70c0bef0eecdc169a8077ae72a6a71fe12a7be5c62bd033ca36727e2cb8f266a5a6f8a5ed6dd509afbf0a9d7b618f1a4f6
--- /dev/null
+From ca4b7338836edb7325c82f86dccdeb4808cb4a89 Mon Sep 17 00:00:00 2001
+From: Mark Pizzolato <mark@infocomm.com>
+Date: Wed, 29 Jan 2020 11:39:36 -0800
+Subject: [PATCH] makefile: Force gcc/clang -fcommon to address future gcc
+ -fno-common default
+
+as reported and discussed in #794
+---
+ makefile | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/makefile
++++ b/makefile
+@@ -506,9 +506,13 @@ else\r
+ ifneq (3,$(GCC_MAJOR_VERSION))\r
+ ifeq (,$(GCC_OPTIMIZERS_CMD))\r
+ GCC_OPTIMIZERS_CMD = $(GCC) --help=optimizers\r
++ GCC_COMMON_CMD = $(GCC) --help=common\r
+ endif\r
+ GCC_OPTIMIZERS = $(shell $(GCC_OPTIMIZERS_CMD))\r
+ endif\r
++ ifneq (,$(GCC_COMMON_CMD))\r
++ GCC_OPTIMIZERS += $(shell $(GCC_COMMON_CMD))\r
++ endif\r
+ ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS)))\r
+ NO_LTO = 1\r
+ endif\r
+@@ -530,6 +534,9 @@ else\r
+ ifneq (,$(findstring -fstrict-overflow,$(GCC_OPTIMIZERS)))\r
+ CFLAGS_O += -fno-strict-overflow\r
+ endif\r
++ ifneq (,$(findstring -fcommon,$(GCC_OPTIMIZERS))$(findstring -fno-common,$(GCC_OPTIMIZERS)))\r
++ CFLAGS_O += -fcommon\r
++ endif\r
+ ifeq (,$(NO_LTO))\r
+ ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS)))\r
+ CFLAGS_O += -flto -fwhole-program\r
--- /dev/null
+--- simh-3.9.0/makefile
++++ simh-3.9.0/makefile
+@@ -249,7 +249,7 @@\r
+ NETWORK_OPT = $(NETWORK_CCDEFS)\r
+ endif\r
+ ifneq (binexists,$(shell if $(TEST) -e BIN; then echo binexists; fi))\r
+- MKDIRBIN = if $(TEST) ! -e BIN; then mkdir BIN; fi\r
++ MKDIRBIN = mkdir -p BIN\r
+ endif\r
+ else\r
+ #Win32 Environments (via MinGW32)\r
--- /dev/null
+--- a/makefile
++++ b/makefile
+@@ -497,8 +497,8 @@ ifneq ($(DEBUG),)\r
+ CFLAGS_O = -O0\r
+ BUILD_FEATURES = - debugging support\r
+ else\r
+- CFLAGS_O = -O2\r
+- LDFLAGS_O = \r
++ CFLAGS_O ?= -O2\r
++ LDFLAGS_O ?= \r
+ ifeq (Darwin,$(OSTYPE))\r
+ NO_LTO = 1\r
+ endif\r
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <!-- maintainer-needed -->
+ <maintainer type="person">
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ </maintainer>
</pkgmetadata>
--- /dev/null
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+MY_P="${PN}v$(ver_rs 1 '' 2 '-')" # 'a.b.c' -> 'ab-c'
+DESCRIPTION="a simulator for historical computers such as Vax, PDP-11 etc.)"
+HOMEPAGE="http://simh.trailing-edge.com/"
+SRC_URI="http://simh.trailing-edge.com/sources/${MY_P}.zip"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE=""
+
+RDEPEND="net-libs/libpcap"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}/sim
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.11.0-respect-FLAGS.patch
+ "${FILESDIR}"/${PN}-3.11.0-fix-mkdir-race.patch
+ "${FILESDIR}"/${PN}-3.11.0-fcommon.patch
+)
+
+src_prepare() {
+ default
+
+ # fix linking on Darwin
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ sed -e 's/-lrt//g' \
+ -i makefile || die
+ fi
+}
+
+src_compile() {
+ export GCC="$(tc-getCC)"
+ export LDFLAGS_O="${LDFLAGS}"
+ export CFLAGS_O="${CFLAGS}"
+
+ local my_makeopts="USE_NETWORK=1"
+ if tc-is-gcc && ver_test $(gcc-version) -lt 4.6 ; then
+ my_makeopts+=" NO_LTO=1"
+ fi
+
+ emake ${my_makeopts}
+}
+
+src_install() {
+ for BINFILE in BIN/* ; do
+ newbin ${BINFILE} "simh-$(basename ${BINFILE})"
+ done
+
+ insinto /usr/share/simh
+ doins VAX/*.bin
+
+ dodoc *.txt */*.txt
+}