commit:     eb100a85c7481ac78d7c95f035924f267aca798a
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 30 08:30:36 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Jan 30 08:30:53 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb100a85

app-emulation/simh: bump up to 3.11.0, take package

Reported-by: https://bugs.gentoo.org/706866
Closes: https://bugs.gentoo.org/706866
Package-Manager: Portage-2.3.86, Repoman-2.3.20
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 app-emulation/simh/Manifest                        |  1 +
 app-emulation/simh/files/simh-3.11.0-fcommon.patch | 37 +++++++++++++
 .../simh/files/simh-3.11.0-fix-mkdir-race.patch    | 11 ++++
 .../simh/files/simh-3.11.0-respect-FLAGS.patch     | 13 +++++
 app-emulation/simh/metadata.xml                    |  5 +-
 app-emulation/simh/simh-3.11.0.ebuild              | 62 ++++++++++++++++++++++
 6 files changed, 128 insertions(+), 1 deletion(-)

diff --git a/app-emulation/simh/Manifest b/app-emulation/simh/Manifest
index 5da6120f5d2..881e4b244a1 100644
--- a/app-emulation/simh/Manifest
+++ b/app-emulation/simh/Manifest
@@ -1 +1,2 @@
+DIST simhv311-0.zip 2790607 BLAKE2B 
f9399977093f07d7f58067ed40e22f60e43228bbb1e0fdaa6b04408956962d9ea14b6dc57d758b819cee59f3bade9505a6802d42804df49622990402c0f22600
 SHA512 
e5fb6915c050e7402363cd9c1f99feb00874c3693905067ce901ffa86fc29a0cd2648684f111216b09a3c847f75812e2db2e2f2fa9f9d0db5dc932d53ec832fa
 DIST simhv39-0.zip 3103657 BLAKE2B 
3b5fcaa7f1aa24bd5afa78452fb2d5e2822654bcaa3caa478dbdf939770c13f7f1d3f95859674fc02e2cc35a4cfff239bb9ee6a726fb9e31586f639cdf40ca10
 SHA512 
5e8cbf92e980b7cb40d68ff60a266f70c0bef0eecdc169a8077ae72a6a71fe12a7be5c62bd033ca36727e2cb8f266a5a6f8a5ed6dd509afbf0a9d7b618f1a4f6

diff --git a/app-emulation/simh/files/simh-3.11.0-fcommon.patch 
b/app-emulation/simh/files/simh-3.11.0-fcommon.patch
new file mode 100644
index 00000000000..b23866aaab4
--- /dev/null
+++ b/app-emulation/simh/files/simh-3.11.0-fcommon.patch
@@ -0,0 +1,37 @@
+From ca4b7338836edb7325c82f86dccdeb4808cb4a89 Mon Sep 17 00:00:00 2001
+From: Mark Pizzolato <[email protected]>
+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
+   ifneq (3,$(GCC_MAJOR_VERSION))
+     ifeq (,$(GCC_OPTIMIZERS_CMD))
+       GCC_OPTIMIZERS_CMD = $(GCC) --help=optimizers
++      GCC_COMMON_CMD = $(GCC) --help=common
+     endif
+     GCC_OPTIMIZERS = $(shell $(GCC_OPTIMIZERS_CMD))
+   endif
++  ifneq (,$(GCC_COMMON_CMD))
++    GCC_OPTIMIZERS += $(shell $(GCC_COMMON_CMD))
++  endif
+   ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS)))
+     NO_LTO = 1
+   endif
+@@ -530,6 +534,9 @@ else
+   ifneq (,$(findstring -fstrict-overflow,$(GCC_OPTIMIZERS)))
+     CFLAGS_O += -fno-strict-overflow
+   endif
++  ifneq (,$(findstring -fcommon,$(GCC_OPTIMIZERS))$(findstring 
-fno-common,$(GCC_OPTIMIZERS)))
++    CFLAGS_O += -fcommon
++  endif
+   ifeq (,$(NO_LTO))
+     ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS)))
+       CFLAGS_O += -flto -fwhole-program

diff --git a/app-emulation/simh/files/simh-3.11.0-fix-mkdir-race.patch 
b/app-emulation/simh/files/simh-3.11.0-fix-mkdir-race.patch
new file mode 100644
index 00000000000..e2b1b5547ef
--- /dev/null
+++ b/app-emulation/simh/files/simh-3.11.0-fix-mkdir-race.patch
@@ -0,0 +1,11 @@
+--- simh-3.9.0/makefile
++++ simh-3.9.0/makefile
+@@ -249,7 +249,7 @@
+     NETWORK_OPT = $(NETWORK_CCDEFS)
+   endif
+   ifneq (binexists,$(shell if $(TEST) -e BIN; then echo binexists; fi))
+-    MKDIRBIN = if $(TEST) ! -e BIN; then mkdir BIN; fi
++    MKDIRBIN = mkdir -p BIN
+   endif
+ else
+   #Win32 Environments (via MinGW32)

diff --git a/app-emulation/simh/files/simh-3.11.0-respect-FLAGS.patch 
b/app-emulation/simh/files/simh-3.11.0-respect-FLAGS.patch
new file mode 100644
index 00000000000..0ceca7b0abf
--- /dev/null
+++ b/app-emulation/simh/files/simh-3.11.0-respect-FLAGS.patch
@@ -0,0 +1,13 @@
+--- a/makefile
++++ b/makefile
+@@ -497,8 +497,8 @@ ifneq ($(DEBUG),)
+   CFLAGS_O = -O0
+   BUILD_FEATURES = - debugging support
+ else
+-  CFLAGS_O = -O2
+-  LDFLAGS_O = 
++  CFLAGS_O ?= -O2
++  LDFLAGS_O ?= 
+   ifeq (Darwin,$(OSTYPE))
+     NO_LTO = 1
+   endif

diff --git a/app-emulation/simh/metadata.xml b/app-emulation/simh/metadata.xml
index 7a38bb90096..c5298995d2d 100644
--- a/app-emulation/simh/metadata.xml
+++ b/app-emulation/simh/metadata.xml
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
 <pkgmetadata>
-       <!-- maintainer-needed -->
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Sergei Trofimovich</name>
+       </maintainer>
 </pkgmetadata>

diff --git a/app-emulation/simh/simh-3.11.0.ebuild 
b/app-emulation/simh/simh-3.11.0.ebuild
new file mode 100644
index 00000000000..5c9e5593eac
--- /dev/null
+++ b/app-emulation/simh/simh-3.11.0.ebuild
@@ -0,0 +1,62 @@
+# 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
+}

Reply via email to