Exemplo n.º 1
0
    def compile(self) -> None:
        """Compile the project."""
        x264_version_source = local.path(self.source_of_primary)
        x264_version = ShortCommitHash(self.version_of_primary)

        fpic_revisions = get_all_revisions_between(
            "5dc0aae2f900064d1f58579929a2285ab289a436",
            "290de9638e5364c37316010ac648a6c959f6dd26", ShortCommitHash,
            x264_version_source)
        ldflags_revisions = get_all_revisions_between(
            "6490f4398d9e28e65d7517849e729e14eede8c5b",
            "275ef5332dffec445a0c5a78dbc00c3e0766011d", ShortCommitHash,
            x264_version_source)

        if x264_version in fpic_revisions:
            self.cflags += ["-fPIC"]

        clang = bb.compiler.cc(self)
        with local.cwd(x264_version_source):
            with local.env(CC=str(clang)):
                configure_flags = ["--disable-asm"]
                if x264_version in ldflags_revisions:
                    configure_flags.append("--extra-ldflags=\"-static\"")
                bb.watch(local["./configure"])(configure_flags)
            bb.watch(make)("-j", get_number_of_jobs(bb_cfg()))

            verify_binaries(self)
Exemplo n.º 2
0
    def compile(self) -> None:
        """Compile the project."""
        brotli_version_source = local.path(self.source_of_primary)
        brotli_git_path = get_local_project_git_path(self.NAME)
        brotli_version = ShortCommitHash(self.version_of_primary)
        with local.cwd(brotli_git_path):
            configure_revisions = get_all_revisions_between(
                "f9ab24a7aaee93d5932ba212e5e3d32e4306f748",
                "5814438791fb2d4394b46e5682a96b68cd092803", ShortCommitHash)
            simple_make_revisions = get_all_revisions_between(
                "e1739826c04a9944672b99b98249dda021bdeb36",
                "378485b097fd7b80a5e404a3cb912f7b18f78cdb", ShortCommitHash)
        c_compiler = bb.compiler.cc(self)

        if brotli_version in simple_make_revisions:
            with local.cwd(brotli_version_source / "tools"):
                bb.watch(make)("-j", get_number_of_jobs(bb_cfg()))
        elif brotli_version in configure_revisions:
            with local.cwd(brotli_version_source):
                with local.env(CC=str(c_compiler)):
                    bb.watch(local["./configure"])()
                bb.watch(make)("-j", get_number_of_jobs(bb_cfg()))
        else:
            mkdir(brotli_version_source / "out")
            with local.cwd(brotli_version_source / "out"):
                with local.env(CC=str(c_compiler)):
                    bb.watch(local["../configure-cmake"])()
                bb.watch(make)("-j", get_number_of_jobs(bb_cfg()))

        with local.cwd(brotli_version_source):
            verify_binaries(self)
Exemplo n.º 3
0
    def __compile_make(self) -> None:
        libssh_source = local.path(self.source_of(self.primary_source))
        libssh_version = ShortCommitHash(self.version_of_primary)
        autoconf_revisions = get_all_revisions_between(
            "5e02c25291d594e01a910fce097a3fc5084fd68f",
            "21e639cc3fd54eb3d59568744c9627beb26e07ed", ShortCommitHash,
            libssh_source
        )
        autogen_revisions = get_all_revisions_between(
            "ca32b0aa146b31d7772f27d16098845e615432aa",
            "ee54acb417c5589a8dc9dab0676f34b3d40a182b", ShortCommitHash,
            libssh_source
        )
        compiler = bb.compiler.cc(self)
        with local.cwd(libssh_source):
            with local.env(CC=str(compiler)):
                if libssh_version in autogen_revisions:
                    bb.watch("./autogen.sh")()
                if libssh_version in autoconf_revisions:
                    bb.watch("autoreconf")()
                configure = bb.watch(local["./configure"])
                configure()
            bb.watch(make)("-j", get_number_of_jobs(bb_cfg()))

            verify_binaries(self)
Exemplo n.º 4
0
    def compile(self) -> None:
        """Compile the project."""
        xz_git_path = get_local_project_git_path(self.NAME)
        xz_version_source = local.path(self.source_of_primary)
        xz_version = self.version_of_primary

        # dynamic linking is off by default until
        # commit f9907503f882a745dce9d84c2968f6c175ba966a
        # (fda4724 is its parent)
        with local.cwd(xz_git_path):
            revisions_wo_dynamic_linking = get_all_revisions_between(
                "5d018dc03549c1ee4958364712fb0c94e1bf2741",
                "fda4724d8114fccfa31c1839c15479f350c2fb4c", ShortCommitHash)

        self.cflags += ["-fPIC"]

        clang = bb.compiler.cc(self)
        with local.cwd(xz_version_source):
            with local.env(CC=str(clang)):
                bb.watch(autoreconf)("--install")
                configure = bb.watch(local["./configure"])

                if xz_version in revisions_wo_dynamic_linking:
                    configure("--enable-dynamic=yes")
                else:
                    configure()

            bb.watch(make)("-j", get_number_of_jobs(bb_cfg()))

            verify_binaries(self)
Exemplo n.º 5
0
    def revisions_of_project(self) -> None:
        """Generate the Revision list for the selected project if select
        specific is enabled."""
        self.strategie_forms.setCurrentIndex(
            GenerationStrategie.SELECT_REVISION.value)
        if self.selected_project != self.revision_list_project:
            self.revision_details.setText("Loading Revisions")
            self.revision_details.repaint()
            get_local_project_git(self.selected_project).remotes[0].fetch()
            git_path = get_local_project_git_path(self.selected_project)
            initial_commit = get_initial_commit(git_path).hash
            commits = get_all_revisions_between(initial_commit, 'HEAD',
                                                FullCommitHash, git_path)
            commit_lookup_helper = create_commit_lookup_helper(
                self.selected_project)
            project = get_project_cls_by_name(self.selected_project)
            repo_name = get_primary_project_source(self.selected_project).local
            commits = map(lambda commit: CommitRepoPair(commit, repo_name),
                          commits)

            cmap = get_commit_map(self.selected_project)
            commit_model = CommitTableModel(
                list(map(commit_lookup_helper, commits)), cmap, project)
            self.proxy_model.setSourceModel(commit_model)
            self.revision_list_project = self.selected_project
            self.revision_details.clear()
            self.revision_details.update()
Exemplo n.º 6
0
 def compile(self) -> None:
     """Compile the project."""
     libssh_source = local.path(self.source_of(self.primary_source))
     libssh_version = ShortCommitHash(self.version_of_primary)
     cmake_revisions = get_all_revisions_between(
         "0151b6e17041c56813c882a3de6330c82acc8d93", "master",
         ShortCommitHash, libssh_source
     )
     if libssh_version in cmake_revisions:
         self.__compile_cmake()
     else:
         self.__compile_make()
Exemplo n.º 7
0
    def test_get_all_revisions_between_short(self):
        """Check if the correct all revisions are correctly found."""
        repo_path = get_local_project_git_path("brotli")
        revs = get_all_revisions_between(
            '5692e422da6af1e991f9182345d58df87866bc5e',
            '2f9277ff2f2d0b4113b1ffd9753cc0f6973d354a', ShortCommitHash,
            repo_path)

        self.assertSetEqual(
            set(revs), {
                ShortCommitHash("5692e422da"),
                ShortCommitHash("2f9277ff2f"),
                ShortCommitHash("63be8a9940"),
                ShortCommitHash("2a51a85aa8")
            })
Exemplo n.º 8
0
    def test_get_all_revisions_between_full(self):
        """Check if the correct all revisions are correctly found."""
        repo_path = get_local_project_git_path("brotli")
        revs = get_all_revisions_between(
            '5692e422da6af1e991f9182345d58df87866bc5e',
            '2f9277ff2f2d0b4113b1ffd9753cc0f6973d354a', FullCommitHash,
            repo_path)

        self.assertSetEqual(
            set(revs), {
                FullCommitHash("5692e422da6af1e991f9182345d58df87866bc5e"),
                FullCommitHash("2f9277ff2f2d0b4113b1ffd9753cc0f6973d354a"),
                FullCommitHash("63be8a99401992075c23e99f7c84de1c653e39e2"),
                FullCommitHash("2a51a85aa86abb4c294c65fab57f3d9c69f10080")
            })
Exemplo n.º 9
0
    def compile(self) -> None:
        """Compile the project."""
        gravity_git_path = get_local_project_git_path(self.NAME)
        gravity_version = self.version_of_primary

        # commit 46133fb47d6da1f0dec27ae23db1d633bc72e9e3 introduced
        # cmake as build system
        with local.cwd(gravity_git_path):
            cmake_revisions = get_all_revisions_between(
                "dbb4d61fc2ebb9aca44e8e6bb978efac4a6def87", "master",
                ShortCommitHash
            )

        if gravity_version in cmake_revisions:
            self.__compile_cmake()
        else:
            self.__compile_make()