Esempio n. 1
0
 def source(self):
     download_url = 'https://github.com/nlohmann/json/releases/download/v{!s}/json.hpp'.format(
         self.version)
     download(download_url, 'json.hpp')
     check_sha256(
         'json.hpp',
         'a571dee92515b685784fd527e38405cf3f5e13e96edbfe3f03d6df2e363a767b')
Esempio n. 2
0
    def build(self):
        arch = str(self.settings.arch_build)
        tools.download(**self.conan_data["sources"][self.version][arch])
        filename = self.conan_data["sources"][self.version][arch]["filename"]
        sha256 = self.conan_data["checksum"][self.version][arch]["sha256"]
        tools.check_sha256(filename, sha256)
        tar_name = filename.replace(".xz", "")
        self.run("7z.exe x {0}".format(filename))
        self.run("7z.exe x {0}".format(tar_name))
        os.unlink(filename)
        os.unlink(tar_name)

        msys_dir = "msys64" if self.settings.arch_build == "x86_64" else "msys32"

        packages = []
        if self.options.packages:
            packages.extend(str(self.options.packages).split(","))
        if self.options.additional_packages:
            packages.extend(str(self.options.additional_packages).split(","))

        with tools.chdir(os.path.join(msys_dir, "usr", "bin")):
            for package in packages:
                self.run('bash -l -c "pacman -S %s --noconfirm"' % package)

        # create /tmp dir in order to avoid
        # bash.exe: warning: could not find /tmp, please create!
        tmp_dir = os.path.join(msys_dir, 'tmp')
        if not os.path.isdir(tmp_dir):
            os.makedirs(tmp_dir)
        tmp_name = os.path.join(tmp_dir, 'dummy')
        with open(tmp_name, 'a'):
            os.utime(tmp_name, None)
Esempio n. 3
0
    def build(self):
        os_name = {
            "Windows": "windows.bin"
            if self.settings.arch == "x86" else "windows.x64.bin",
            "Macos": ".dmg",
            "Linux": "linux"
        }
        dest_file = None
        for data in self.conan_data["sources"][self.version]:
            sha = data["sha256"]
            url = data["url"]
            filename = url[url.rfind("/") + 1:]
            self.output.info("Downloading: {}".format(url))
            tools.download(url, filename)
            tools.check_sha256(filename, sha)
            if os_name[str(self.settings.os)] in url:
                dest_file = filename

        if not dest_file:
            raise ConanInvalidConfiguration(
                "could not find source file fo the configuration")

        tools.unzip("doxygen-{}.linux.bin.tar.gz".format(self.version),
                    pattern="*LICENSE")

        if self.settings.os == "Macos":
            self.unpack_dmg(dest_file)
            # Redirect the path of libclang.dylib to be adjacent to the doxygen executable, instead of in Frameworks
            self.run(
                'install_name_tool -change "@executable_path/../Frameworks/libclang.dylib" "@executable_path/libclang.dylib" doxygen'
            )
        else:
            tools.unzip(dest_file)
Esempio n. 4
0
 def source(self):
     tools.download(
         "https://github.com/jemalloc/jemalloc/releases/download/{}/{}".
         format(self.version, self.archive_name), self.archive_name)
     tools.check_sha256(self.archive_name, self.sha256)
     tools.unzip(self.archive_name)
     os.unlink(self.archive_name)
Esempio n. 5
0
    def download_source(self):
        zip_name = self.name + ".zip"

        download(self.DOWNLOAD_LINK, zip_name)
        check_sha256(zip_name, self.FILE_SHA)
        unzip(zip_name)
        os.unlink(zip_name)
Esempio n. 6
0
 def source(self):
     tools.download(
         "https://github.com/edenhill/librdkafka/archive/v{}.tar.gz".format(
             self.src_version), self.archive_name)
     tools.check_sha256(self.archive_name, self.sha256)
     tools.unzip(self.archive_name)
     os.unlink(self.archive_name)
Esempio n. 7
0
 def source(self):
     for source in self.conan_data["sources"][self.version]:
         url = source["url"]
         filename = url[url.rfind("/") + 1:]
         tools.download(url, filename)
         tools.check_sha256(filename, source["sha256"])
     rename(self, "ApprovalTests.v.{}.hpp".format(self.version), self._header_file)
Esempio n. 8
0
    def md5_test(self):
        folder = temp_folder()
        filepath = os.path.join(folder, "file.txt")
        file_content = "a file"
        save(filepath, file_content)

        check_md5(filepath, "d6d0c756fb8abfb33e652a20e85b70bc")
        check_sha1(filepath, "eb599ec83d383f0f25691c184f656d40384f9435")
        check_sha256(
            filepath,
            "7365d029861e32c521f8089b00a6fb32daf0615025b69b599d1ce53501b845c2")

        with self.assertRaisesRegexp(
                ConanException,
                "md5 signature failed for 'file.txt' file. Computed signature:"
        ):
            check_md5(filepath, "invalid")

        with self.assertRaisesRegexp(
                ConanException,
                "sha1 signature failed for 'file.txt' file. Computed signature:"
        ):
            check_sha1(filepath, "invalid")

        with self.assertRaisesRegexp(
                ConanException,
                "sha256 signature failed for 'file.txt' file. Computed signature:"
        ):
            check_sha256(filepath, "invalid")
 def source(self):
     archive_url = 'https://github.com/google/benchmark/archive/v{!s}.zip'.format(self.version)
     tools.download(archive_url, 'benchmark.zip')
     tools.check_sha256('benchmark.zip', '7f5f3608c9228fa023151a4b54e91f4ada4b7b49c26facede6c5b8b83ddbedad')
     tools.unzip('benchmark.zip')
     os.unlink('benchmark.zip')
     shutil.move('benchmark-{!s}'.format(self.version), 'benchmark')
 def build(self):
     for source in self.conan_data["sources"][self.version]:
         url = source["url"]
         filename = url[url.rfind("/") + 1:]
         if filename in ["LICENSE", self._bazel_filename]:
             tools.download(url, filename)
             tools.check_sha256(filename, source["sha256"])
Esempio n. 11
0
    def build(self):
        name = 'DXSDK_{}.exe'.format(self.version)
        url = 'https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/{}'.format(
            name)
        sha256 = '9f818a977c32b254af5d649a4cec269ed8762f8a49ae67a9f01101a7237ae61a'

        targetdlfn = '{}'.format(os.path.join(tempfile.gettempdir(), name))

        if os.path.exists(targetdlfn) and not get_env(
                'DIRECTX9_FORCE_DOWNLOAD', False):
            self.output.info(
                'Skipping download. Using cached {}'.format(targetdlfn))
        else:
            self.output.info('Downloading sdk from {} to {}'.format(
                url, targetdlfn))
            tools.download(url, targetdlfn)
        tools.check_sha256(targetdlfn, sha256)

        self.run('7z x "{}" -y'.format(targetdlfn))

        dirs = [
            os.path.join('DXSDK', 'Include'),
            os.path.join('DXSDK', 'Lib', 'x86'),
            os.path.join('DXSDK', 'Lib', 'x64'),
        ]
        for d in dirs:
            for f in os.listdir(d):
                fp = os.path.join(d, f)
                import stat
                os.chmod(
                    fp,
                    stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWOTH)
Esempio n. 12
0
 def source(self):
     zipname = 'cryptopp565.zip'
     url = 'http://cryptopp.com/%s' % zipname
     sha256 = 'a75ef486fe3128008bbb201efee3dcdcffbe791120952910883b26337ec32c34'
     tools.download(url, zipname)
     tools.check_sha256(zipname, sha256)
     tools.unzip(zipname)
     os.unlink(zipname)
Esempio n. 13
0
 def source(self):
     download_filename = "v%s.tar.gz" % self.version
     tools.download(
         'https://github.com/google/protobuf/archive/%s' %
         download_filename, download_filename)
     tools.check_sha256(download_filename, self._sha256)
     tools.unzip(download_filename)
     os.unlink(download_filename)
Esempio n. 14
0
 def source(self):
     zip_name = "v1.0.0.zip"
     download("https://github.com/google/benchmark/archive/%s" % zip_name,
              zip_name)
     check_sha256(
         zip_name,
         "5560358bf31e0478fa052de10c353cff809b8d2352bdfe695887e410ec593044")
     unzip(zip_name)
Esempio n. 15
0
 def source(self):
     tgz_name = "2.3.2.tar.gz"
     download("https://github.com/SFML/SFML/archive/%s" % tgz_name, tgz_name)
     check_sha256(tgz_name, "55e7c864938e03ceb7d6d05c66f8e0dc886e632805d0ae17c222da317ba14e4c")
     # unzip falls back to untargz in the case of tar.gz extension
     unzip(tgz_name)
     os.unlink(tgz_name)
     patch(base_path=self.ZIP_FOLDER_NAME, patch_string=SFML_GCC_PATCH)
Esempio n. 16
0
 def source(self):
     zip_name = "duktape-2.0.0.tar.xz"
     download("http://duktape.org/%s" % zip_name, zip_name)
     check_sha256(
         zip_name,
         "e07bc1178225218a281de9f73f555390743dd805bafd5396229c69a16f740c4d")
     self.run("cmake -E tar xf %s" % zip_name)
     shutil.move("CMakeLists.txt", "%s/CMakeLists.txt" % self.source_root)
Esempio n. 17
0
 def source(self):
     zip_name = "sqlite-amalgamation-3100200.zip"
     download("http://www.sqlite.org/2016/%s" % zip_name, zip_name)
     check_sha256(
         zip_name,
         "b68adfb8cfd0ba5712e0ed8346929538ceb9125d6de4d15049db56201ac794f6")
     unzip(zip_name)
     os.unlink(zip_name)
Esempio n. 18
0
 def source(self):
     from six.moves.urllib.parse import urlparse
     url = self.conan_data["sources"][self.version]["url"]
     filename = os.path.basename(urlparse(url).path)
     sha256 = self.conan_data["sources"][self.version]["sha256"]
     tools.download(url, filename)
     tools.check_sha256(filename, sha256)
     self._uncompress_7z(filename)
 def source(self):
     zipfile_name = "nonius-{0}.zip"
     release_url = "https://github.com/libnonius/nonius/releases/download/v{0}/nonius-{0}.zip".format(self.version)
     sha256 = "44de210fb8de9fd7c72e47c141b0322f904e8636451263e5ed1d1bbd4f3c17e1"
     download(release_url, zipfile_name)
     check_sha256(zipfile_name, sha256)
     unzip(zipfile_name)
     unlink(zipfile_name)
Esempio n. 20
0
 def source(self):
     zipfile_name = "nonius-{0}.zip"
     release_url = "https://github.com/libnonius/nonius/releases/download/v{0}/nonius-{0}.zip".format(
         self.version)
     sha256 = "44de210fb8de9fd7c72e47c141b0322f904e8636451263e5ed1d1bbd4f3c17e1"
     download(release_url, zipfile_name)
     check_sha256(zipfile_name, sha256)
     unzip(zipfile_name)
     unlink(zipfile_name)
Esempio n. 21
0
 def source(self):
     targz_name = "{name}-v{version}.tar.gz".format(name=self.name,
                                                    version=self.version)
     tools.download("https://github.com/lxi-tools/liblxi/archive/v{version}.tar.gz".format(
         version=self.version), targz_name)
     tools.check_sha256(targz_name, self.checksum)
     tools.untargz(
         targz_name, destination=self._source_subfolder, strip_root=True)
     os.unlink(targz_name)
Esempio n. 22
0
 def source(self):
     zip_name = '0.8.zip'
     download('https://github.com/texus/TGUI/archive/%s' % zip_name,
              zip_name)
     check_sha256(
         zip_name,
         'BB9A796482D4DB78DDA244BCABBDAFFC9009EEF7F2C0F3FECEB9CC04DBE2DDC0')
     unzip(zip_name)
     os.unlink(zip_name)
Esempio n. 23
0
 def source(self):
     tgz_name = "%s.tar.gz" % self.version
     download("https://github.com/SFML/SFML/archive/%s" % tgz_name,
              tgz_name)
     check_sha256(
         tgz_name,
         "f9d1191b02e2df1cbe296601eee20bdf56d98fb69d49fde27c6ca789eb57398e")
     unzip(tgz_name)
     os.unlink(tgz_name)
Esempio n. 24
0
 def _get_epics_base_src(self):
     tools.download(
         "https://epics.anl.gov/download/base/{}.tar.gz".format(
             EPICS_BASE_DIR), "{}.tar.gz".format(EPICS_BASE_DIR))
     tools.check_sha256(
         "{}.tar.gz".format(EPICS_BASE_DIR),
         "1de65638a806be6c0eebc0b7840ed9dd1a1a7879bcb6ab0da88a1e8e456b709c")
     tools.unzip("{}.tar.gz".format(EPICS_BASE_DIR))
     os.unlink("{}.tar.gz".format(EPICS_BASE_DIR))
Esempio n. 25
0
 def source(self):
     archive_name = '{name}-{version}.tar.xz'.format(name=self.name, version=self.version)
     download('https://cmocka.org/files/{ver}/{archive_name}'.format(
         ver=self.version.rpartition('.')[0], archive_name=archive_name
     ), archive_name)
     check_sha256(archive_name, self.sha256)
     unzip(archive_name)
     remove(archive_name)
     rename('{name}-{version}'.format(name=self.name, version=self.version), self.name)
Esempio n. 26
0
    def source(self):
        zip_name = "%s.zip" % self.name

        tools.download(self.ZIP_URL, zip_name)
        tools.check_sha256(zip_name, self.FILE_SHA)
        tools.unzip(zip_name)
        os.unlink(zip_name)

        self.run("ls -la")
Esempio n. 27
0
 def source(self):
     download_filename = "v%s.tar.gz" % self.version
     tools.download(
         'https://github.com/google/protobuf/archive/%s' %
         download_filename, download_filename)
     tools.check_sha256(download_filename, self._sha256)
     tools.unzip(download_filename)
     os.unlink(download_filename)
     shutil.copy("change_dylib_names.sh", "%s/cmake" % self._source_dir)
Esempio n. 28
0
    def source(self):
        zip_name = "%s.tar.gz" % self.name

        tools.download(self.ZIP_URL, zip_name)
        tools.check_sha256(zip_name, self.FILE_SHA)
        tools.untargz(zip_name)
        #os.unlink(zip_name)
        
        os.rename(self.INSIDE_DIR, self.UNZIPPED_DIR)
Esempio n. 29
0
    def source(self):
        tools.download(self.conan_data["sources"][self.version]["url"],
                       "approvals/ApprovalTests.v%s.hpp" % self.version)
        tools.check_sha256("approvals/ApprovalTests.v%s.hpp" % self.version,
                           self.conan_data["sources"][self.version]["sha256"])

        os.rename("ApprovalTests.hpp.in", "approvals/ApprovalTests.hpp")
        tools.replace_in_file("approvals/ApprovalTests.hpp", "VERSION",
                              self.version)
Esempio n. 30
0
 def source(self):
     tgz_name = "2.4.1.tar.gz"
     download("https://github.com/SFML/SFML/archive/%s" %
              tgz_name, tgz_name)
     check_sha256(
         tgz_name, "f9d1191b02e2df1cbe296601eee20bdf56d98fb69d49fde27c6ca789eb57398e")
     # unzip falls back to untargz in the case of tar.gz extension
     unzip(tgz_name)
     os.unlink(tgz_name)
Esempio n. 31
0
 def source(self):
     archive_url = 'https://github.com/calccrypto/uint128_t{!s}.zip'.format(
         self.version)
     tools.download(archive_url, 'uint128_t-master.zip')
     tools.check_sha256(
         'uint128_t-master.zip',
         'dd6d767feb439b6b318c5f0e7dfac8644bf58ffa348bcf441ea8ee0da3e8baf2')
     tools.unzip('uint128_t-master.zip')
     os.unlink('uint128_t-master.zip')
     shutil.move('uint128_t-{!s}'.format(self.version), 'uint128_t')
Esempio n. 32
0
 def source(self):
     tgz_name = "2.4.1.tar.gz"
     download("https://github.com/SFML/SFML/archive/%s" % tgz_name,
              tgz_name)
     check_sha256(
         tgz_name,
         "f9d1191b02e2df1cbe296601eee20bdf56d98fb69d49fde27c6ca789eb57398e")
     # unzip falls back to untargz in the case of tar.gz extension
     unzip(tgz_name)
     os.unlink(tgz_name)
Esempio n. 33
0
 def source(self):
     download_url = 'https://github.com/martinmoene/optional-lite/archive/v{!s}.zip'.format(
         self.version)
     download(download_url, 'optional-lite-{!s}.zip'.format(self.version))
     check_sha256(
         'optional-lite-{!s}.zip'.format(self.version),
         'd2b6f6f5e2a762119bdad963ee1392b22b85a138cced9505f4c006b13820d686')
     unzip('optional-lite-{!s}.zip'.format(self.version))
     os.unlink('optional-lite-{!s}.zip'.format(self.version))
     os.rename('optional-lite-{!s}'.format(self.version), 'optional')
 def build(self):
     url = self.conan_data["sources"][self.version]["url"]
     tools.download(url, "mozilla-build.exe")
     tools.check_sha256("mozilla-build.exe",
                        self.conan_data["sources"][self.version]["sha256"])
     self.run("7z x mozilla-build.exe")
     os.unlink("mozilla-build.exe")
     tools.download(
         "https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt",
         "LICENSE")
Esempio n. 35
0
 def source(self):
     zip_name = "variant.zip"
     download(
         "https://github.com/eggs-cpp/variant/archive/11a0fc94e196a101fa38ca74d616792e9b1fc507.zip",
         zip_name)
     check_sha256(
         zip_name,
         "6705a221db0915cd2b18801c17da1ed26e85f1e55885d3c002d6e13c21b8058d")
     unzip(zip_name)
     os.unlink(zip_name)
Esempio n. 36
0
    def source(self):
        self.output.info("Downloading %s" % self.source_tgz)
        try:
            tools.download(self.source_tgz_old, "openssl.tar.gz")
            tools.unzip("openssl.tar.gz", ".")
        except:
            tools.download(self.source_tgz, "openssl.tar.gz")
            tools.unzip("openssl.tar.gz", ".")

        tools.check_sha256("openssl.tar.gz", "b784b1b3907ce39abf4098702dade6365522a253ad1552e267a9a0e89594aa33")
        os.unlink("openssl.tar.gz")
Esempio n. 37
0
    def source(self):
        zip_name = "%s.zip" % self.full_version
        # download("https://www.libsdl.org/release/%s" % zip_name, zip_name)
        # We use this mercurial package because it fixes a critical build error
        # on the latest Arch linux. Remove once SDL 2.0.5 is released.
        download("https://hg.libsdl.org/SDL/archive/%s.zip" % self.mercurial_archive, zip_name)
        check_sha256(zip_name, 'dd2816bd7551ed206a8687dad224d3651522551dd3669a97ed820ba641f89a51')
        unzip(zip_name)
        os.unlink(zip_name)

        folder_name = 'SDL-%s' % (self.mercurial_archive)
        self.run("chmod +x ./%s/configure" % folder_name)
Esempio n. 38
0
 def source(self):
     tools.download(
         "https://github.com/edenhill/librdkafka/archive/v{}.tar.gz".format(
             self.src_version
         ),
         self.archive_name
     )
     tools.check_sha256(
         self.archive_name,
         self.sha256
     )
     tools.unzip(self.archive_name)
     os.unlink(self.archive_name)
Esempio n. 39
0
    def md5_test(self):
        folder = temp_folder()
        filepath = os.path.join(folder, "file.txt")
        file_content = "a file"
        save(filepath, file_content)

        check_md5(filepath, "d6d0c756fb8abfb33e652a20e85b70bc")
        check_sha1(filepath, "eb599ec83d383f0f25691c184f656d40384f9435")
        check_sha256(filepath, "7365d029861e32c521f8089b00a6fb32daf0615025b69b599d1ce53501b845c2")

        with self.assertRaisesRegexp(ConanException, "md5 signature failed for 'file.txt' file."):
            check_md5(filepath, "invalid")

        with self.assertRaisesRegexp(ConanException, "sha1 signature failed for 'file.txt' file."):
            check_sha1(filepath, "invalid")

        with self.assertRaisesRegexp(ConanException, "sha256 signature failed for 'file.txt' file."):
            check_sha256(filepath, "invalid")
Esempio n. 40
0
 def source(self):
     zip_name = "websocketpp.zip"
     download("https://github.com/zaphoyd/websocketpp/archive/0.7.0.zip", zip_name)
     check_sha256(zip_name, "547abdfc372a2e11a5cdde5cca3fb5e66f41d941534430180d98e9f3561da055")
     unzip(zip_name)
     os.unlink(zip_name)
Esempio n. 41
0
 def source(self):
     zip_name = "variant.zip"
     download("https://github.com/eggs-cpp/variant/archive/11a0fc94e196a101fa38ca74d616792e9b1fc507.zip", zip_name)
     check_sha256(zip_name, "6705a221db0915cd2b18801c17da1ed26e85f1e55885d3c002d6e13c21b8058d")
     unzip(zip_name)
     os.unlink(zip_name)
Esempio n. 42
0
 def source(self):
     zip_name = "sqlite-amalgamation-3100200.zip"
     download("http://www.sqlite.org/2016/%s" % zip_name, zip_name)
     check_sha256(zip_name, "b68adfb8cfd0ba5712e0ed8346929538ceb9125d6de4d15049db56201ac794f6")
     unzip(zip_name)
     os.unlink(zip_name)
Esempio n. 43
0
 def source(self):
     zip_name = "catch.zip"
     download("https://github.com/philsquared/Catch/archive/%s" % self.ZIP_URL_NAME, zip_name)
     check_sha256(zip_name, self.FILE_SHA)
     unzip(zip_name)
     os.unlink(zip_name)
Esempio n. 44
0
 def source(self):
     zip_name = "duktape-2.2.0.tar.xz"
     download("http://duktape.org/%s" % zip_name, zip_name)
     check_sha256(zip_name, "62f72206427633077cb02e7ccd2599ace4d254db409334593b86d262c0d50c14")
     self.run("cmake -E tar xf %s" % zip_name)
     shutil.move("CMakeLists.txt", "%s/CMakeLists.txt" % self.source_root)
Esempio n. 45
0
 def source(self):
     zip_name = "6b9781475d70272538a5ce48ad96f583f3a373c3.zip"
     download("https://github.com/SFML/SFML/archive/%s" % zip_name, zip_name)
     check_sha256(zip_name, "78a646ed839e6ef36b21d73ac509403729a0a22f4d405f30bd3e3cdf0704d418")
     unzip(zip_name)
     os.unlink(zip_name)
Esempio n. 46
0
 def source(self):
     zip_name = "v1.0.0.zip"
     download("https://github.com/google/benchmark/archive/%s" % zip_name, zip_name)
     check_sha256(zip_name, "5560358bf31e0478fa052de10c353cff809b8d2352bdfe695887e410ec593044")
     unzip(zip_name)