Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Aug 2018 23:24:20 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r478622 - in head/emulators/lisaem: . files
Message-ID:  <201808312324.w7VNOK9U011285@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Fri Aug 31 23:24:20 2018
New Revision: 478622
URL: https://svnweb.freebsd.org/changeset/ports/478622

Log:
  emulators/lisaem: Fix build with Clang 6
  
  lisaem_static_resources.cpp:672:1: error: constant expression evaluates to 3735928559 which cannot be narrowed to type 'long' [-Wc++11-narrowing]
  0xdeadbeef
  ^~~~~~~~~
  
  http://beefy11.nyi.freebsd.org/data/head-i386-default/p478276_s338342/logs/errors/lisaem-1.2.6.2.log
  
  - Move build script patches to a static patch file and fix it to respect
    CXXFLAGS, CFLAGS, LDFLAGS set by the framework

Added:
  head/emulators/lisaem/files/patch-build.sh   (contents, props changed)
Modified:
  head/emulators/lisaem/Makefile

Modified: head/emulators/lisaem/Makefile
==============================================================================
--- head/emulators/lisaem/Makefile	Fri Aug 31 23:21:44 2018	(r478621)
+++ head/emulators/lisaem/Makefile	Fri Aug 31 23:24:20 2018	(r478622)
@@ -14,16 +14,17 @@ BUILD_DEPENDS=	pngtopnm:graphics/netpbm
 LICENSE=	GPLv2+
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-USES=		tar:bzip2
+USES=		compiler tar:bzip2
 USE_WX=		2.8
 
+BINARY_ALIAS=	wx-config=${WX_CONFIG}
+
+CXXFLAGS+=	${CXXFLAGS_${CHOSEN_COMPILER_TYPE}}
+CXXFLAGS_clang=	-Wno-c++11-narrowing
+
 DESKTOP_ENTRIES="LisaEm" "" "lisaem" "lisaem" "" ""
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|bash|sh|; s|==|=|; \
-		 s|wx-config|${WX_CONFIG:T}|; \
-		 s|/usr/local/|${PREFIX}/|; \
-		 s|^function ||; /[Ss]trip/d' ${WRKSRC}/build.sh
 	@${REINPLACE_CMD} -e \
 		's|^inline |static inline |' ${WRKSRC}/lisa/zilog8530.c
 
@@ -40,6 +41,5 @@ do-install:
 	(cd ${WRKDIR} && ${INSTALL_DATA} lisaem.png ${STAGEDIR}${PREFIX}/share/pixmaps)
 	@${MKDIR} ${STAGEDIR}${DATADIR}
 	(cd ${WRKSRC}/resources && ${INSTALL_DATA} * ${STAGEDIR}${DATADIR})
-	${LN} -sf lisaem ${STAGEDIR}${PREFIX}/share/LisaEm
 
 .include <bsd.port.mk>

Added: head/emulators/lisaem/files/patch-build.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/lisaem/files/patch-build.sh	Fri Aug 31 23:24:20 2018	(r478622)
@@ -0,0 +1,134 @@
+--- build.sh.orig	2015-09-03 19:56:33 UTC
++++ build.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ #### Edit these options for your system
+ 
+@@ -46,7 +46,7 @@ done
+ 
+ if [ -z "$CYGWIN" ];
+ then
+- [ "`uname`" == "CYGWIN_NT-5.0" ] && CYGWIN="`uname`"
++ [ "`uname`" = "CYGWIN_NT-5.0" ] && CYGWIN="`uname`"
+ fi
+ 
+ 
+@@ -121,9 +121,9 @@ WITHBLITS="-DUSE_RAW_BITMAP_ACCESS"
+    export RCINCS="--include-dir=`cygpath -wp ${WXDEV}/include/common` "
+    export DEFINES="-D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -D __WIN32__"
+    export CXXINCS="-I. -I ..\include -I ..\cpu68k -I ..\\wxui -I `cygpath -wp ${MINGW}/include`  -I `cygpath -wp ${MINGCPP}/backward`  -I `cygpath -wp ${MINGCPP}/mingw32`  -I `cygpath -wp ${MINGCPP}`  -I `cygpath -wp ${WXDEV}/include`  -I `cygpath -wp ${WXDEV}/`  -I `cygpath -wp ${WXDEV}/include/common/wx/msw`  -I `cygpath -wp ${WXDEV}/include/common/wx/generic`  -I `cygpath -wp ${WXDEV}/include/common/wx/fl`  -I `cygpath -wp ${WXDEV}/include/common/wx/gizmos`  -I `cygpath -wp ${WXDEV}/include/common/wx/html`  -I `cygpath -wp ${WXDEV}/include/common/wx/mmedia`  -I `cygpath -wp ${WXDEV}/include/common/wx/net`  -I `cygpath -wp ${WXDEV}/include/common/wx/ogl`  -I `cygpath -wp ${WXDEV}/include/common/wx/plot`  -I `cygpath -wp ${WXDEV}/include/common/wx/protocol`  -I `cygpath -wp ${WXDEV}/include/common/wx/stc`  -I `cygpath -wp ${WXDEV}/include/common/wx/svg`  -I `cygpath -wp ${WXDEV}/include/common/wx/xml`  -I `cygpath -wp ${WXDEV}/include/common/wx/xrc`  -I `cygpath -wp ${WXDEV}/inclu
 de/common/wx`  -I `cygpath -wp ${WXDEV}/include/common`"
+-   export CXXFLAGS="${CXXINCS} ${DEFINES}"
++   export CXXFLAGS="${CXXFLAGS} ${CXXINCS} ${DEFINES}"
+    export CXXFLAGS="-Wno-write-strings ${CXXINCS} ${DEFINES}"  #2015.08.30 allow GCC 4.6.3 to ignore constant violation
+-   export CFLAGS="${INCS} ${DEFINES} -fno-exceptions -fno-pcc-struct-return -fstrict-aliasing $WARNINGS -Wno-format -Wno-unused -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__   -fexpensive-optimizations -O3"
++   export CFLAGS="${CFLAGS} ${INCS} ${DEFINES} -fno-exceptions -fno-pcc-struct-return -fstrict-aliasing $WARNINGS -Wno-format -Wno-unused -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__"
+    export GPROF=gprof.exe
+    export RM="rm -f"
+    export LINK=g++.exe
+@@ -172,7 +172,7 @@ esac
+ 
+ fi
+ #$CYGWIN is pre-set.  Cache $DARWIN so we don't have to call uname over and over.
+-[ "`uname`" == "Darwin" ] && DARWIN="Darwin"
++[ "`uname`" = "Darwin" ] && DARWIN="Darwin"
+ 
+ 
+ # not needed on OS X
+@@ -234,11 +234,11 @@ fi
+ # if the object is older than the source, it will return true.
+ ##############################################################################
+ 
+-function NEEDED()
++NEEDED()
+ {
+  if [ -f $2 ]
+  then
+-   [ "`ls -tr $2 $1 2>/dev/null| tail -1`" == "$1" ] && return 0
++   [ "`ls -tr $2 $1 2>/dev/null| tail -1`" = "$1" ] && return 0
+    return 1
+  fi
+  return 0
+@@ -399,7 +399,7 @@ exit 1
+ fi
+ 
+ # create built by info and license
+-BUILTBY="\"Compiled on `date` by $LOGNAME@`uname -n`  (`uname -v `)\n options:$WITHBLITS $WITHDEBUG $WITHTRACE $WITHUNICODE\""
++BUILTBY="\"options:$WITHBLITS $WITHDEBUG $WITHTRACE $WITHUNICODE\""
+ echo "#define BUILTBY $BUILTBY" >./include/built_by.h
+ echo -n "#define LICENSE "    >>./include/built_by.h
+ cat LICENSE | sed 's/^/"/g' | sed 's/$/\\n"      \\/g' >>./include/built_by.h
+@@ -475,9 +475,9 @@ then
+  fi
+ #2015.08.31 
+  #CFLAGS="-Wwrite-strings -I. -I../include -I../cpu68k -I../wxui $WXCONFIGFLAGS $WITHOPTIMIZE $WITHDEBUG"
+- CFLAGS="-Wno-write-strings -I. -I../include -I../cpu68k -I../wxui $WXCONFIGFLAGS $WITHOPTIMIZE $WITHDEBUG"
+- CXXFLAGS="-Wno-write-strings -I. -I../include -I../cpu68k -I../wxui $WXCONFIGFLAGS $WITHOPTIMIZE $WITHDEBUG"
+- LINKOPTS="`wx-config $STATIC  $WITHUNICODE  --libs --linkdeps --cppflags`"
++ CFLAGS="$CFLAGS -Wno-write-strings -I. -I../include -I../cpu68k -I../wxui $WXCONFIGFLAGS $WITHOPTIMIZE $WITHDEBUG"
++ CXXFLAGS="$CXXFLAGS -Wno-write-strings -I. -I../include -I../cpu68k -I../wxui $WXCONFIGFLAGS $WITHOPTIMIZE $WITHDEBUG"
++ LINKOPTS="$LDFLAGS `wx-config $STATIC  $WITHUNICODE  --libs --linkdeps --cppflags`"
+  if [ -z "$LINKOPTS" ]
+  then
+     echo wx-config has failed, or returned an error.  Ensure that it exists in your path.
+@@ -493,7 +493,7 @@ fi
+ ###########################################################################
+ 
+ # Has the configuration changed since last time? if so we may need to do a clean build.
+-[ -f .last-opts ] && source .last-opts
++[ -f .last-opts ] && . .last-opts
+ 
+ needclean=0
+ #debug and tracelog changes affect the whole project, so need to clean it all
+@@ -663,7 +663,6 @@ then
+   $CC $CFLAGS $LDFLAGS -o ../bin/lisadiskinfo lisadiskinfo.c libdc42.o || exit 1
+   if [ -z "$WITHDEBUG" ]
+   then
+-    strip ../bin/lisadiskinfo${EXT}
+     if  [ -z "$WITHOUTUPX"                 ]; then
+      if [ -x "`which upx 2>/dev/null`"     ]; then upx --best ../bin/lisadiskinfo${EXT} ; fi
+     fi
+@@ -682,7 +681,6 @@ then
+   $CC $CFLAGS -o ../bin/lisafsh-tool lisafsh-tool.c libdc42.o || exit 1
+   if [ -z "$WITHDEBUG" ]
+   then
+-    strip ../bin/lisafsh-tool${EXT}
+     if  [ -z "$WITHOUTUPX"                 ]; then
+      if [ -x "`which upx 2>/dev/null`"     ]; then upx --best ../bin/lisafsh-tool${EXT} ; fi
+     fi
+@@ -737,7 +735,7 @@ if [ "$VSTATIC" -gt 0 ]; then DEPS=1; else DEPS=0; fi
+ if [ "$DEPS" -gt 0 ]
+ then
+   echo "  Compiling lisaem_static_resources.cpp..."
+-  $CXX $CFLAGS -c lisaem_static_resources.cpp -o lisaem_static_resources.o || exit 1
++  $CXX $CXXFLAGS -c lisaem_static_resources.cpp -o lisaem_static_resources.o || exit 1
+ fi
+ LIST="$LIST lisaem_static_resources.o"
+ 
+@@ -803,7 +801,7 @@ do
+   if NEEDED ${i}.cpp ${i}.o
+   then
+      echo "  Compiling ${i}.cpp..."
+-     $CXX -W $WARNINGS $WITHDEBUG $WITHTRACE $WITHBLITS $CFLAGS -c ${i}.cpp -o ${i}.o || exit 1
++     $CXX -W $WARNINGS $WITHDEBUG $WITHTRACE $WITHBLITS $CXXFLAGS -c ${i}.cpp -o ${i}.o || exit 1
+   fi
+ done
+ 
+@@ -908,7 +906,6 @@ then
+ 	done
+ 	cp $RESCPYLIST LisaEm.app/Contents/Resources/   || exit 1
+ 
+-    [ -z "$WITHDEBUG" ] && strip ./lisaem
+     chmod 755 lisaem
+     mv lisaem LisaEm
+     mv LisaEm LisaEm.app/Contents/MacOS/
+@@ -989,8 +986,6 @@ if [ -z "$WITHDEBUG" ]
+ then
+ 
+   echo "Freshly compiled `du -sh lisaem`"
+-  strip lisaem${EXT}
+-  echo "Stripped `du -sh lisaem`"
+ 
+   # compress it if upx exists.
+   if [ -z "$WITHOUTUPX"              ]; then



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808312324.w7VNOK9U011285>