Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Help with monkeyaudio ebuild mac-3.99.4.2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
feliperal
Apprentice
Apprentice


Joined: 09 Mar 2003
Posts: 168

PostPosted: Wed Oct 12, 2005 12:27 am    Post subject: [solved] Help with monkeyaudio ebuild mac-3.99.4.2 Reply with quote

This is my absolute first time trying to right a whole ebuild from scratch. The two ebuilds I'm trying to write are for the monkey audio decompresser (mac) and the xmms monkey audio plugin (xmms-mac). The project page is at http://sourceforge.net/projects/mac-port/.

I'm having trouble with the naming convension for the decompresser. The file is called mac-3.99-u4-b4.ebuild. I know the versioning number is wrong, but the authors at sourceforge have used a system where 'u' stands for update and 'b' stands for build. Here is the mac-3.99-u4-b4.ebuild:
Code:
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils

MY_P="${PN}-$(get_version_component_range 1-2)-b$(get_version_component_range 3)-u$(get_version_component_range 4)"
S=${WORKDIR}/${MY_P}


DESCRIPTION="Monkey Audio decompression tool"
HOMEPAGE="http://sourceforge.net/projects/mac-port/"
SRC_URI="http://easynews.dl.sourceforge.net/sourceforge/mac-port/{MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"

KEYWORDS="~x86 ~amd64 ~ppc ~*"
IUSE=""
RDEPEND="sys-libs/ncurses"

src_compile() {
   ./configure \
      --host=${CHOST} \
      --prefix=/usr \
      --infodir=/usr/share/info \
      --mandir=/usr/share/man || die "./configure failed"
}

src_install() {
   make DESTDIR=${D} install || die "make install failed"
}



It keeps complaing about the -u4-b4 bit at the end of the name.

Here is my ebuild for the xmms-mac plugins:
Code:

# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils


DESCRIPTION="XMMS plugin to play monkeyaudio files"
HOMEPAGE="http://sourceforge.net/projects/mac-port/"
SRC_URI="http://easynews.dl.sourceforge.net/sourceforge/mac-port/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"

KEYWORDS="~x86 ~amd64 ~ppc -*"
IUSE=""
DEPEND="media-sound/mac"

src_compile() {
   ./configure \
      --host=${CHOST} \
      --prefix=/usr \
      --infodir=/usr/share/info \
      --mandir=/usr/share/man || die "./configure failed"
}

src_install() {
   make DESTDIR=${D} install || die "make install failed"
|


the latter one works fine on its own, if you exclude the media-sound/mac dependency. However, to install correctly, the xmms-mac needs the mac headers.

Any help is appreciated....

Thanks,
Felipe


Last edited by feliperal on Thu Oct 13, 2005 4:05 am; edited 2 times in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Oct 12, 2005 2:25 am    Post subject: Reply with quote

Use a portage-compatible version string, for the ebuild filename.

versionator eclass: /usr/portage/eclass/versionator.eclass
Back to top
View user's profile Send private message
feliperal
Apprentice
Apprentice


Joined: 09 Mar 2003
Posts: 168

PostPosted: Wed Oct 12, 2005 4:15 pm    Post subject: Reply with quote

I was thinking that I could assign the version number as 3.99.4.2 ....The last two numbers are for update 4 and build 2. I wonder what the author's versioning scheme would be if he released version 4.0 update 0 build 1...I guess 4.0.0.1

How would I convert my mac-3.99.4.2 to mac-3.99-b4-b2 using versionator?

Thanks,
Felipe
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Oct 12, 2005 4:53 pm    Post subject: Reply with quote

Here's a script you can use to search the text of the ".ebuild" files in portage, to find plenty of examples.
Code:
#!/usr/bin/python

import os, sys


def inStr(strWhole, strFind, lngStart = 0, fCaseSensitive = False):

   """The zeroth character is the first.  Otherwise, is same as in VBA.
   Returns -1 if strFind is not in strWhole.
   Note that lngStart parameter is 3rd parameter rather than 1st."""

   if lngStart < 0:
      lngStart = 0

   # Do a quick check to see whether case sensitivity can be turned on, which is faster.
   if not fCaseSensitive and len(strFind) == 1 and not strFind.isalpha():
      fCaseSensitive = True

   if fCaseSensitive:
      return strWhole.find(strFind, lngStart)
   else:
      return strWhole.lower().find(strFind.lower(), lngStart)


def readTextFile(strFile):

   """Returns the whole file as a string."""

   f = open(strFile, 'rt')
   strText = f.read()
   f.close()

   return strText


def fileNameListInDir(strDir, strFileEnding = ''):
   
   """Returns the list of filenames in the specified directory (excluding names of subdirectories).  strFileEnding can be e.g. '.jpg'."""
   
   lstFileNames = []
   # Files starting with a dot are only included if strDir ends with a slash.
   strDir = cleanDirString(strDir)

   for strFileName in os.listdir(strDir):
      if strFileEnding == '' or strFileName[-len(strFileEnding):] == strFileEnding:
         # Ensure that it's a file and not a directory.
         if os.path.isfile(strDir + strFileName):
            lstFileNames.append(strFileName)
   
   return lstFileNames


def dirNameListInDir(strDir):
   
   """Returns the list of directories in the specified directory (excluding names of files)."""
   
   lstDirNames = []
   # Dirs starting with a dot are only included if strDir ends with a slash.
   strDir = cleanDirString(strDir)

   for strDirName in os.listdir(strDir):
      # Ensure that it's a directory and not a file.
      if os.path.isdir(strDir + strDirName):
         lstDirNames.append(strDirName)
   
   return lstDirNames


def dirExists(strDir):
   
   """Returns whether the directory exists.  Does not work with wildcards."""
   
   if strDir == '':
      # Make sure that the answer is False for an empty string.
      return False
   else:
      return os.path.isdir(strDir)


def cleanDirString(strDir):

   """Returns a clean directory string with a trailing slash."""
   
   if rightString(strDir, 1) <> '/':
      strDir += '/'

   return strDir


def midString(strChars, lngStart, lngLen = None):

   """The zeroth character is the first."""

   strMid = ''
   if lngStart >= 0 and lngStart < len(strChars):
      if lngLen == None:
         # Return everything from lngStart onwards.
         strMid = strChars[lngStart:]
      else:
         if lngLen >= 1:
            strMid = strChars[lngStart : (lngStart + lngLen)]

   return strMid


def rightString(strChars, lngLen):

   """The zeroth character is the first.  Otherwise, is same as in VBA."""

   strRight = ''
   if lngLen >= 1:
      strRight = strChars[-lngLen:]

   return strRight


def searchPortage(lstSearch):
   
   searchPortageTree(lstSearch, '/usr/local/')
   searchPortageTree(lstSearch, '/usr/')
   

def searchPortageTree(lstSearch, strUsrDir):

   lngEbuilds = 0
   lngPackages = 0
   
   strPortageDir = strUsrDir + 'portage/'
   if dirExists(strPortageDir):
      lstLevel1 = dirNameListInDir(strPortageDir)
      for strLevel1 in lstLevel1:
         if '-' in strLevel1:
            strLevel1Dir = strPortageDir + strLevel1 + '/'
            lstLevel2 = dirNameListInDir(strLevel1Dir)
            for strLevel2 in lstLevel2:
               lngPackages += 1
               strEbuildDir = strLevel1Dir + strLevel2 + '/'
               lstEbuildFileNames = fileNameListInDir(strEbuildDir, strFileEnding = '.ebuild')
               for strEbuildFileName in lstEbuildFileNames:
                  #print strEbuildFileName
                  lngEbuilds += 1
                  strEbuildFile = strEbuildDir + strEbuildFileName
                  strEbuildContents = readTextFile(strEbuildFile)
                  fEbuildMatches = True
                  strLine = ''
                  for strSearch in lstSearch:
                     if strSearch <> '':
                        lngStartSearch = 0
                        if strSearch.lower() == 'license':
                           lngStartSearch = 100
                        lngInstr = inStr(strEbuildContents, strSearch, lngStart = lngStartSearch, fCaseSensitive = False)
                        if lngInstr >= 0:
                           if strLine == '':
                              lngInstrEOL = inStr(strEbuildContents, '\n', lngStart = lngInstr + 1, fCaseSensitive = True)
                              if lngInstrEOL < 0:
                                 lngInstrEOL = len(strEbuildContents)
                              strLine = midString(strEbuildContents, lngInstr, lngInstrEOL - lngInstr)
                        else:
                           fEbuildMatches = False
                           break
                  if fEbuildMatches:
                     print strEbuildFile + ': ' + strLine
   

def main():

   # Run at a nice low priority.
   os.nice(2)
   
   if len(sys.argv) >= 2:
      lstSearch = sys.argv[1:]
      try:
         searchPortage(lstSearch)
      except:
         print 'Stopped before completion'
   else:
      print 'Supply a search string.'
   
   return 0


if __name__ == '__main__':
    main()

Save the script as "searchportage", then run it with a list of parameters to filter on in an AND fashion, e.g.:
Code:
searchportage "versionator" "has_version"

Press Ctrl-C to stop the search.
_________________
Improve your font rendering and ALSA sound


Last edited by PaulBredbury on Wed Jan 11, 2006 8:02 am; edited 5 times in total
Back to top
View user's profile Send private message
ChrisWhite
Retired Dev
Retired Dev


Joined: 08 Jul 2004
Posts: 399
Location: Stockton, CA

PostPosted: Wed Oct 12, 2005 8:17 pm    Post subject: Reply with quote

Quote:
How would I convert my mac-3.99.4.2 to mac-3.99-b4-b2 using versionator?


UGH, how horrible...

Code:
MY_P="${PN}-$(get_version_component_range 1-2)-b$(get_version_component_range 3)-b$(get_version_component_range 4)"


should do it >:{
Back to top
View user's profile Send private message
feliperal
Apprentice
Apprentice


Joined: 09 Mar 2003
Posts: 168

PostPosted: Thu Oct 13, 2005 4:04 am    Post subject: Reply with quote

ChrisWhite wrote:
Quote:
How would I convert my mac-3.99.4.2 to mac-3.99-b4-b2 using versionator?


UGH, how horrible...

Code:
MY_P="${PN}-$(get_version_component_range 1-2)-b$(get_version_component_range 3)-b$(get_version_component_range 4)"


should do it >:{


Thanks for the help.... Now both ebuilds work. I will submit both of these ebuilds to bugzilla.gentoo.org. Both of these ebuilds need to be included in portage repository. There really is no plugins or tools for monkey audio files, and I know alot of people in this forum use monkeyaudio. Next thing in line would be a xmms-plugin for wavpack that doesn't segfault (gstreamer-plugin-wavpack is a POS)

Paul, thanks for the nifty script.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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