Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
New(ish) PearPC ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
dobbs
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 96
Location: Wenatchee, WA

PostPosted: Sat Aug 06, 2011 5:13 am    Post subject: New(ish) PearPC ebuild Reply with quote

Ok, here's the deal:

PearPC 0.5 is out. I've managed to build it on x86 and amd64 with the ebuild posted below.

I'm far from an ebuild expert, so I'm looking for constructive suggestions and opinions from the community. The ebuild is a slight modification to the 0.4 ebuild previously in portage. The jit USE flag would not build on amd64. Have at it, and let me know how it runs!

Code:
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/pearpc/pearpc-0.4.ebuild,v 1.13 2009/09/06 21:18:20 robbat2 Exp $

inherit eutils flag-o-matic linux-mod

DESCRIPTION="PowerPC Architecture Emulator"
HOMEPAGE="http://pearpc.sourceforge.net/"
SRC_URI="mirror://sourceforge/pearpc/${P}.tar.bz2
   http://pearpc.sf.net/createdisk.py"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="debug jit X sdl"

RDEPEND="sys-apps/net-tools
   sdl? ( >=media-libs/libsdl-1.2.0 )
   X? ( x11-libs/libX11 )
   net-firewall/iptables
   net-misc/bridge-utils"
DEPEND="${RDEPEND}
   sys-devel/flex
   sys-devel/bison
   x86? ( dev-lang/nasm )
   jit? ( dev-lang/nasm )"

src_unpack() {
   unpack ${A}
   cd "${S}"

   epatch "${FILESDIR}/${P}-configure.patch"
}

pkg_setup() {
   linux-mod_pkg_setup
   if ! linux_chkconfig_present TUN; then
      die "You must have TUN/TAP enabled in your kernel."
   fi
}

src_compile() {
   local myconf

   use jit || myconf="${myconf} --enable-cpu=generic"
   if use sdl; then
      myconf="${myconf} --enable-ui=sdl"
   elif use X; then
      myconf="${myconf} --enable-ui=x11"
   else
      die "You must set at least one of these flags: X, sdl"
   fi

   econf \
      $(use_enable debug) \
      ${myconf} \
      || die "econf failed"
   emake || die "emake failed"
   sed -i -e "s:video.x:/usr/share/${P}/video.x:g" ppccfg.example
}

src_install() {
   dobin src/ppc
   dodoc ChangeLog AUTHORS README TODO ppccfg.example

   insinto /usr/share/${P}
   doins scripts/ifppc_{down,up}{,.setuid} video.x "${FILESDIR}"/settings
   fperms u+s,a+x /usr/share/${P}/ifppc_{up,down}.setuid

   insinto /usr/share/${P}/scripts
   doins "${DISTDIR}"/createdisk.py
}

pkg_postinst() {
   elog "You will need to update your configuration files to point"
   elog "to the new location of video.x, which is now"
   elog "/usr/share/${P}/video.x"
   elog ""
   elog "To create disk images for PearPC, you can use the Python"
   elog "script located at: /usr/share/${P}/scripts/createdisk.py"
   elog "Usage: createdisk.py <image name> <image size>"
   elog ""
   elog "Also, be sure to check ppccfg.example in /usr/share/doc/${P}/"
   elog "for new configuration options."
}

Revisions:
  • Properly selects JIT CPU on x86 and amd64 2011.08.06
  • Re-enabled configure script patching to prevent overriding CFLAGS optimization level (see patch in following posts) 2011.08.08


Last edited by dobbs on Mon Aug 08, 2011 10:20 pm; edited 2 times in total
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1028
Location: Romania

PostPosted: Sat Aug 06, 2011 7:26 am    Post subject: Reply with quote

There's a jit flag for x86-64 too, see
Code:
./configure --help | grep jit

Try something like this:
Quote:
if use jit; then
use x86 && myconf="${myconf} --enable-cpu=jitc_x86"
use amd64 && myconf="${myconf} --enable-cpu=jitc_x86_64"
fi

_________________
My Smooth Computer
MB: VIA 82C598MVP on DFI P5BV3+/Rev. B+
CPU: AMD K6-II 333 MHz | RAM: 256 MB SDRAM
Video: Asus MB19TU on nVidia GeForce MX4000 64 MB
Sound: CM8738 | Net: RTL-8139
PATA HDD WD 80 GB & DVD-RW LG 16x
Back to top
View user's profile Send private message
dobbs
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 96
Location: Wenatchee, WA

PostPosted: Sun Aug 07, 2011 2:18 am    Post subject: Reply with quote

Hmm, there's a bug in the configure script. Running:
Code:
./configure --enable-cpu="jitc_x86_64"
actually selects the "jitc_x86" emulation. Not specifying a CPU compiles fine with jitc_x86_64.

I'll add the fix into the original ebuild up above for now. Should I create a new post for each revision or continue modifying the original post?
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1028
Location: Romania

PostPosted: Sun Aug 07, 2011 7:02 am    Post subject: Reply with quote

You could apply pearpc-0.5-configure.patch:
Code:
--- pearpc-0.5~/configure   2011-07-13 00:21:49.000000000 +0300
+++ pearpc-0.5/configure   2011-08-07 09:55:02.000000000 +0300
@@ -2646,11 +2646,11 @@
 PPC_CCASFLAGS=""
 
 if test "x$enable_release" = "xyes"; then
-   PPC_CFLAGS="$CFLAGS $PPC_CFLAGS -O3"
-   PPC_CXXFLAGS="$CXXFLAGS $PPC_CXXFLAGS -O3"
+   PPC_CFLAGS="$CFLAGS $PPC_CFLAGS"
+   PPC_CXXFLAGS="$CXXFLAGS $PPC_CXXFLAGS"
 else
-   PPC_CFLAGS="$PPC_CFLAGS -O0"
-   PPC_CXXFLAGS="$PPC_CXXFLAGS -O0"
+   PPC_CFLAGS="$CFLAGS $PPC_CFLAGS"
+   PPC_CXXFLAGS="$CXXFLAGS $PPC_CXXFLAGS"
 fi
 
 if test "x$enable_fpo" = "xyes"; then
@@ -4174,13 +4174,13 @@
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
   if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
+    CFLAGS="-g"
   else
     CFLAGS="-g"
   fi
 else
   if test "$GCC" = yes; then
-    CFLAGS="-O2"
+    CFLAGS=""
   else
     CFLAGS=
   fi
@@ -4711,13 +4711,13 @@
   CXXFLAGS=$ac_save_CXXFLAGS
 elif test $ac_cv_prog_cxx_g = yes; then
   if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
+    CXXFLAGS="-g"
   else
     CXXFLAGS="-g"
   fi
 else
   if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
+    CXXFLAGS=""
   else
     CXXFLAGS=
   fi

For revisions, you could host old ones somewhere and edit this post with the newest one.
_________________
My Smooth Computer
MB: VIA 82C598MVP on DFI P5BV3+/Rev. B+
CPU: AMD K6-II 333 MHz | RAM: 256 MB SDRAM
Video: Asus MB19TU on nVidia GeForce MX4000 64 MB
Sound: CM8738 | Net: RTL-8139
PATA HDD WD 80 GB & DVD-RW LG 16x
Back to top
View user's profile Send private message
dobbs
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 96
Location: Wenatchee, WA

PostPosted: Mon Aug 08, 2011 10:18 pm    Post subject: Reply with quote

Ah, thank you for updating the patch. I tweaked it slightly to be overly anal :) Something about identical results for if/else structure grates my nerves, even though my changes don't really add anything beyond yours... Anyway, custom optimization levels work now, woo.

Code:
--- pearpc-0.5_original/configure       2011-07-12 14:21:49.000000000 -0700
+++ pearpc-0.5_patched/configure        2011-08-08 14:55:51.451875610 -0700
@@ -2645,13 +2645,8 @@
 PPC_LDFLAGS="$LDFLAGS"
 PPC_CCASFLAGS=""

-if test "x$enable_release" = "xyes"; then
-       PPC_CFLAGS="$CFLAGS $PPC_CFLAGS -O3"
-       PPC_CXXFLAGS="$CXXFLAGS $PPC_CXXFLAGS -O3"
-else
-       PPC_CFLAGS="$PPC_CFLAGS -O0"
-       PPC_CXXFLAGS="$PPC_CXXFLAGS -O0"
-fi
+PPC_CFLAGS="$CFLAGS $PPC_CFLAGS"
+PPC_CXXFLAGS="$CXXFLAGS $PPC_CXXFLAGS"

 if test "x$enable_fpo" = "xyes"; then
        PPC_CFLAGS="$PPC_CFLAGS -fomit-frame-pointer"
@@ -4173,17 +4168,9 @@
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
+  CFLAGS="-g"
 else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
+  CFLAGS=
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
@@ -4710,17 +4697,9 @@
 if test "$ac_test_CXXFLAGS" = set; then
   CXXFLAGS=$ac_save_CXXFLAGS
 elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
+  CXXFLAGS="-g"
 else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
+  CXXFLAGS=
 fi
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
Back to top
View user's profile Send private message
dobbs
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 96
Location: Wenatchee, WA

PostPosted: Sun Aug 21, 2011 1:16 am    Post subject: Reply with quote

Submitted bug 380021 to request addition to portage. The ebuild and the patch are attached to the bug.
Back to top
View user's profile Send private message
Atha
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2004
Posts: 115

PostPosted: Thu Apr 04, 2013 5:24 pm    Post subject: ebuild Reply with quote

Hello dobbs, hello sebaro, hello everyone!

I’m using this ebuild now on my ARCH=amd64 system! Thank you for provinding it! This is highly appreciated!

However, I’ve problems using the JIT emulation method x86_64 either way – with and without the ebuild. A 32-Bit JIT version x86 that I created using a chroot32 Gentoo installation doesn’t seem to run properly on my 64-Bit system as well.

The only thing that works is the generic emulation method, which is slow, slow, slow… but relatively stable. I ran Panther and Tiger in it, all without issues (other than the cursor and the CUDA IO issues).

Do your emulations run using the JIT method? x86 or amd64?
I’d be eager to know how it is done, if it is possible at all.

Also, I don’t do networking yet. I’m not using the ifppc_up and ifppc_down scripts at the moment, I just found that the sourced settings file is missing, but it would be included with the installation from the ebuild – provided it is available in the files directory of the ebuild.

Thanks,
Atha
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum