예제 #1
0
 def __dodmg(packpath, localname, dest):
   # http://hints.macworld.com/article.php?story=2005050606123892
   ret = puke.sh('hdid %s' % packpath, output = False)
   ret = ret.split("\n")
   ret.pop()
   ret = ret.pop()
   ret = ret.split("\t")
   vol = ret.pop()
   ret.pop()
   disk = ret.pop()
   puke.FileSystem.makedir(dest)
   list = puke.FileList(puke.FileSystem.join(vol, localname), filter = "*")
   puke.deepcopy(list, dest)
   puke.sh('hdid hdiutil detach %s -force' % disk, output = False)
예제 #2
0
  def fetch(self, tmp, clean = False):
    url = self.url
    # Garde-fou
    if not url:
      console.fail('Can\'t fetch unspecified url, can I?')

    # Complete local path
    type = url.split('.').pop().lower()
    # Unpack it
    # Git repositories
    if type == 'git':
      pwd = puke.FileSystem.join(tmp, self.local.split(puke.os.sep).pop(0))
      console.info('Git repository')

      if self.hack:
        self.__dogit(url, pwd, self.hack)
      else:
        self.__dogit(url, pwd)
    else:
      pwd = puke.FileSystem.join(tmp, self.local)
      # Remove the directory if clean requested
      if clean and self.local and puke.FileSystem.exists(pwd):
        console.info('Cleaning unpack directory')
        puke.FileSystem.remove(pwd)
      # If the directory is here already, just return 
      if puke.FileSystem.exists(pwd):
        return False
      # Copy locally
      puke.deepcopy(url, tmp);
      # Verify checksum
      localtmp = puke.FileSystem.join(tmp, url.split('/').pop())
      if puke.FileSystem.checksum(localtmp) != self.__checksum:
        console.fail("PANIC! Archive doesn't pan out. You may puke -c if in doubt, and anyhow double check integrity. %s vs. %s" % (puke.FileSystem.checksum(localtmp), self.__checksum))

      if type == 'dmg':
        console.info('Processing dmg')
        self.__dodmg(localtmp, self.local, pwd)
      elif type == 'pkg':
        console.info('Processing pkg')
        self.__dopkg(localtmp)
      else:
        console.info('Processing archive file')
        self.__dounpack(localtmp, puke.FileSystem.dirname(pwd))
    return True
예제 #3
0
def make():
  base = puke.FileSystem.join(monade.environ.src, monade.technicolor.local, 'VLC.app', 'Contents', 'MacOS')
  dylibs = puke.FileList(puke.FileSystem.join(base, 'lib'))
  plugins = puke.FileList(puke.FileSystem.join(base, 'plugins'), exclude = "*growl*,*libqt*,*libmacosx_plugin*")
  includes = puke.FileList(puke.FileSystem.join(base, 'include'))

  libpath = puke.FileSystem.join(monade.environ.prefix, 'lib')
  puke.deepcopy(dylibs, libpath)
  puke.sh('cd %s; rm libvlc.dylib; rm libvlccore.dylib; ln -s libvlccore.5.dylib libvlccore.dylib; ln -s libvlc.5.dylib libvlc.dylib;' % libpath);
  puke.sh('cd %s; install_name_tool -id %s/libvlc.5.dylib libvlc.5.dylib;' % (libpath, libpath));
  puke.sh('cd %s; install_name_tool -id %s/libvlccore.5.dylib libvlccore.5.dylib;' % (libpath, libpath));

  puke.deepcopy(includes, puke.FileSystem.join(monade.environ.prefix, 'include'))
  puke.deepcopy(plugins, puke.FileSystem.join(monade.environ.prefix, 'lib', 'vlc', 'plugins'))