示例#1
0
 def build_ffmpeg(self, version, enable=[], disable=[]):
     """build ffmpeg libraries"""
     saved = os.getcwd()
     os.chdir(os.path.join(self.build_dir_, "ffmpeg-%s" % version))
     command(
         "sed -i -e 's|SDL_CONFIG=\"${cross_prefix}sdl-config\"|"
         "SDL_CONFIG=\"%s/bin/sdl-config\"|' ./configure" % self.install_dir_)
     shutil.copy2("configure", "configure.orig")
     os.environ['PKG_CONFIG_PATH'] = "%s/lib/pkgconfig" % self.install_dir_
     cmd = ("./configure --prefix=%s --extra-cflags=\"-I%s/include\" "
            "--extra-ldflags=\"-L%s/lib\" --enable-libfaac --enable-libmp3lame "
            "--enable-libx264 --enable-libzvbi --enable-libass --enable-gpl "
            "--enable-pthreads --enable-nonfree" % (
                self.install_dir_, self.install_dir_, self.install_dir_))
     if enable:
         for opt in enable:
             cmd += ' --enable-' + opt
     if disable:
         for opt in disable:
             cmd += ' --disable-' + opt
     logger.info(cmd)
     command(cmd)
     shutil.move("configure.orig", "configure")
     command(["make", "-j%d" % self.cpu_count_])
     command(["make", "install"])
     os.chdir(saved)
示例#2
0
 def build_ass(self):
     """build ass library"""
     saved = os.getcwd()
     os.chdir(os.path.join(self.build_dir_, "libass"))
     command(["./autogen.sh"])
     command("./configure --prefix=%s --enable-shared=no --enable-static" % self.install_dir_)
     command(["make", "-j%d" % self.cpu_count_])
     command(["make", "install"])
     os.chdir(saved)
    def multitest(self):
        config.command(string)

        SMT_serial_number = self.smtserialnum.text()
        Internal_serial_number = self.internalserialnum.text()
        EInkLotNumber = self.einklotnum.text()
        serial_number = self.serialnum.text()
        config.setAttr(SMT_serial_number, Internal_serial_number,
                       EInkLotNumber, serial_number)

        num_of_test = int(self.numoftest.text())
        if self.manual.isChecked():
            for i in range(1, num_of_test + 1):
                config.run()
        if self.fulltest.isChecked():
            for i in range(1, num_of_test + 1):
                config.fullrun()
示例#4
0
 def build_sdl(self):
     """build sdl libraries"""
     saved = os.getcwd()
     os.chdir(os.path.join(self.build_dir_, "SDL-1.2.15"))
     command("./configure --prefix=%s --disable-shared" % self.install_dir_)
     command(["make", "-j%d" % self.cpu_count_])
     command(["make", "install"])
     os.chdir(saved)
示例#5
0
 def build_faac(self):
     """build faac library"""
     saved = os.getcwd()
     os.chdir(os.path.join(self.build_dir_, "faac-1.28"))
     command("./configure --prefix=%s --disable-shared --enable-static" % self.install_dir_)
     command(["make", "-j%d" % self.cpu_count_])
     command(["make", "install"])
     os.chdir(saved)
示例#6
0
def message_handler(client, userdata, msg):

    if msg.topic == STATE_TOPIC:
        payload = msg.payload.decode("utf-8")
        state = json.loads(payload)
        position = state['position']
        x = int(position['x'])
        y = int(position['y'])

        print("x: {} y: {}".format(x, y))

        current = maze.get_field(x, y)
        if current is None:
            current = maze.add_field(x, y)

        next = current.next_visit()
        if next is not Cmd.nop:
            command(client, next)
        else:
            # backtracking here
            print("Preliminary end")

    else:
        print("Unknown topic {}".format(msg.topic))
示例#7
0
 def build_x264(self):
     """build x264 library"""
     saved = os.getcwd()
     os.chdir(os.path.join(self.build_dir_, "x264"))
     command(
         "./configure --prefix=%s --extra-cflags=\"-I%s/include\" --extra-ldflags=\"-L%s/lib\""
         " --enable-static --disable-lavf --disable-ffms --disable-opencl" % (
             self.install_dir_, self.install_dir_, self.install_dir_))
     command(["make", "-j%d" % self.cpu_count_])
     command(["make", "install"])
     os.chdir(saved)
示例#8
0
 def patch_faac(self):
     command("cp -v ../patches/faac-1.28-glibc_fixes-1.patch faac-1.28/")
     os.chdir("faac-1.28")
     command("patch -Np1 -i faac-1.28-glibc_fixes-1.patch")
     command("sed -i -e '/obj-type/d' -e '/Long Term/d' frontend/main.c")
     os.chdir("..")
示例#9
0
 def patch_ffmpeg(self, version):
     # apply patches only to ffmpeg 2.6.4
     if version == '2.6.4':
         # command("cp -v ../patches/0000-patch6.patch ffmpeg-%s/" % version)
         command("cp -v ../patches/ffmpeg-2.6.4-scte_35-001.patch ffmpeg-%s/" % version)
         command("cp -v ../patches/ffmpeg-2.6.4-scte_35-002.patch ffmpeg-%s/" % version)
         command("cp -v ../patches/ffmpeg-2.6.4-scte_35-003.patch ffmpeg-%s/" % version)
         os.chdir("ffmpeg-%s" % version)
         # command("patch -Np1 -i 0000-patch6.patch")
         command("patch -Np0 -i ffmpeg-2.6.4-scte_35-001.patch")
         command("patch -Np0 -i ffmpeg-2.6.4-scte_35-002.patch")
         command("patch -Np0 -i ffmpeg-2.6.4-scte_35-003.patch")
         os.chdir("..")
示例#10
0
 def patch_sdl(self):
     command("cp -v ../patches/libsdl-1.2.15-const-xdata32.patch SDL-1.2.15/")
     os.chdir("SDL-1.2.15")
     command("patch -Np1 -i libsdl-1.2.15-const-xdata32.patch")
     command("./autogen.sh")
     os.chdir("..")