Exemple #1
0
def test_get_build_commands_with_configure_parameters():
    class Options:
        autotools_configure_parameters = ["--with-foo=true", "--prefix=/foo"]

    plugin = AutotoolsPlugin(part_name="my-part", options=Options())

    assert plugin.get_build_commands() == [
        "[ ! -f ./configure ] && [ -f ./autogen.sh ] && env NOCONFIGURE=1 ./autogen.sh",
        "[ ! -f ./configure ] && [ -f ./bootstrap ] && env NOCONFIGURE=1 ./bootstrap",
        "[ ! -f ./configure ] && autoreconf --install",
        "./configure --with-foo=true --prefix=/foo",
        'make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}"',
        'make install DESTDIR="${SNAPCRAFT_PART_INSTALL}"',
    ]
Exemple #2
0
def test_get_build_commands():
    class Options:
        autotools_configure_parameters = list()
        autotools_configure_environment = list()

    plugin = AutotoolsPlugin(part_name="my-part", options=Options())

    assert plugin.get_build_commands() == [
        "[ ! -f ./configure ] && [ -f ./autogen.sh ] && env NOCONFIGURE=1 ./autogen.sh",
        "[ ! -f ./configure ] && [ -f ./bootstrap ] && env NOCONFIGURE=1 ./bootstrap",
        "[ ! -f ./configure ] && autoreconf --install",
        "CC=${SNAPCRAFT_ARCH_TRIPLET}-gcc ./configure --host=${SNAPCRAFT_ARCH_TRIPLET}",
        'make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}"',
        'make install DESTDIR="${SNAPCRAFT_PART_INSTALL}"',
    ]
Exemple #3
0
    def test_get_build_commands(self):
        class Options:
            autotools_configure_parameters = list()

        plugin = AutotoolsPlugin(part_name="my-part", options=Options())

        self.assertThat(
            plugin.get_build_commands(),
            Equals([
                "[ ! -f ./configure ] && autoreconf --install",
                "./configure",
                'make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}"',
                'make install DESTDIR="${SNAPCRAFT_PART_INSTALL}"',
            ]),
        )
Exemple #4
0
    def test_get_build_commands_with_configflags(self):
        class Options:
            configflags = ["--with-foo=true", "--prefix=/foo"]

        plugin = AutotoolsPlugin(part_name="my-part", options=Options())

        self.assertThat(
            plugin.get_build_commands(),
            Equals([
                "[ ! -f ./configure ] && autoreconf --install",
                "./configure --with-foo=true --prefix=/foo",
                'make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}"',
                'make install DESTDIR="${SNAPCRAFT_PART_INSTALL}"',
            ]),
        )
Exemple #5
0
    def test_get_build_commands(self):
        class Options:
            configflags = list()

        plugin = AutotoolsPlugin(part_name="my-part", options=Options())

        self.assertThat(
            plugin.get_build_commands(),
            Equals([
                "[ ! -f ./configure ] && autoreconf --install",
                './configure --prefix="${SNAPCRAFT_AUTOTOOLS_INSTALL_PREFIX}"',
                'make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}"',
                'make install DESTDIR="${SNAPCRAFT_PART_INSTALL}"',
            ]),
        )