Esempio n. 1
0
    def run(self):
        if has_system_lib():
            log.info("Using system library")
            return

        build_temp = os.path.abspath(self.build_temp)

        try:
            os.makedirs(build_temp)
        except OSError as e:
            if e.errno != errno.EEXIST:
                raise

        subprocess.check_call(["cmake"], cwd=build_temp)
        subprocess.check_call(["make"], cwd=build_temp)
        subprocess.check_call(["make", "install"], cwd=build_temp)
        subprocess.check_call(["ldconfig"], cwd=build_temp)

        self.build_flags['include_dirs'].extend(
            build_flags('libevmjit', 'I', build_temp))
        self.build_flags['library_dirs'].extend(
            build_flags('libevmjit', 'L', build_temp))
        if not has_system_lib():
            self.build_flags['define'].append(('CFFI_ENABLE_RECOVERY', None))
        else:
            pass
Esempio n. 2
0
    def run(self):
        build_temp = os.path.abspath(self.build_temp)

        try:
            os.makedirs(build_temp)
        except OSError as e:
            if e.errno != errno.EEXIST:
                raise

        if not os.path.exists(absolute('libsecp256k1/configure')):
            # configure script hasn't been generated yet
            autogen = absolute('libsecp256k1/autogen.sh')
            os.chmod(absolute(autogen), 0o755)
            subprocess.check_call([autogen], cwd=absolute('libsecp256k1'))

        for filename in [
                'libsecp256k1/configure',
                'libsecp256k1/build-aux/compile',
                'libsecp256k1/build-aux/config.guess',
                'libsecp256k1/build-aux/config.sub',
                'libsecp256k1/build-aux/depcomp',
                'libsecp256k1/build-aux/install-sh',
                'libsecp256k1/build-aux/missing',
                'libsecp256k1/build-aux/test-driver',
        ]:
            try:
                os.chmod(absolute(filename), 0o755)
            except OSError as e:
                # some of these files might not exist depending on autoconf version
                if e.errno != errno.ENOENT:
                    # If the error isn't 'No such file or directory' something
                    # else is wrong and we want to know about it
                    raise

        cmd = [
            absolute('libsecp256k1/configure'),
            '--disable-shared',
            '--enable-static',
            '--disable-dependency-tracking',
            '--with-pic',
            '--enable-module-recovery',
            '--disable-jni',
            '--prefix',
            os.path.abspath(self.build_clib),
            '--enable-experimental',
            '--enable-module-ecdh',
            '--enable-benchmark=no',
            #  '--enable-endomorphism',
        ]

        log.debug('Running configure: {}'.format(' '.join(cmd)))
        subprocess.check_call(cmd, cwd=build_temp)

        subprocess.check_call([MAKE], cwd=build_temp)
        subprocess.check_call([MAKE, 'install'], cwd=build_temp)

        self.build_flags['include_dirs'].extend(
            build_flags('libsecp256k1', 'I', build_temp))
        self.build_flags['library_dirs'].extend(
            build_flags('libsecp256k1', 'L', build_temp))
Esempio n. 3
0
    def run(self):
        if has_system_lib():
            log.info("Using system library")
            return

        build_temp = os.path.abspath(self.build_temp)

        try:
            os.makedirs(build_temp)
        except OSError as e:
            if e.errno != errno.EEXIST:
                raise

        if not os.path.exists(absolute("libsecp256k1/configure")):
            # configure script hasn't been generated yet
            autogen = absolute("libsecp256k1/autogen.sh")
            os.chmod(absolute(autogen), 0o755)
            subprocess.check_call(
                [autogen],
                cwd=absolute("libsecp256k1"),
            )

        for filename in [
            "libsecp256k1/configure",
            "libsecp256k1/build-aux/compile",
            "libsecp256k1/build-aux/config.guess",
            "libsecp256k1/build-aux/config.sub",
            "libsecp256k1/build-aux/depcomp",
            "libsecp256k1/build-aux/install-sh",
            "libsecp256k1/build-aux/missing",
            "libsecp256k1/build-aux/test-driver",
        ]:
            try:
                os.chmod(absolute(filename), 0o755)
            except OSError as e:
                # some of these files might not exist depending on autoconf version
                if e.errno != errno.ENOENT:
                    # If the error isn't "No such file or directory" something
                    # else is wrong and we want to know about it
                    raise

        cmd = [
            absolute("libsecp256k1/configure"),
            "--disable-shared",
            "--enable-static",
            "--disable-dependency-tracking",
            "--with-pic",
            "--enable-module-recovery",
            "--prefix",
            os.path.abspath(self.build_clib),
        ]
        if os.environ.get('SECP_BUNDLED_WITH_BIGNUM'):
            log.info("Building with bignum support (requires libgmp)")
            cmd.extend(["--with-bignum=gmp"])
        else:
            cmd.extend(["--without-bignum"])

        if os.environ.get('SECP_BUNDLED_EXPERIMENTAL'):
            log.info("Building experimental")
            cmd.extend([
                "--enable-experimental",
                "--enable-module-ecdh",
                "--enable-module-schnorr",
            ])

        log.debug("Running configure: {}".format(" ".join(cmd)))
        subprocess.check_call(
            cmd,
            cwd=build_temp,
        )

        subprocess.check_call(["make"], cwd=build_temp)
        subprocess.check_call(["make", "install"], cwd=build_temp)

        self.build_flags['include_dirs'].extend(build_flags('libsecp256k1', 'I', build_temp))
        self.build_flags['library_dirs'].extend(build_flags('libsecp256k1', 'L', build_temp))
        if not has_system_lib():
            self.build_flags['define'].append(('CFFI_ENABLE_RECOVERY', None))
        else:
            pass
Esempio n. 4
0
 def get_library_names(self):
     return build_flags('libsecp256k1', 'l', os.path.abspath(self.build_temp))
Esempio n. 5
0
    def run(self):
        if has_system_lib():
            log.info('Using system library')
            return

        build_temp = os.path.abspath(self.build_temp)

        try:
            os.makedirs(build_temp)
        except OSError as e:
            if e.errno != errno.EEXIST:
                raise

        if not os.path.exists(absolute('libsecp256k1')):
            # library needs to be downloaded
            self.get_source_files()

        if not os.path.exists(absolute('libsecp256k1/configure')):
            # configure script hasn't been generated yet
            autogen = absolute('libsecp256k1/autogen.sh')
            os.chmod(absolute(autogen), 0o755)
            subprocess.check_call([autogen], cwd=absolute('libsecp256k1'))

        for filename in [
                'libsecp256k1/configure',
                'libsecp256k1/build-aux/compile',
                'libsecp256k1/build-aux/config.guess',
                'libsecp256k1/build-aux/config.sub',
                'libsecp256k1/build-aux/depcomp',
                'libsecp256k1/build-aux/install-sh',
                'libsecp256k1/build-aux/missing',
                'libsecp256k1/build-aux/test-driver',
        ]:
            try:
                os.chmod(absolute(filename), 0o755)
            except OSError as e:
                # some of these files might not exist depending on autoconf version
                if e.errno != errno.ENOENT:
                    # If the error isn't 'No such file or directory' something
                    # else is wrong and we want to know about it
                    raise

        cmd = [
            absolute('libsecp256k1/configure'),
            '--disable-shared',
            '--enable-static',
            '--disable-dependency-tracking',
            '--with-pic',
            '--enable-module-recovery',
            '--prefix',
            os.path.abspath(self.build_clib),
            '--enable-experimental',
            '--enable-module-ecdh',
            '--enable-benchmark=no',
            '--enable-tests=no',
            '--enable-openssl-tests=no',
            '--enable-exhaustive-tests=no',
        ]
        if 'COINCURVE_CROSS_HOST' in os.environ:
            cmd.append('--host={}'.format(os.environ['COINCURVE_CROSS_HOST']))

        log.debug('Running configure: {}'.format(' '.join(cmd)))
        subprocess.check_call(cmd, cwd=build_temp)

        subprocess.check_call([MAKE], cwd=build_temp)
        subprocess.check_call([MAKE, 'install'], cwd=build_temp)

        self.build_flags['include_dirs'].extend(
            build_flags('libsecp256k1', 'I', build_temp))
        self.build_flags['library_dirs'].extend(
            build_flags('libsecp256k1', 'L', build_temp))
        if not has_system_lib():
            self.build_flags['define'].append(('CFFI_ENABLE_RECOVERY', None))
        else:
            pass
Esempio n. 6
0
    def run(self):
        if has_system_lib():
            log.info("Using system library")
            return

        build_temp = os.path.abspath(self.build_temp)

        try:
            os.makedirs(build_temp)
        except OSError as e:
            if e.errno != errno.EEXIST:
                raise

        if not os.path.exists(absolute("libsecp256k1/configure")):
            # configure script hasn't been generated yet
            autogen = absolute("libsecp256k1/autogen.sh")
            os.chmod(absolute(autogen), 0o755)
            subprocess.check_call(
                [autogen],
                cwd=absolute("libsecp256k1"),
            )

        for filename in [
            "libsecp256k1/configure",
            "libsecp256k1/build-aux/compile",
            "libsecp256k1/build-aux/config.guess",
            "libsecp256k1/build-aux/config.sub",
            "libsecp256k1/build-aux/depcomp",
            "libsecp256k1/build-aux/install-sh",
            "libsecp256k1/build-aux/missing",
            "libsecp256k1/build-aux/test-driver",
        ]:
            try:
                os.chmod(absolute(filename), 0o755)
            except OSError as e:
                # some of these files might not exist depending on autoconf version
                if e.errno != errno.ENOENT:
                    # If the error isn't "No such file or directory" something
                    # else is wrong and we want to know about it
                    raise

        cmd = [
            absolute("libsecp256k1/configure"),
            "--disable-shared",
            "--enable-static",
            "--disable-dependency-tracking",
            "--with-pic",
            "--enable-module-recovery",
            "--prefix",
            os.path.abspath(self.build_clib),
        ]
        if os.environ.get('SECP_BUNDLED_WITH_BIGNUM'):
            log.info("Building with bignum support (requires libgmp)")
            cmd.extend(["--with-bignum=gmp"])
        else:
            cmd.extend(["--without-bignum"])

        if os.environ.get('SECP_BUNDLED_EXPERIMENTAL'):
            log.info("Building experimental")
            cmd.extend([
                "--enable-experimental",
                "--enable-module-ecdh",
                "--enable-module-schnorr",
            ])

        log.debug("Running configure: {}".format(" ".join(cmd)))
        subprocess.check_call(
            cmd,
            cwd=build_temp,
        )

        subprocess.check_call(["make"], cwd=build_temp)
        subprocess.check_call(["make", "install"], cwd=build_temp)

        self.build_flags['include_dirs'].extend(build_flags('libsecp256k1', 'I', build_temp))
        self.build_flags['library_dirs'].extend(build_flags('libsecp256k1', 'L', build_temp))
        if not has_system_lib():
            self.build_flags['define'].append(('CFFI_ENABLE_RECOVERY', None))
        else:
            pass
Esempio n. 7
0
 def get_library_names(self):
     return build_flags('libsecp256k1', 'l', os.path.abspath(self.build_temp))
Esempio n. 8
0
 def get_library_names(self):
     return build_flags('libevmjit', 'l', os.path.abspath(self.build_temp))