You are not logged in.

#1 2005-09-05 20:32:39

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

[ Request ] mupen64-0.5

Hello, all.

I've been trying to compile from scratch an arch package of mupen64...available here:

http://www.emutalk.net/mupen64/29643-mu … -code.html

I just can't seem to get it working.  I keep getting errors on "make install" saying that the dirs can't be created.

Offline

#2 2005-09-05 21:23:07

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [ Request ] mupen64-0.5

It's a common error. Post the PKGBUILD and error message.

Offline

#3 2005-09-06 05:02:05

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: [ Request ] mupen64-0.5

Ok...  Thanks for the reply, Snowman.

Well, I'm a beginner at this whole thing (still...sheesh), so the PKGBUILD is pretty basic:

pkgname=mupen64
pkgver=0.5
pkgrel=1
pkgdesc="An OSS Nintendo 64 emulator"
url="http://mupen64.emulation64.com/"
depends=('gtk2' 'x-server' 'sdl')
source=(http://mupen64.emulation64.com/files/0.5/$pkgname_src-$pkgver.tar.bz2)

build() {
  cd $startdir/src/$pkgname_src-$pkgver
  ./configure --prefix=/usr
  make || return 1
  make DESTDIR=$startdir/pkg install
}

The error is as follows:

mkdir ""#undef WITH_HOMEshare/mupen64/"" | echo
mkdir: cannot create directory 'WITH_HOMEshare/mupen64/': No such file or directory

cp -rv mupen64.ini ""#undef WITH_HOMEshare/mupen64/""
cp: 'WITH_HOMEshare/mupen64/': specified destination directory doesn't exist
Try 'cp --help' for more information
make: *** [install] Error 1
==> ERROR: Build Failed.  Aborting...

The 'configure' script actually requires you to make several choices during the package creation, which I don't know how to deal with in the PKGBUILD, either.  I'm fine with all the defaults, though (those are what I selected to produce the above errors).  In the link I posted above, the thread goes on to mention some patches some users applied to some of the files in the archive to fix some problems, but I'm not sure how to apply those patches.  I looked at the files in the archive as downloaded and some of the changes appear to have been added.

Any help/ideas would be greatly appreciated.

Offline

#4 2005-09-06 06:14:34

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [ Request ] mupen64-0.5

I would recommend to use the PKGBUILD in AUR: http://aur.archlinux.org/packages.php?d … =1&ID=1169
Although, it's for version 0.4 and it uses a precompiled binary instead of compiling the sources.  It flagged out-of-date so it should be updated eventually. I succeeded to building it but on startup it said it can't  find a certain file then seg faults. Anyway, here's the PKGBUILD file I used, in case you're interested:

pkgname=mupen64
pkgver=0.5
pkgrel=1
pkgdesc="An OSS Nintendo 64 emulator"
url="http://mupen64.emulation64.com/"
depends=('gtk2' 'x-server' 'sdl')
source=(http://mupen64.emulation64.com/files/0.5/$pkgname_src-$pkgver.tar.bz2)

build() {
  cd $startdir/src/$pkgname_src-$pkgver
  ./configure --prefix=/usr
  make || return 1
  install -d $startdir/pkg/usr/{bin,share/mupen64}
  make PREFIX=$startdir/pkg/usr/ install
}

Offline

#5 2005-09-06 06:30:56

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: [ Request ] mupen64-0.5

Cool.  I'll look at that more in the morning.  The reason I wanted to compile it from source is because I already modified the one in the AUR to build the binary version.  Although it works, I have experienced poor compatibility.  So much so that, citing errors I'd gotten from running from the command line, I was recommended to compile from scratch.  Now, I'm stuck.  For the moment, anyway...  smile

Thanks a bunch, Snowman.  I'll probably fool with what you've done for awhile and then report back.

Offline

#6 2005-09-06 14:02:29

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: [ Request ] mupen64-0.5

EDIT: This pkgbuild is outdated. Please use the one in AUR instead.

Packaging mupen64 is somewhat messy. The compile doesn't honor CFLAGS and the Makefile has "-mcpu=athlon" enabled by default.  :?
The interactive ./configure script just creates the config.h file, so I think you can skip ./configure in the PKGBUILD and provide a separate config.h file by hand.

Here's the PKGBUILD I threw together:

pkgname=mupen64 
pkgver=0.5 
pkgrel=1 
pkgdesc="An OSS Nintendo 64 emulator" 
url="http://mupen64.emulation64.com/" 
depends=('gtk2' 'x-server' 'sdl') 
source=(http://mupen64.emulation64.com/files/0.5/$pkgname_src-$pkgver.tar.bz2 mupen.config mupenpatch.diff) 

build() { 
  cd $startdir/src/$pkgname_src-$pkgver 
  patch -Np1 -i ../mupenpatch.diff
  cp ../mupen.config ./config.h
  sed -i -e "s:-mcpu=athlon:${CFLAGS}:" Makefile 
  make clean 
  make || return 1 
  install -d $startdir/pkg/usr/{bin,share/mupen64} 
  make PREFIX=$startdir/pkg/usr/ install 
}

You'll also need these:

mupen.config:

#ifndef CONFIG_H
#define CONFIG_H

#define WITH_HOME "/usr/"
#undef VCR_SUPPORT
#define GTK2_SUPPORT 1

#endif /* CONFIG_H */

mupenpatch.diff:

diff -ruN mupen64_src-0.5/Makefile mupen64_src-0.5-test/Makefile
--- mupen64_src-0.5/Makefile    2005-08-26 19:52:13.000000000 +0000
+++ mupen64_src-0.5-test/Makefile       2005-09-06 13:41:04.000000000 +0000
@@ -405,7 +405,7 @@
        
 clean:
        find . -name '*.o' -print0 | xargs -0r rm -f
-       rm mupen64 mupen64_nogui mupen64_dbg plugins/mupen64_input.so blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.so plugins/mupen64_hle_rsp_azime
r.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
+       rm -f mupen64 mupen64_nogui mupen64_dbg plugins/mupen64_input.so blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.so plugins/mupen64_hle_rsp_az
imer.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
 
 clean_o:
        find . -name '*.o' -print0 | xargs -0r rm -f
File mupen64_src-0.5/compare_pipe is a fifo while file mupen64_src-0.5-test/compare_pipe is a fifo
diff -ruN mupen64_src-0.5/main/main.c mupen64_src-0.5-test/main/main.c
--- mupen64_src-0.5/main/main.c 2005-08-26 19:52:11.000000000 +0000
+++ mupen64_src-0.5-test/main/main.c    2005-09-06 13:41:21.000000000 +0000
@@ -37,6 +37,8 @@
 
 #include <stdlib.h>
 #include <unistd.h>
+#include <dirent.h>
+#include <sys/stat.h>
 
 #include "main.h"
 #include "guifuncs.h"

Offline

#7 2005-09-06 14:40:25

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: [ Request ] mupen64-0.5

Hello, sh__

Thanks for your help.  For you, that PKGBUILD worked?  For me, it fails like this:

main/main.c: In function 'main':
main/main.c:251: error: 'DIR' undeclared (first use in this function)
main/main.c:251: error: (Each undeclared identifier is reported only once
main/main.c:251: error: for each function it appears in)
main/main.c:251: error: 'dir' undeclared (first use in this function)
main/main.c:256: warning: implicit declaration of function 'mkdir'
main/main.c:292: warning: implicit declaration of function 'opendir'
main/main.c:293: warning: implicit declaration of function 'readdir'
main/main.c:293: warning: assignment makes pointer from integer without a cast
main/main.c:295: error: dereferencing point to incomplete type (it says this times...20 or so)
main/main.c:299: error: dereferencing point to incomplete type
main/main.c:305: error: dereferencing point to incomplete type
main/main.c:322: error: dereferencing point to incomplete type
main/main.c:325: error: dereferencing point to incomplete type
make: *** [main/main.o] Error 1
==> ERROR: Build Failed. Aborting...

At least I've switched up the errors...  smile

Should this problem be reported to the devs of mupen64?

Again, thanks for your help.

Offline

#8 2005-09-06 15:39:11

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: [ Request ] mupen64-0.5

Hi beniro,

Did you copy the mupenpatch.diff to the same directory where you run makepkg? Main/main.c is just missing two header files, this has already been reported in the mupen forums. The patch is from there. It builds fine for me.

I did notice that playing around with the GUI causes sometimes segfaults. Can't reproduce them, though.

Offline

#9 2005-09-06 17:49:01

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: [ Request ] mupen64-0.5

Yeah, I put the other two files in the same dir with the PKGBUILD.

I don't know what to do now...maybe you could email me the comiled package to using4s at yahoo dot com?

Offline

#10 2005-09-06 19:20:16

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [ Request ] mupen64-0.5

beniro: Are you sure that the patching worked? Replace
patch -Np1 -i ../mupenpatch.diff
by
patch -Np1 -i ../mupenpatch.diff || return 1
The build will stop if the pactch wasn't successful. There could be a problem with the patch because of cut 'n' paste. I haven't tried sh__ PKGBUILD tough.

Offline

#11 2005-09-06 20:07:45

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: [ Request ] mupen64-0.5

Ok...so that was part of the problem...The lines that were wrapped above were pasted as such and that screwed things up...

But I'm still getting an error.

patching file Makefile
Hunk #1 FAILED at 405.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
patching file main/main.c
patch unexpectedly ends in middle of line
patch unexpectedly ends in middle of line

Hmmm...I'm not sure what that means, exactly, as I see no premature end to the main.c lines of the .diff.

Here's Makefile.rej:

***************
*** 405,411 ****
        
  clean:
         find . -name '*.o' -print0 | xargs -0r rm -f
-        rm mupen64 mupen64_nogui mupen64_dbg plugins/mupen64_input.so blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.so plugins/mupen64_hle_rsp_azimer.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
  
  clean_o:
         find . -name '*.o' -print0 | xargs -0r rm -f
--- 405,411 ----
        
  clean:
         find . -name '*.o' -print0 | xargs -0r rm -f
+        rm -f mupen64 mupen64_nogui mupen64_dbg plugins/mupen64_input.so blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.so plugins/mupen64_hle_rsp_azimer.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
  
  clean_o:
         find . -name '*.o' -print0 | xargs -0r rm -f

Offline

#12 2005-09-06 20:56:19

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [ Request ] mupen64-0.5

In your patch, replace the spaces in front of the rm and find lines by tabs.

Offline

#13 2005-09-06 21:03:44

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: [ Request ] mupen64-0.5

Well...shheeeeit!  smile

That was it...it worked!

Thanks so much for your help.  I'm now a bit better at this.  smile

Snowman, you rock!

sh__, you rock!

Thanks so much!

I will now be mucking around further!  smile

Offline

#14 2005-09-07 11:45:47

Father
Member
From: Australia
Registered: 2004-06-01
Posts: 209

Re: [ Request ] mupen64-0.5

I'm a bit busy atm, so I don't know when I'll get around to updating the pkgbuild, but hopefully not too long.

In the mean time, thanks for helping out `sh__'.. I'll most likely use your pkg for my one in AUR if thats ok?
unless youd rather take it over as maintainer?
I'm not fussed.

Offline

#15 2005-09-07 12:15:01

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: [ Request ] mupen64-0.5

Hi all,

I'm having some troubles with the package. I keep getting segfaults when changing the audio plugin settings and when loading some roms. However, these problems magically disappear when I run mupen straight from the build directory (without installing it). I'm really puzzled. Maybe it's a permission issue?

Father: it's ok to use the pkgbuild in AUR. I'm just worried that others will encounter similar issues that I currently do.

Offline

#16 2005-09-07 16:30:28

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: [ Request ] mupen64-0.5

Well, I thought I'd chime in on this one.

For me, this package works much better than running the precomiled binary provided by the mupen64 devs.  I couldn't get that to play a single game.

But that's just the experience I've had since finally getting it to compile.  smile

Offline

#17 2005-09-07 19:07:40

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [ Request ] mupen64-0.5

sh__ wrote:

I'm having some troubles with the package. I keep getting segfaults when changing the audio plugin settings and when loading some roms. However, these problems magically disappear when I run mupen straight from the build directory (without installing it). I'm really puzzled. Maybe it's a permission issue?

It might be related to
#define WITH_HOME "/usr/" 
I  think WITH_HOME  means that the apps is install in a user home dir.  Maybe it needs WITHOUT_HOME or wathever variable it use to tell the apps that it's installed in a system directory.  I could be wrong. I haven't read the configure script in detail or tried  the apps using sh__ PKGBUILD.

Offline

#18 2005-09-07 20:17:48

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: [ Request ] mupen64-0.5

Snowman wrote:

It might be related to
#define WITH_HOME "/usr/" 
I  think WITH_HOME  means that the apps is install in a user home dir.  Maybe it needs WITHOUT_HOME or wathever variable it use to tell the apps that it's installed in a system directory.  I could be wrong. I haven't read the configure script in detail or tried  the apps using sh__ PKGBUILD.

Yep, I think there are some incompatibilities between the multi-user installation and some parts of the code.

In the configure script you can choose to do a single user (default) or a multi-user installation. Choosing single user corresponds to setting
#undef WITH_HOME in config.h. This builds fine and works fine, if you run it from the directory it was built in. It's difficult to make a package out of this, since the program searches the config files in the same directory where it resides. It most likely needs write access too. Well, maybe there is a way around that.

Choosing multi-user allows you to set WITH_HOME (default is /usr/local/). This is what I did in the PKGBUILD. It still builds fine, but loading some roms and trying to save the mupen64_audio-plugin settings gives segfaults for me. I found similar notes in the mupen forums, so I think this is an upstream issue.  smile

Offline

#19 2005-09-07 21:41:15

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [ Request ] mupen64-0.5

I've had silimar issue with smc.  What I did was to first run the app as root to be able to create the config files and then giving them rw permission  for other users.  The downsize is that all users share the same config but it works (at least it did for smc).  It's a dirty hack until it get fixed upstream.

Offline

#20 2005-09-07 22:42:53

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: [ Request ] mupen64-0.5

I've located the problem with the mupen64_audio plugin, I hope I can create a patch for it. In the meantime just use jttl's SDL audio plugin, it doesn't create config files.  smile

What really bugs me is the segfault with some roms (for example Zelda: Ocariana of Time). It loads the rom and shows the spinning N logo, and then segfaults. It has something to do with permissions, since the single user build runs the rom ok.

Offline

#21 2005-09-07 23:40:39

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: [ Request ] mupen64-0.5

Zelda: Ocarina of Time runs perfectly using Rice's plugin and jttl's audio plugin.  I'm using your PKGBUILD, unmodified.

Offline

#22 2005-09-08 00:12:14

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: [ Request ] mupen64-0.5

beniro wrote:

Zelda: Ocarina of Time runs perfectly using Rice's plugin and jttl's audio plugin.  I'm using your PKGBUILD, unmodified.

Whoa! It does indeed!  big_smile

Did you find the source for Rice's plugin or do you use the precompiled binary that comes with the mupen package from the mupen website?

Offline

#23 2005-09-08 01:38:45

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: [ Request ] mupen64-0.5

I used the precompiled one.

The source for the current version of Rice's plugin hasn't been released yet.  He's planning on it, I believe.

Offline

#24 2005-09-08 12:49:48

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: [ Request ] mupen64-0.5

smile  Phew... I think I finally sorted it out. First of all, mupen64_audio/main.c needs to be patched. My problem with glN64 plugin was caused by compile flags, the build seems very sensitive about them. I realized this when I noticed that both the precompiled ricevideo and glN64 plugins work ok.

I have altered the pkgbuild and the patch file accordingly. Now everything should work out of the box. Sorry for the long lines in the patch file.

PKGBUILD:

pkgname=mupen64 
pkgver=0.5 
pkgrel=1 
pkgdesc="An OSS Nintendo 64 emulator" 
url="http://mupen64.emulation64.com/" 
depends=('gtk2' 'x-server' 'sdl') 
source=(http://mupen64.emulation64.com/files/0.5/$pkgname_src-$pkgver.tar.bz2 mupen.config mupenpatch2.diff) 

build() { 
  cd $startdir/src/$pkgname_src-$pkgver 
  patch -Np1 -i ../mupenpatch2.diff
  cp ../mupen.config ./config.h
  sed -i -e "s:-mcpu=athlon:-march=i686:" Makefile 
  make clean all || return 1 
  install -d $startdir/pkg/usr/{bin,share/mupen64} 
  make PREFIX=$startdir/pkg/usr/ install 
  rm -rf $startdir/pkg/usr/share/$pkgname/doc
}

mupen.config:

#ifndef CONFIG_H
#define CONFIG_H

#define WITH_HOME "/usr/"
#undef VCR_SUPPORT
#define GTK2_SUPPORT 1

#endif /* CONFIG_H */

mupenpatch2.diff

diff -ruN mupen64_src-0.5-orig/Makefile mupen64_src-0.5/Makefile
--- mupen64_src-0.5-orig/Makefile       2005-08-26 19:52:13.000000000 +0000
+++ mupen64_src-0.5/Makefile    2005-09-08 10:54:20.000000000 +0000
@@ -405,7 +405,7 @@
        
 clean:
        find . -name '*.o' -print0 | xargs -0r rm -f
-       rm mupen64 mupen64_nogui mupen64_dbg plugins/mupen64_input.so blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.so plugins/mupen64_hle_rsp_azimer.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
+       rm -f mupen64 mupen64_nogui mupen64_dbg plugins/mupen64_input.so blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.so plugins/mupen64_hle_rsp_azimer.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
 
 clean_o:
        find . -name '*.o' -print0 | xargs -0r rm -f
diff -ruN mupen64_src-0.5-orig/main/main.c mupen64_src-0.5/main/main.c
--- mupen64_src-0.5-orig/main/main.c    2005-08-26 19:52:11.000000000 +0000
+++ mupen64_src-0.5/main/main.c 2005-09-08 10:56:45.000000000 +0000
@@ -37,6 +37,8 @@
 
 #include <stdlib.h>
 #include <unistd.h>
+#include <dirent.h>
+#include <sys/stat.h>
 
 #include "main.h"
 #include "guifuncs.h"
@@ -666,7 +668,7 @@
        i4 = old_i + atoi(s) - 1;
      }
    
-   printf("nnSelected Plugins: %s, %s, %s, %sn", plugins[i1], plugins[i2], plugins[3], plugins[i4]);
+   printf("nnSelected Plugins: %s, %s, %s, %sn", plugins[i1], plugins[i2], plugins[i3], plugins[i4]);
    
    plugin_load_plugins(plugins[i1], plugins[i2], plugins[i3], plugins[i4]);
    romOpen_gfx();
diff -ruN mupen64_src-0.5-orig/mupen64_audio/main.c mupen64_src-0.5/mupen64_audio/main.c
--- mupen64_src-0.5-orig/mupen64_audio/main.c   2005-08-26 19:52:17.000000000 +0000
+++ mupen64_src-0.5/mupen64_audio/main.c        2005-09-08 10:54:54.000000000 +0000
@@ -16,6 +16,7 @@
 
 #include "../main/winlnxdefs.h"
 #include "Audio_#1.1.h"
+#include "../config.h"
 
 static AUDIO_INFO AudioInfo;
 static int dsp;
@@ -172,6 +173,11 @@
 
 static void GetPluginDir(char *Directory)
 {
+#ifdef WITH_HOME
+   strcpy(Directory, getenv("HOME"));
+   strcat(Directory, "/.mupen64/");
+   strcat(Directory, "plugins/");
+#else
    int n = readlink("/proc/self/exe", Directory, PATH_MAX);
    if (n == -1)
      strcpy(Directory, "./");
@@ -182,6 +188,7 @@
          Directory[strlen(Directory)-1] = '';
      }
    strcat(Directory, "plugins/");
+#endif
 }
 
 #ifdef USE_GTK

Offline

#25 2005-09-08 14:32:26

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: [ Request ] mupen64-0.5

Wow!  Nicely done.

Thanks.  This one works very well for me.

Offline

Board footer

Powered by FluxBB