Index: head/misc/Makefile =================================================================== --- head/misc/Makefile +++ head/misc/Makefile @@ -101,6 +101,7 @@ SUBDIR += fortune-mod-psalms SUBDIR += fortuneit SUBDIR += fpc-chm + SUBDIR += free42 SUBDIR += freebsd-doc-all SUBDIR += freebsd-doc-bn SUBDIR += freebsd-doc-da Index: head/misc/free42/Makefile =================================================================== --- head/misc/free42/Makefile +++ head/misc/free42/Makefile @@ -0,0 +1,43 @@ +# $FreeBSD$ + +PORTNAME= Free42 +DISTVERSION= 2.0.7 +CATEGORIES= misc +MASTER_SITES= http://thomasokken.com/free42/upstream/ +DISTNAME= ${PORTNAME:tl}-nologo-${DISTVERSION} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Simulation of the HP-42S scientific calculator and HP-82240 printer + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/COPYING + +LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ + libfreetype.so:print/freetype2 + +USES= dos2unix gmake localbase pkgconfig tar:tgz +USE_GNOME= atk cairo gdkpixbuf2 glib20 gtk20 pango +USE_XORG= x11 xmu +DOS2UNIX_FILES= gtk/IntelRDFPMathLib20U1/LIBRARY/float128/op_system.h + +BUILD_WRKSRC= ${WRKSRC}/gtk + +post-extract: + @${RM} `${FIND} ${WRKDIR} -name "*.orig"` + @cd ${BUILD_WRKSRC} && tar xvfz ../inteldecimal/IntelRDFPMathLib20U1.tar.gz + +post-patch: + @${REINPLACE_CMD} -e 's|"%s/%s.%s", free42dirname, name,|"%s/%s.%s", "${DATADIR:tl}", name,|' \ + ${BUILD_WRKSRC}/shell_skin.cc + +do-build: + @cd ${BUILD_WRKSRC} && \ + ${SETENV} ${MAKE_ENV} ${MAKE_CMD} cleaner && \ + ${SETENV} ${MAKE_ENV} ${MAKE_CMD} + # TODO do we need decimal fp arithmetic?: ${MAKE_CMD} BCD_MATH=1 SKIN_SYS_DIR="${DATADIR:tl}" + +do-install: + ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/free42bin ${STAGEDIR}${PREFIX}/bin/ + @cd ${WRKSRC} && ${COPYTREE_SHARE} skins ${STAGEDIR}${DATADIR:tl} + +.include Index: head/misc/free42/distinfo =================================================================== --- head/misc/free42/distinfo +++ head/misc/free42/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1511214642 +SHA256 (free42-nologo-2.0.7.tgz) = 97241d56372163904755f8fcf7724adcaa12a2e0fbaf9670c3661c3645805ccc +SIZE (free42-nologo-2.0.7.tgz) = 7354819 Index: head/misc/free42/files/patch-common_free42.h =================================================================== --- head/misc/free42/files/patch-common_free42.h +++ head/misc/free42/files/patch-common_free42.h @@ -0,0 +1,11 @@ +--- common/free42.h.orig 2017-11-20 23:46:32 UTC ++++ common/free42.h +@@ -70,7 +70,7 @@ + * provided by MathLib. + */ + extern "C" void sincos(double x, double *sinx, double *cosx); +-//#define NO_SINCOS 1 ++#define NO_SINCOS 1 + + #endif + Index: head/misc/free42/files/patch-gtk_IntelRDFPMathLib20U1_LIBRARY_float128_op__system.h =================================================================== --- head/misc/free42/files/patch-gtk_IntelRDFPMathLib20U1_LIBRARY_float128_op__system.h +++ head/misc/free42/files/patch-gtk_IntelRDFPMathLib20U1_LIBRARY_float128_op__system.h @@ -0,0 +1,27 @@ +--- gtk/IntelRDFPMathLib20U1/LIBRARY/float128/op_system.h.orig 2011-06-29 18:33:08 UTC ++++ gtk/IntelRDFPMathLib20U1/LIBRARY/float128/op_system.h +@@ -103,6 +103,24 @@ + # define OP_SYSTEM linux + + ++#elif (defined(__FreeBSD__)) ++ ++# undef dos ++# undef vms ++# undef wnt ++# undef osf ++# undef hp_ux ++# undef linux ++# undef unicos ++# undef ultrix ++# undef win64 ++# undef darwin ++# undef interix ++ ++# define linux 8 ++# define OP_SYSTEM freebsd ++ ++ + #elif (defined(osf) || defined(OSF) || defined(__osf__)) + + Index: head/misc/free42/files/patch-gtk_IntelRDFPMathLib20U1_LIBRARY_makefile.iml__head =================================================================== --- head/misc/free42/files/patch-gtk_IntelRDFPMathLib20U1_LIBRARY_makefile.iml__head +++ head/misc/free42/files/patch-gtk_IntelRDFPMathLib20U1_LIBRARY_makefile.iml__head @@ -0,0 +1,11 @@ +--- gtk/IntelRDFPMathLib20U1/LIBRARY/makefile.iml_head.orig 2017-11-21 01:24:38 UTC ++++ gtk/IntelRDFPMathLib20U1/LIBRARY/makefile.iml_head +@@ -344,7 +344,7 @@ else + endif + endif + +-ARCH_ALIAS := x86 ia64 EM64T x86_64 i686 amd64 Intel64 sun4u ++ARCH_ALIAS := x86 i386 ia64 EM64T x86_64 i686 amd64 Intel64 sun4u + ARCH_LIST := IA32 IA64 EFI2 EFI2 IA32 EFI2 EFI2 EFI2 + ARCH_TYPE := IA32 IA64 EFI2 EFI2 IA32 EFI2 EFI2 EFI2 + ARCH_TYPES := IA32 IA64 EFI2 Index: head/misc/free42/files/patch-gtk_Makefile =================================================================== --- head/misc/free42/files/patch-gtk_Makefile +++ head/misc/free42/files/patch-gtk_Makefile @@ -0,0 +1,53 @@ +--- gtk/Makefile.orig 2017-11-20 03:58:50 UTC ++++ gtk/Makefile +@@ -15,12 +15,11 @@ + # along with this program; if not, see http://www.gnu.org/licenses/. + ############################################################################### + +-CFLAGS = -MMD \ ++FLAGS_COMMON = \ ++ -MMD \ + -Wall \ + -Wno-parentheses \ + -Wno-write-strings \ +- -g \ +- -I/usr/X11R6/include \ + $(shell pkg-config --cflags gtk+-2.0) \ + -DVERSION="\"$(shell cat ../VERSION)\"" \ + -DDECIMAL_CALL_BY_REFERENCE=1 \ +@@ -29,13 +28,14 @@ CFLAGS = -MMD \ + -DDECIMAL_GLOBAL_EXCEPTION_FLAGS=1 \ + -DDECIMAL_GLOBAL_EXCEPTION_FLAGS_ACCESS_FUNCTIONS=1 + +-CXXFLAGS = $(CFLAGS) \ ++CFLAGS+= $(FLAGS_COMMON) ++ ++CXXFLAGS+= $(FLAGS_COMMON) \ + -fno-exceptions \ + -fno-rtti \ + -D_WCHAR_T_DEFINED + +-LDFLAGS = -L/usr/X11R6/lib +-LIBS = gcc111libbid.a -lXmu $(shell pkg-config --libs gtk+-2.0) ++LIBS = gcc111libbid.a -lXmu $(shell pkg-config --libs gtk+-2.0) -lX11 + + ifeq "$(shell uname -s)" "Linux" + LDFLAGS += -Wl,--hash-style=both +@@ -118,7 +118,7 @@ clean: FORCE + readtest_lines.cc \ + gcc111libbid.a \ + *.o *.d *.i *.ii *.s symlinks core.* +- rm -rf IntelRDFPMathLib20U1 ++ #rm -rf IntelRDFPMathLib20U1 + + cleaner: FORCE + rm -f `find . -type l` \ +@@ -128,7 +128,7 @@ cleaner: FORCE + readtest_lines.cc \ + gcc111libbid.a \ + *.o *.d *.i *.ii *.s symlinks core.* +- rm -rf IntelRDFPMathLib20U1 ++ #rm -rf IntelRDFPMathLib20U1 + + FORCE: + Index: head/misc/free42/files/patch-gtk_build-intel-lib.sh =================================================================== --- head/misc/free42/files/patch-gtk_build-intel-lib.sh +++ head/misc/free42/files/patch-gtk_build-intel-lib.sh @@ -0,0 +1,15 @@ +--- gtk/build-intel-lib.sh.orig 2017-11-20 03:58:50 UTC ++++ gtk/build-intel-lib.sh +@@ -1,10 +1,10 @@ + #!/bin/sh + if [ -f gcc111libbid.a ]; then exit 0; fi +-tar xvfz ../inteldecimal/IntelRDFPMathLib20U1.tar.gz ++#tar xvfz ../inteldecimal/IntelRDFPMathLib20U1.tar.gz + cd IntelRDFPMathLib20U1 + patch -p0 <../intel-lib-linux.patch + cd LIBRARY +-make CC=gcc CALL_BY_REF=1 GLOBAL_RND=1 GLOBAL_FLAGS=1 UNCHANGED_BINARY_FLAGS=0 ++gmake CC=cc CALL_BY_REF=1 GLOBAL_RND=1 GLOBAL_FLAGS=1 UNCHANGED_BINARY_FLAGS=0 + mv libbid.a ../../gcc111libbid.a + cd ../.. + ( echo '#ifdef FREE42_FPTEST'; echo 'const char *readtest_lines[] = {'; tr -d '\r' < IntelRDFPMathLib20U1/TESTS/readtest.in | sed 's/^\(.*\)$/"\1",/'; echo '0 };'; echo '#endif' ) > readtest_lines.cc Index: head/misc/free42/pkg-descr =================================================================== --- head/misc/free42/pkg-descr +++ head/misc/free42/pkg-descr @@ -0,0 +1,5 @@ +Free42 is a re-implementation of the HP-42S Scientific Programmable Calculator +and HP-82240 Printer. It is a complete rewrite, not using any HP code. It does +not require an HP-42S ROM image. + +WWW: http://thomasokken.com/free42 Index: head/misc/free42/pkg-plist =================================================================== --- head/misc/free42/pkg-plist +++ head/misc/free42/pkg-plist @@ -0,0 +1,6 @@ +bin/free42bin +share/free42/skins/Ehrling42sl.gif +share/free42/skins/Ehrling42sl.layout +share/free42/skins/README.txt +share/free42/skins/Standard.gif +share/free42/skins/Standard.layout