View | Details | Raw Unified | Return to bug 191819
Collapse All | Expand All

(-)emulators/pearpc/Makefile (-45 / +33 lines)
Lines 2-9 Link Here
2
# $FreeBSD: head/emulators/pearpc/Makefile 360256 2014-07-02 20:22:55Z antoine $
2
# $FreeBSD: head/emulators/pearpc/Makefile 360256 2014-07-02 20:22:55Z antoine $
3
3
4
PORTNAME=	pearpc
4
PORTNAME=	pearpc
5
PORTVERSION=	0.4
5
PORTVERSION=	0.5
6
PORTREVISION=	5
7
CATEGORIES=	emulators
6
CATEGORIES=	emulators
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTVERSION}.0
7
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTVERSION}.0
9
8
Lines 12-72 Link Here
12
11
13
LICENSE=	GPLv2
12
LICENSE=	GPLv2
14
13
15
GNU_CONFIGURE=	yes
14
USES=		tar:bzip2
16
USE_XORG=	x11
15
USE_XORG=	x11
17
MAN1=		ppc.1
16
GNU_CONFIGURE=	yes
18
SUB_FILES=	pkg-message
19
20
PLIST_FILES=	bin/ppc etc/ppccfg.example %%DATADIR%%/video.x
21
PLIST_DIRS=	%%DATADIR%%
22
23
OPTIONS_DEFINE=	SDL OPTIMIZED_CFLAGS DEBUG
24
SDL_DESC=	Use SDL for user interface
25
17
26
NO_STAGE=	yes
18
BROKEN_ia64=	Internal compiler error on ia64
27
.include <bsd.port.pre.mk>
28
19
29
.if ${ARCH} == "ia64"
20
PORTEXAMPLES=	ppccfg.example
30
BROKEN=		Internal compiler error on ia64
21
PLIST_FILES=	bin/ppc man/man1/ppc.1.gz %%DATADIR%%/video.x
31
.endif
22
PLIST_DIRS=	%%DATADIR%%
32
23
33
.if ${PORT_OPTIONS:MSDL}
24
OPTIONS_DEFINE=		DEBUG EXAMPLES OPTIMIZED_CFLAGS SDL
34
CONFIGURE_ARGS+=	--enable-ui=sdl
35
USE_SDL=	sdl
36
.else
37
CONFIGURE_ARGS+=	--enable-ui=x11
38
.endif
39
25
40
.if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
26
DEBUG_CONFIGURE_ENABLE=	debug
41
CFLAGS+=	-O3 -ffast-math
27
OPTIMIZED_CFLAGS_CFLAGS=	-O3 -ffast-math
42
.else
28
OPTIMIZED_CFLAGS_CONFIGURE_ENABLE=	fpo
43
CONFIGURE_ARGS+=	--disable-fpo
29
SDL_USE=		sdl=sdl
44
.endif
30
SDL_CONFIGURE_ON=	--enable-ui=sdl
31
SDL_CONFIGURE_OFF=	--enable-ui=x11
45
32
46
.if ${PORT_OPTIONS:MDEBUG}
33
.include <bsd.port.options.mk>
47
CONFIGURE_ARGS+=	--enable-profiling	# implies --enable-debug
48
.endif
49
34
50
.if ${ARCH} == "i386"
35
.if ${ARCH} == "amd64" || ${ARCH} == "i386"
51
BUILD_DEPENDS=	nasm:${PORTSDIR}/devel/nasm
36
USE_GCC=	yes
52
CONFIGURE_ARGS+=	--enable-cpu=jitc_x86
53
.else
37
.else
54
CONFIGURE_ARGS+=	--enable-cpu=generic
38
CONFIGURE_ARGS+=	--enable-cpu=generic
55
.endif
39
.endif
56
40
57
post-extract:
41
post-patch:
58
	@${REINPLACE_CMD} -e 's|-g -O2||;s|-O2||' ${WRKSRC}/configure
42
	@${REINPLACE_CMD} -e \
59
	@${REINPLACE_CMD} -e 's|PROCESS_CPUTIME|THREAD_CPUTIME|' \
43
		's|-O3|| ; \
44
		 s|^\(x86_64\)|amd64\* \| \1| ; \
45
		 s|-g -O2||' ${WRKSRC}/configure
46
	@${REINPLACE_CMD} -e \
47
		 's|video\.x"|${DATADIR}/&|' ${WRKSRC}/ppccfg.example
48
	@${REINPLACE_CMD} -e \
49
		's|PROCESS_CPUTIME|THREAD_CPUTIME|' \
60
		${WRKSRC}/src/system/osapi/posix/systimer.cc
50
		${WRKSRC}/src/system/osapi/posix/systimer.cc
61
	@${REINPLACE_CMD} -e 's|video\.x"|${DATADIR}/&|' \
62
		${WRKSRC}/ppccfg.example
63
51
64
post-install:
52
post-install:
65
	@${MKDIR} ${DATADIR}
53
	@${MKDIR} ${STAGEDIR}${DATADIR}
66
	${INSTALL_DATA} ${WRKSRC}/video.x ${DATADIR}
54
	(cd ${WRKSRC} && ${INSTALL_DATA} video.x \
67
	${INSTALL_DATA} ${WRKSRC}/ppccfg.example ${PREFIX}/etc
55
		${STAGEDIR}${DATADIR})
68
	@${ECHO_CMD}
56
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
69
	@${CAT} ${PKGMESSAGE}
57
	(cd ${WRKSRC} && ${INSTALL_DATA} ppccfg.example \
70
	@${ECHO_CMD}
58
		${STAGEDIR}${EXAMPLESDIR})
71
59
72
.include <bsd.port.post.mk>
60
.include <bsd.port.mk>
(-)emulators/pearpc/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (pearpc-0.4.tar.gz) = cf9501dc95b418dc9632e57c75d59e78ec5204db0ed6b41abced2cea30021cce
1
SHA256 (pearpc-0.5.tar.bz2) = 4b5ac6b111ba55640c2b2d1de9c4f68cb211aadc472474a564ad9ce6a645fbd3
2
SIZE (pearpc-0.4.tar.gz) = 910621
2
SIZE (pearpc-0.5.tar.bz2) = 800380
(-)emulators/pearpc/files/mbrtowc.c (-79 lines)
Lines 1-79 Link Here
1
/*-
2
 * Copyright (c) 2002, 2003 Tim J. Robbins.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
25
 */
26
27
#include <sys/cdefs.h>
28
__FBSDID("$FreeBSD: head/emulators/pearpc/files/mbrtowc.c 340872 2014-01-24 00:14:07Z mat $");
29
30
#include <errno.h>
31
#include <rune.h>
32
#include <stdlib.h>
33
#include <wchar.h>
34
35
/*
36
 * Emulate the ISO C mbrtowc() function in terms of the deprecated
37
 * 4.4BSD sgetrune() function.
38
 */
39
size_t
40
mbrtowc(wchar_t * __restrict pwc, const char * __restrict s,
41
    size_t n, mbstate_t * __restrict ps __unused)
42
{
43
        const char *e;
44
        rune_t r;
45
46
	if (s == NULL) {
47
		pwc = NULL;
48
		s = "";
49
		n = 1;
50
	}
51
52
	if ((r = sgetrune(s, n, &e)) == _INVALID_RUNE) {
53
		/*
54
		 * The design of sgetrune() doesn't give us any way to tell
55
		 * between incomplete and invalid multibyte sequences.
56
		 */
57
58
		if (n >= (size_t)MB_CUR_MAX) {
59
			/*
60
			 * If we have been supplied with at least MB_CUR_MAX
61
			 * bytes and still cannot find a valid character, the
62
			 * data must be invalid.
63
			 */
64
			errno = EILSEQ;
65
			return ((size_t)-1);
66
		}
67
68
		/*
69
		 * .. otherwise, it's an incomplete character or an invalid
70
		 * character we cannot detect yet.
71
		 */
72
		return ((size_t)-2);
73
	}
74
75
	if (pwc != NULL)
76
		*pwc = (wchar_t)r;
77
78
	return (r != 0 ? (size_t)(e - s) : 0);
79
}
(-)emulators/pearpc/files/patch-src::io::prom::fs::hfsplus::unicode.c (-19 lines)
Lines 1-19 Link Here
1
--- src/io/prom/fs/hfsplus/unicode.c.DIST       Thu May  6 10:45:32 2004
2
+++ src/io/prom/fs/hfsplus/unicode.c    Tue May 25 10:06:24 2004
3
@@ -28,6 +28,16 @@
4
 
5
 #include "unicode.h"
6
 
7
+#ifdef FREEBSD_MB_SUPPORT
8
+size_t  mbrtowc __P((wchar_t * __restrict, const char * __restrict, size_t,
9
+                    mbstate_t * __restrict));
10
+size_t  wcrtomb __P((char * __restrict, wchar_t, mbstate_t * __restrict));
11
+
12
+#include "mbrtowc.c"
13
+#include "wcrtomb.c"
14
+#endif /* FREEBSD_MB_SUPPORT */
15
+
16
+
17
 /* convert the asci string astr into a unicode string given by ustr.
18
  *
19
  * ToDo: Think about better error handling ?
(-)emulators/pearpc/files/patch-src__cpu__mem.h (+11 lines)
Line 0 Link Here
1
--- src/cpu/mem.h.orig
2
+++ src/cpu/mem.h
3
@@ -23,7 +23,7 @@
4
 
5
 #include "system/types.h"
6
 
7
-bool	ppc_init_physical_memory(uint size);
8
+bool	FASTCALL ppc_init_physical_memory(uint size);
9
 
10
 uint32  ppc_get_memory_size();
11
 
(-)emulators/pearpc/files/pkg-message.in (-1 lines)
Line 1 Link Here
1
Sample configuration file is installed as %%PREFIX%%/etc/ppccfg.example
(-)emulators/pearpc/files/wcrtomb.c (-57 lines)
Lines 1-57 Link Here
1
/*-
2
 * Copyright (c) 2002, 2003 Tim J. Robbins.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
25
 */
26
27
#include <sys/cdefs.h>
28
__FBSDID("$FreeBSD: head/emulators/pearpc/files/wcrtomb.c 340872 2014-01-24 00:14:07Z mat $");
29
30
#include <errno.h>
31
#include <limits.h>
32
#include <rune.h>
33
#include <stdlib.h>
34
#include <wchar.h>
35
36
/*
37
 * Emulate the ISO C wcrtomb() function in terms of the deprecated
38
 * 4.4BSD sputrune() function.
39
 */
40
size_t
41
wcrtomb(char * __restrict s, wchar_t wc,
42
    mbstate_t * __restrict ps __unused)
43
{
44
	char *e;
45
	char buf[MB_LEN_MAX];
46
47
	if (s == NULL) {
48
		s = buf;
49
		wc = L'\0';
50
	}
51
	sputrune(wc, s, MB_CUR_MAX, &e);
52
	if (e == NULL) {
53
		errno = EILSEQ;
54
		return ((size_t)-1);
55
	}
56
	return ((size_t)(e - s));
57
}

Return to bug 191819