Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
compiling sdlmame-0.194 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
nightcast2000
n00b
n00b


Joined: 01 Apr 2014
Posts: 54
Location: Birmingham

PostPosted: Sat Feb 17, 2018 9:55 pm    Post subject: compiling sdlmame-0.194 ebuild Reply with quote

Hi all,
I'm trying to build sdlmame-0.194 using an ebuild file. I keep getting problems with a patch that it is looking for(which I have downloaded) and put a copy of the file in the ebuild directory.
Here is the output so far:

Code:
 /usr/local/portage/games-emulation/sdlmame # ebuild sdlmame-0.194.ebuild clean prepare
!!! Repository 'x-portage' is missing masters attribute in '/usr/local/portage/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
 * mame-0.194.zip BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                       [ ok ]
 * checking ebuild checksums ;-) ...                                                                                                                                                                                                [ ok ]
>>> Unpacking source...
>>> Unpacking mame-0.194.zip to /var/tmp/portage/games-emulation/sdlmame-0.194/work
3rdparty/pugixml/tests/data/#U0442#U0435#U0441#U0442.xml:  mismatching "local" filename (3rdparty/pugixml/tests/data/ÐéðÁÐüÐé.xml),
         continuing with "central" filename version
>>> Source unpacked in /var/tmp/portage/games-emulation/sdlmame-0.194/work
>>> Preparing source in /var/tmp/portage/games-emulation/sdlmame-0.194/work ...

 * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:
 *
 *   /var/tmp/portage/games-emulation/sdlmame-0.194/files/sdlmame-0.184-qt.patch
 *   ( sdlmame-0.184-qt.patch )

 * ERROR: games-emulation/sdlmame-0.194::x-portage failed (prepare phase):
 *   Cannot find $EPATCH_SOURCE!
 *
 * Call stack:
 *     ebuild.sh, line  124:  Called src_prepare
 *   environment, line 3778:  Called epatch '/var/tmp/portage/games-emulation/sdlmame-0.194/files/sdlmame-0.184-qt.patch'
 *   environment, line 1228:  Called die
 * The specific snippet of code:
 *                   die "Cannot find \$EPATCH_SOURCE!";
 *
 * If you need support, post the output of `emerge --info '=games-emulation/sdlmame-0.194::x-portage'`,
 * the complete build log and the output of `emerge -pqv '=games-emulation/sdlmame-0.194::x-portage'`.
 * The complete build log is located at '/var/tmp/portage/games-emulation/sdlmame-0.194/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/games-emulation/sdlmame-0.194/temp/environment'.
 * Working directory: '/var/tmp/portage/games-emulation/sdlmame-0.194/work'
 * S: '/var/tmp/portage/games-emulation/sdlmame-0.194/work'


I am scratching my head with this one, any help appreciated.
Regards,
nightcast2000
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8933

PostPosted: Sat Feb 17, 2018 10:00 pm    Post subject: Reply with quote

This is the path expected by the ebuild:
Code:
/usr/local/portage/games-emulation/sldmame/files/sdlmame-0.184-qt.patch

^ fixed now.


Last edited by asturm on Mon Feb 19, 2018 1:30 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21490

PostPosted: Sat Feb 17, 2018 11:16 pm    Post subject: Reply with quote

Please show your ebuild.
Back to top
View user's profile Send private message
nightcast2000
n00b
n00b


Joined: 01 Apr 2014
Posts: 54
Location: Birmingham

PostPosted: Sun Feb 18, 2018 5:53 am    Post subject: Reply with quote

Hi guys,
I will try and put the patch in the directory it is looking for when I get back from work. However, when I had looked into that directory, there was no files folder, only a symlink called files. So would it be safe to make a files folder in that location and put the patch in there?

Here is the ebuild file:
Code:
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5
PYTHON_COMPAT=( python2_7 )
inherit eutils python-any-r1 toolchain-funcs qmake-utils games

MY_PV="${PV/.}"

DESCRIPTION="Multiple Arcade Machine Emulator + Multi Emulator Super System (MESS)"
HOMEPAGE="http://mamedev.org/"
SRC_URI="https://github.com/mamedev/mame/releases/download/mame${MY_PV}/mame${MY_PV}s.zip -> mame-${PV}.zip"

LICENSE="GPL-2+ BSD-2 MIT CC0-1.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="alsa +arcade debug +mess opengl openmp tools"
REQUIRED_USE="|| ( arcade mess )"

# MESS (games-emulation/sdlmess) has been merged into MAME upstream since mame-0.162 (see below)
#  MAME/MESS build combined (default)   +arcade +mess   (mame)
#  MAME build only         +arcade -mess   (mamearcade)
#  MESS build only         -arcade +mess   (mess)
# games-emulation/sdlmametools is dropped and enabled instead by the 'tools' useflag
RDEPEND="!games-emulation/sdlmametools
   !games-emulation/sdlmess
   dev-db/sqlite:3
   dev-libs/expat
   media-libs/fontconfig
   media-libs/flac
   media-libs/libsdl2[joystick,opengl?,sound,video,X]
   media-libs/portaudio
   media-libs/sdl2-ttf
   sys-libs/zlib
   virtual/jpeg:0
   virtual/opengl
   alsa? ( media-libs/alsa-lib
      media-libs/portmidi )
   debug? ( dev-qt/qtcore:5
      dev-qt/qtgui:5
      dev-qt/qtwidgets:5 )
   x11-libs/libX11
   x11-libs/libXinerama
   ${PYTHON_DEPS}"
DEPEND="${RDEPEND}
   ${PYTHON_DEPS}
   app-arch/unzip
   virtual/pkgconfig
   x11-proto/xineramaproto"

S=${WORKDIR}

# Function to disable a makefile option
disable_feature() {
   sed -i -e "/^[    ]*$1.*=/s:^:# :" makefile || die
}

# Function to enable a makefile option
enable_feature() {
   sed -i -e "/^#.*$1.*=/s:^#[    ]*::"  makefile || die
}

pkg_setup() {
   games_pkg_setup
   python-any-r1_pkg_setup
}

src_unpack() {
   default
   unzip -qo -U ./mame.zip
   rm -f mame.zip || die
}

src_prepare() {
   epatch ${FILESDIR}"/${PN}-0.184-qt.patch"
   # Disable using bundled libraries
   enable_feature USE_SYSTEM_LIB_EXPAT
   enable_feature USE_SYSTEM_LIB_FLAC
   enable_feature USE_SYSTEM_LIB_JPEG
# Use bundled lua for now to ensure correct compilation (ref. b.g.o #407091)
#   enable_feature USE_SYSTEM_LIB_LUA
   enable_feature USE_SYSTEM_LIB_PORTAUDIO
   enable_feature USE_SYSTEM_LIB_SQLITE3
   enable_feature USE_SYSTEM_LIB_ZLIB

   # Disable warnings being treated as errors and enable verbose build output
   enable_feature NOWERROR
   enable_feature VERBOSE

   use amd64 && enable_feature PTR64
   use debug && enable_feature DEBUG
   use tools && enable_feature TOOLS
   disable_feature NO_X11 # bgfx needs X
   use openmp && enable_feature OPENMP

   if use alsa ; then
      enable_feature USE_SYSTEM_LIB_PORTMIDI
   else
      enable_feature NO_USE_MIDI
   fi

   sed -i \
      -e 's/-Os//' \
      -e '/^\(CC\|CXX\|AR\) /s/=/?=/' \
      3rdparty/genie/build/gmake.linux/genie.make || die
}

src_compile() {
   local targetargs
   local qtdebug=$(usex debug 1 0)

   use arcade && ! use mess && targetargs="SUBTARGET=arcade"
   ! use arcade && use mess && targetargs="SUBTARGET=mess"

   function my_emake() {
      # Workaround conflicting $ARCH variable used by both Gentoo's
      # portage and by Mame's build scripts
      PYTHON_EXECUTABLE=${PYTHON} \
      OVERRIDE_CC=$(tc-getCC) \
      OVERRIDE_CXX=$(tc-getCXX) \
      OVERRIDE_LD=$(tc-getCXX) \
      QT_SELECT=qt5 \
      QT_HOME="$(qt5_get_libdir)/qt5" \
      ARCH= \
         emake "$@" \
            AR=$(tc-getAR)
   }
   my_emake -j1 generate

   my_emake ${targetargs} \
      SDL_INI_PATH="\$\$\$\$HOME/.sdlmame;${GAMES_SYSCONFDIR}/${PN}" \
      USE_QTDEBUG=${qtdebug}

   #if use tools ; then
   #   my_emake -j1 TARGET=ldplayer USE_QTDEBUG=${qtdebug}
   #fi
}

src_install() {
   local MAMEBIN
   local suffix="$(use amd64 && echo 64)$(use debug && echo d)"
   local f

   function mess_install() {
      dosym ${MAMEBIN} "${GAMES_BINDIR}"/mess${suffix}
      dosym ${MAMEBIN} "${GAMES_BINDIR}"/sdlmess
      newman docs/man/mess.6 sdlmess.6
      doman docs/man/mess.6
   }
   if use arcade ; then
      if use mess ; then
         MAMEBIN="mame${suffix}"
         mess_install
      else
         MAMEBIN="mamearcade${suffix}"
      fi
      doman docs/man/mame.6
      newman docs/man/mame.6 ${PN}.6
   elif use mess ; then
      MAMEBIN="mess${suffix}"
      mess_install
   fi
   dogamesbin ${MAMEBIN}
   dosym ${MAMEBIN} "${GAMES_BINDIR}/${PN}"

   insinto "${GAMES_DATADIR}/${PN}"
   doins -r keymaps $(use mess && echo hash)

   # Create default mame.ini and inject Gentoo settings into it
   #  Note that '~' does not work and '$HOME' must be used
   ./${MAMEBIN} -noreadconfig -showconfig > "${T}/mame.ini" || die
   # -- Paths --
   for f in {rom,hash,sample,art,font,crosshair} ; do
      sed -i \
         -e "s:\(${f}path\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2;${GAMES_DATADIR}/${PN}/\2:" \
         "${T}/mame.ini" || die
   done
   for f in {ctrlr,cheat} ; do
      sed -i \
         -e "s:\(${f}path\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2;${GAMES_SYSCONFDIR}/${PN}/\2;${GAMES_DATADIR}/${PN}/\2:" \
         "${T}/mame.ini" || die
   done
   # -- Directories
   for f in {cfg,nvram,memcard,input,state,snapshot,diff,comment} ; do
      sed -i \
         -e "s:\(${f}_directory\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2:" \
         "${T}/mame.ini" || die
   done
   # -- Keymaps --
   sed -i \
      -e "s:\(keymap_file\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2:" \
      "${T}/mame.ini" || die
   for f in keymaps/km*.map ; do
      sed -i \
         -e "/^keymap_file/a \#keymap_file \t\t${GAMES_DATADIR}/${PN}/keymaps/${f##*/}" \
         "${T}/mame.ini" || die
   done
   insinto "${GAMES_SYSCONFDIR}/${PN}"
   doins "${T}/mame.ini"

   insinto "${GAMES_SYSCONFDIR}/${PN}"
   doins "${FILESDIR}/vector.ini"

   #dodoc docs/{config,mame,newvideo}.txt
   keepdir \
      "${GAMES_DATADIR}/${PN}"/{ctrlr,cheat,roms,samples,artwork,crosshair} \
      "${GAMES_SYSCONFDIR}/${PN}"/{ctrlr,cheat}

   if use tools ; then
      for f in castool chdman floptool imgtool jedutil ldresample ldverify romcmp ; do
         newgamesbin ${f} ${PN}-${f}
         newman docs/man/${f}.1 ${PN}-${f}.1
      done
      #newgamesbin ldplayer${suffix} ${PN}-ldplayer
      #newman docs/man/ldplayer.1 ${PN}-ldplayer.1
   fi

   prepgamesdirs
}

pkg_postinst() {
   games_pkg_postinst

   elog "It is strongly recommended to change either the system-wide"
   elog "  ${GAMES_SYSCONFDIR}/${PN}/mame.ini or use a per-user setup at ~/.${PN}/mame.ini"
   elog
   if use opengl ; then
      elog "You built ${PN} with opengl support and should set"
      elog "\"video\" to \"opengl\" in mame.ini to take advantage of that"
      elog
      elog "For more info see http://wiki.mamedev.org"
   fi
}


Regards,
Nightcast2000
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Sun Feb 18, 2018 9:30 am    Post subject: Reply with quote

The patches are contained in the files folder where the ebuild is located.
Example:
Code:
/usr/portage/app-editors/fte/
├── Manifest
├── files
│   ├── fte
│   ├── fte-cpp14.patch
│   ├── fte-gcc34
│   ├── fte-interix.patch
│   ├── fte-new_keyword.patch
│   └── fte-slang.patch
├── fte-20051115-r3.ebuild
├── fte-20110708-r1.ebuild
└── metadata.xml

1 directory, 10 files

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
nightcast2000
n00b
n00b


Joined: 01 Apr 2014
Posts: 54
Location: Birmingham

PostPosted: Sun Feb 18, 2018 9:57 pm    Post subject: Reply with quote

Hi fedeliallalinea,
I have checked that the patch is in /usr/local/portage/games-emulation/sldmame, as well as the ebuild file. I have also put the patch and ebuild file in /var/tmp/portage/game-emulation/sdlmame-0.194 directory just in case it was looking for it in there, but alas, I still get the build error.

Regards,
Nightcast2000
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8933

PostPosted: Mon Feb 19, 2018 12:01 am    Post subject: Reply with quote

Both paths are wrong. Please look at my first answer to your thread. It is the only information you need to succeed with this.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21490

PostPosted: Mon Feb 19, 2018 1:27 am    Post subject: Reply with quote

asturm wrote:
Both paths are wrong. Please look at my first answer to your thread. It is the only information you need to succeed with this.
While I agree that he is doing it wrong, I disagree with your first post. The path shown in his opening post, which you quoted, is an ephemeral path constructed by Portage. He needs to put the patch in the files/ subdirectory in the repository, as fedeliallalinea instructed him to do (and he did not do).
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8933

PostPosted: Mon Feb 19, 2018 1:31 am    Post subject: Reply with quote

You are absolutely right. I should actually look at what I'm pasting... (fixed now)
Back to top
View user's profile Send private message
nightcast2000
n00b
n00b


Joined: 01 Apr 2014
Posts: 54
Location: Birmingham

PostPosted: Tue Feb 20, 2018 6:09 am    Post subject: Reply with quote

Hi,
I had deleted the symlink called "files" and then created a "files" folder in /usr/local/portage/games-emulation/sdlmame. When I had put the patch in that flolder, it compiles but failed to build :? I want to thank everyone that helped me out.
I had altered the ebuild file to compile with python 3.5 so I will see if that will improve things.

Regards,
Nightcast2000
Back to top
View user's profile Send private message
nightcast2000
n00b
n00b


Joined: 01 Apr 2014
Posts: 54
Location: Birmingham

PostPosted: Thu Feb 22, 2018 12:48 pm    Post subject: [SOLVED] compiling sdlmame-0.194 ebuild Reply with quote

Hi all,
I have some great news, I have managed to compile and install sdlmame-0.194 :D The problem was that I was missing the vector.ini file :oops: So I downloaded it and then put it in the files directory.

It compiles happily with python 3.5, so next stop, qmc2 :D

Once again, thank you for the help that was provided.

Regards,
Nightcast2000
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