def source(self): zip_name = "zlib-1.2.8.zip" download("http://zlib.net/zlib128.zip", zip_name) unzip(zip_name) os.unlink(zip_name) if self.settings.os != "Windows": self.run("chmod +x ./%s/configure" % self.ZIP_FOLDER_NAME)
def source(self): zip_name = "%s.zip" % self.folder download("https://www.libsdl.org/release/SDL2-%s.zip" % self.version, zip_name) unzip(zip_name) shutil.move("%s/CMakeLists.txt" % self.folder, "%s/CMakeListsOriginal.cmake" % self.folder) shutil.move("CMakeLists.txt", "%s/CMakeLists.txt" % self.folder)
def source(self): zip_name = "%s-%s.zip" % (self.name, self.version) url = "https://github.com/syncro/%s/archive/master.zip" % self.name download(url, zip_name) unzip(zip_name) os.system("cp -R %s-%s/* ." % (self.name, self.version)) # hack to build as dependency os.unlink(zip_name)
def source(self): zip_name = "WpdPack_4_1_2.zip" download("https://www.winpcap.org/install/bin/%s" % zip_name, zip_name) check_sha1(zip_name, "f5c80885bd48f07f41833d0f65bf85da1ef1727a") unzip(zip_name) os.unlink(zip_name)
def source(self): zip_name = "tclap-%s.tar.gz" % self.version download("http://downloads.sourceforge.net/project/tclap/" + zip_name + "?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Ftclap%2Ffiles%2F&ts=1466246416&use_mirror=tenet", zip_name) unzip(zip_name) # strip version from folder name so it does not have to be used later shutil.move("tclap-%s" % self.version, "tclap") os.unlink(zip_name)
def source(self): archive = "{}.tar.gz".format(self.lua_dir) tools.download("https://www.lua.org/ftp/lua-5.2.3.tar.gz", archive) tools.unzip(archive, ".") os.remove(archive) shutil.copy("CMakeLists.txt", os.path.join(self.lua_dir, "CMakeLists.txt"))
def source(self): tarball_name = self.FOLDER_NAME + '.tar.gz' download("https://github.com/libevent/libevent/releases/download/release-%s-stable/%s.tar.gz" % (self.version, self.FOLDER_NAME), tarball_name) check_sha1(tarball_name, "a586882bc93a208318c70fc7077ed8fca9862864") untargz(tarball_name) os.unlink(tarball_name)
def source(self): zip_name = "%s.zip" % self.FOLDER_NAME if sys.platform == "win32" else "%s.tar.gz" % self.FOLDER_NAME url = "http://sourceforge.net/projects/boost/files/boost/%s/%s/download" % (self.version, zip_name) self.output.info("Downloading %s..." % url) tools.download(url, zip_name) tools.unzip(zip_name, ".") os.unlink(zip_name)
def source(self): zip_name = "log4cpp-%s.zip" % self.version url = "https://github.com/orocos-toolchain/log4cpp/archive/master.zip" download(url, zip_name) unzip(zip_name) os.system("cp -R log4cpp-%s/* ." % self.version) # hack to build as dependency os.unlink(zip_name)
def source(self): tar_file = "mysql-connector-c-%s-src.tar.gz" % self.version download("http://dev.mysql.com/get/Downloads/Connector-C/%s" % tar_file, tar_file) unzip(tar_file) shutil.move("mysql-connector-c-%s-src" % self.version, "mysqlclient") os.unlink(tar_file) shutil.move("mysqlclient/CMakeLists.txt", "mysqlclient/CMakeListsOriginal.cmake") shutil.move("CMakeLists.txt", "mysqlclient/CMakeLists.txt")
def source(self): zip_name = "poco-%s-release.zip" % self.version download("https://github.com/pocoproject/poco/archive/%s" % zip_name, zip_name) unzip(zip_name) shutil.move("poco-poco-%s-release" % self.version, "poco") os.unlink(zip_name) shutil.move("poco/CMakeLists.txt", "poco/CMakeListsOriginal.cmake") shutil.move("CMakeLists.txt", "poco/CMakeLists.txt")
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)
def source(self): zip_name = "sanitizers-cmake.zip" download("https://github.com/arsenm/sanitizers-cmake/" "archive/master.zip" "".format(version="sanitizers-cmake-" + VERSION), zip_name) unzip(zip_name) os.unlink(zip_name)
def source(self): zip_name = "curl-%s.tar.gz" % self.version download("https://curl.haxx.se/download/%s" % zip_name, zip_name, verify=False) unzip(zip_name) os.unlink(zip_name) download("https://curl.haxx.se/ca/cacert.pem", "cacert.pem", verify=False) if self.settings.os != "Windows": self.run("chmod +x ./%s/configure" % self.ZIP_FOLDER_NAME)
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)
def source(self): zip_name = "cmake-linter-cmake.zip" download("https://github.com/polysquare/" "cmake-linter-cmake/archive/{version}.zip" "".format(version="v" + VERSION), zip_name) unzip(zip_name) os.unlink(zip_name)
def source(self): zip_name = "cpp-subprocess.zip" download("https://github.com/polysquare/" "cpp-subprocess/archive/{version}.zip" "".format(version="v" + VERSION), zip_name) unzip(zip_name) os.unlink(zip_name)
def source(self): zip_name = "cotire.zip" download("https://github.com/sakra/" "cotire/archive/{version}.zip" "".format(version="cotire-" + VERSION), zip_name) unzip(zip_name) os.unlink(zip_name)
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)
def source(self): zip_name = "root_v%s.source.tar.gz" % self.version download("https://root.cern.ch/download/%s" % zip_name, zip_name) unzip(zip_name) os.unlink(zip_name) shutil.move("%s/CMakeLists.txt" % self.folder, "%s/CMakeListsOriginal.cmake" % self.folder) shutil.move("CMakeLists.txt", "%s/CMakeLists.txt" % self.folder)
def source(self): distrib_url = 'https://sourceforge.net/projects/geographiclib/files/distrib/' tarball = '%s-%s.tar.gz' % (self.name, self.version) self.output.info('Downloading %s' % tarball) tools.download(distrib_url + tarball, tarball) tools.untargz(tarball) shutil.move('%s-%s' % (self.name, self.version), 'distrib') os.unlink(tarball)
def source(self): zip_name = "rtmidi-%s.tar.gz" % self.version # this will create a hello subfolder, take it into account download("http://www.music.mcgill.ca/~gary/rtmidi/release/%s" % zip_name, zip_name) unzip(zip_name) # strip version from folder name so it does not have to be used later shutil.move("rtmidi-%s" % self.version, "rtmidi") os.unlink(zip_name)
def source(self): self.output.info("Downloading %s" % self.source_tgz) tools.download(self.source_tgz, "libjpeg.zip") tools.unzip("libjpeg.zip", ".") os.unlink("libjpeg.zip") self.output.info("Copying CMakeLists.txt") shutil.move("CMake/CMakeLists.txt", self.libjpeg_name) shutil.move("CMake/jconfig.h.cmake", self.libjpeg_name)
def source(self): zip_name = "lcms2-%s.tar.gz" % self.version download("http://downloads.sourceforge.net/project/lcms/lcms/2.7/%s" % zip_name, zip_name) unzip(zip_name) os.unlink(zip_name) if self.settings.os != "Windows": self.run("chmod +x ./%s/configure" % self.ZIP_FOLDER_NAME) else: copyfile("CMakeLists.txt", os.path.join(self.ZIP_FOLDER_NAME, "CMakeLists.txt"))
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)
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", ".") os.unlink("openssl.tar.gz")
def source( self ): zip_name = "glfw-3.2.zip" tools.download("https://github.com/glfw/glfw/releases/download/3.2/glfw-3.2.zip", zip_name) tools.unzip(zip_name) os.unlink(zip_name) tools.replace_in_file("glfw-3.2/CMakeLists.txt", "project(GLFW C)", """project(GLFW C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() """)
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")
def source(self): targzfile = '%s.tar.gz' % self.ZIP_FOLDER_NAME tools.download("http://www.fftw.org/fftw-%s.tar.gz" % self.version, targzfile) tools.check_md5(targzfile, "2edab8c06b24feeb3b82bbb3ebf3e7b3") tools.untargz(targzfile) os.unlink(targzfile) shutil.move("CMakeLists.txt", self.ZIP_FOLDER_NAME) shutil.move("config.h.cmake", self.ZIP_FOLDER_NAME) shutil.move("config.h.cmaketemplate", self.ZIP_FOLDER_NAME)
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")
def source(self): url = self.conan_data["sources"][self.version]["url"] archive_name = os.path.basename(url) archive_name = os.path.splitext(archive_name)[0] sha = self.conan_data["sources"][self.version]["sha256"] tools.download(url, archive_name, sha256=sha)
def source(self): tar = 'type_safe-{}.tar.gz'.format(self.version) url = 'https://github.com/foonathan/type_safe/archive/v{}.tar.gz'.format( self.version) download(url, tar) untargz(tar)
def source(self): zip_name = "MeteoIO-%s-src.tar.gz" % self.version download("https://models.slf.ch/p/meteoio/downloads/get/%s" % zip_name, zip_name) untargz(zip_name) os.unlink(zip_name)
def source(self): zip_name = "gdal-2.1.3.zip" download("http://download.osgeo.org/gdal/2.1.3/gdal213.zip", zip_name) unzip(zip_name) shutil.move("gdal-2.1.3", "gdal") os.unlink(zip_name)
def source(self): pkg_name = "v" + self.version + ".zip" tools.download(self.url + "/archive/" + pkg_name, pkg_name) tools.unzip(pkg_name)
def source(self): source_url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/15303/%s" % self._exe_name tools.download(source_url, self._exe_name)
def extractFromUrl(self, url): self.output.info('download {}'.format(url)) filename = os.path.basename(url) download(url, filename) self.run('tar xf %s' % filename) os.unlink(filename)
def source(self): tar_name = "libxslt-%s.tar.gz" % self.version url = "http://xmlsoft.org/sources/" + tar_name download(url, tar_name) untargz(tar_name) os.unlink(tar_name)
def _download(self, url, sha256): from six.moves.urllib.parse import urlparse filename = os.path.basename(urlparse(url).path) tools.download(url, filename) tools.check_sha256(filename, sha256) return filename
def source(self): tools.download(self.source_url, self.source_file) tools.check_sha256(self.source_file, self.source_checksum) tools.unzip(self.source_file, '.') os.unlink(self.source_file)
def source(self): tools.download(self.url, self.archive) tools.unzip(self.archive) os.unlink(self.archive)
def source(self): zip_name = "release-%s.zip" % self.version url = "https://github.com/google/googletest/archive/%s" % zip_name download(url, zip_name) unzip(zip_name) os.unlink(zip_name)
def source(self): zip_name = "v%s.tar.gz" % self.version url = "https://github.com/gflags/gflags/archive/%s" % zip_name download(url, zip_name) unzip(zip_name) os.unlink(zip_name)
def source(self): tools.download( "https://github.com/grpc/grpc/archive/31606bdb34474d8728350ad45baf0e91b590b041.zip", "grpc.zip") tools.unzip("grpc.zip") os.unlink("grpc.zip") cmake_name = "{}/CMakeLists.txt".format(self.folder) # tell grpc to use our deps and flags tools.replace_in_file( cmake_name, "project(${PACKAGE_NAME} C CXX)", '''project(${PACKAGE_NAME} C CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup()''') tools.replace_in_file(cmake_name, "\"module\" CACHE STRING ", '''\"package\" CACHE STRING ''' ) # tell grpc to use the find_package version # skip installing the headers, TODO: use these! tools.replace_in_file( cmake_name, ''' install(FILES ${_hdr} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${_path}" )''', ''' # install(FILES ${_hdr} # COMMENTED BY CONAN # DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${_path}" # )''') # Add some CMake Variables (effectively commenting out stuff we do not support) tools.replace_in_file( cmake_name, "add_library(grpc_cronet", '''if(CONAN_ENABLE_MOBILE) add_library(grpc_cronet''') tools.replace_in_file( cmake_name, "add_library(grpc_unsecure", '''endif(CONAN_ENABLE_MOBILE) add_library(grpc_unsecure''') tools.replace_in_file( cmake_name, "add_library(grpc++_cronet", '''if(CONAN_ENABLE_MOBILE) add_library(grpc++_cronet''') tools.replace_in_file( cmake_name, "add_library(grpc++_reflection", '''endif(CONAN_ENABLE_MOBILE) if(CONAN_ENABLE_REFLECTION_LIBS) add_library(grpc++_reflection''') tools.replace_in_file( cmake_name, "add_library(grpc++_unsecure", '''endif(CONAN_ENABLE_REFLECTION_LIBS) add_library(grpc++_unsecure''') tools.replace_in_file( cmake_name, "add_library(grpc_csharp_ext", '''if(CONAN_ADDITIONAL_PLUGINS) add_library(grpc_csharp_ext''') tools.replace_in_file( cmake_name, "add_executable(gen_hpack_tables", '''endif(CONAN_ADDITIONAL_PLUGINS) if(CONAN_ADDITIONAL_BINS) add_executable(gen_hpack_tables''') tools.replace_in_file( cmake_name, "add_executable(grpc_cpp_plugin", '''endif(CONAN_ADDITIONAL_BINS) add_executable(grpc_cpp_plugin''') tools.replace_in_file( cmake_name, "add_executable(grpc_csharp_plugin", '''if(CONAN_ADDITIONAL_PLUGINS) add_executable(grpc_csharp_plugin''') tools.replace_in_file( cmake_name, '''install(TARGETS grpc_ruby_plugin EXPORT gRPCTargets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif()''', '''install(TARGETS grpc_ruby_plugin EXPORT gRPCTargets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() endif(CONAN_ADDITIONAL_PLUGINS)''')
def source(self): for url_sha in self.conan_data["sources"][self.version]: tools.download(url_sha["url"], os.path.basename(url_sha["url"])) tools.check_sha256(os.path.basename(url_sha["url"]), url_sha["sha256"])
def source(self): tools.download( "https://github.com/skaslev/gl3w/raw/master/gl3w_gen.py", "gl3w_downloader/gl3w_gen.py") self.run("python gl3w_downloader/gl3w_gen.py gl3w")
def build(self): filename = "setup-%s.exe" % self.arch url = "https://cygwin.com/%s" % filename tools.download(url, filename) if not os.path.isdir(self.install_dir): os.makedirs(self.install_dir) # https://cygwin.com/faq/faq.html#faq.setup.cli command = filename command += ' --arch %s' % self.arch # Disable creation of desktop and start menu shortcuts command += ' --no-shortcuts' # Do not check for and enforce running as Administrator command += ' --no-admin' # Unattended setup mode command += ' --quiet-mode' command += ' --root %s' % os.path.abspath(self.install_dir) # TODO : download and parse mirror list, probably also select the best one command += ' -s http://cygwin.mirror.constant.com' command += ' --local-package-dir %s' % tempfile.mkdtemp() 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(",")) if packages: command += ' --packages %s' % ','.join(packages) self.run(command) os.unlink(filename) # create /tmp dir in order to avoid # bash.exe: warning: could not find /tmp, please create! tmp_dir = os.path.join(self.install_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) def add_line(line): nsswitch_conf = os.path.join(self.install_dir, 'etc', 'nsswitch.conf') with open(nsswitch_conf, 'a') as f: f.write('%s\n' % line) if self.options.db_enum: add_line('db_enum: %s' % self.options.db_enum) if self.options.db_home: add_line('db_home: %s' % self.options.db_home) if self.options.db_shell: add_line('db_shell: %s' % self.options.db_shell) if self.options.db_gecos: add_line('db_gecos: %s' % self.options.db_gecos) if self.options.no_acl: fstab = os.path.join(self.install_dir, 'etc', 'fstab') tools.replace_in_file(fstab, """# This is default anyway: none /cygdrive cygdrive binary,posix=0,user 0 0""", """none /cygdrive cygdrive noacl,binary,posix=0,user 0 0 {0}/bin /usr/bin ntfs binary,auto,noacl 0 0 {0}/lib /usr/lib ntfs binary,auto,noacl 0 0 {0} / ntfs override,binary,auto,noacl 0 0""".format(self.package_folder.replace('\\', '/')))
def source(self): if self.version != "master": zip_name = "%s.tgz" % self.source_directory download("https://sourceforge.net/projects/glew/files/glew/%s/%s/download" % (self.version, zip_name), zip_name) unzip(zip_name) os.unlink(zip_name)
def source(self): tools.download('https://www.numbercrunch.de/trng/trng-4.21.tar.gz', 'trng-4.21.tar.gz') tools.unzip('trng-4.21.tar.gz') return 'trng-4.12'
def source(self): url = "%s/%s/" % (self.homepage, self.version) sources = ["tweetnacl.h", "tweetnacl.c"] for s in sources: tools.download(url+s, s)
def update_repository(self): tools.download(self.repository_file, "repository.txt", overwrite=True)
def download_retries_test(self): out = TestBufferConanOutput() set_global_instances(out, requests) # Connection error with self.assertRaisesRegexp(ConanException, "HTTPConnectionPool"): tools.download("http://fakeurl3.es/nonexists", os.path.join(temp_folder(), "file.txt"), out=out, retry=3, retry_wait=0) # Not found error self.assertEquals(str(out).count("Waiting 0 seconds to retry..."), 2) with self.assertRaisesRegexp(NotFoundException, "Not found: "): tools.download( "https://github.com/conan-io/conan/blob/develop/FILE_NOT_FOUND.txt", os.path.join(temp_folder(), "README.txt"), out=out, retry=3, retry_wait=0) # And OK dest = os.path.join(temp_folder(), "manual.html") tools.download("http://www.zlib.net/manual.html", dest, out=out, retry=3, retry_wait=0) self.assertTrue(os.path.exists(dest)) content = load(dest) # overwrite = False with self.assertRaises(ConanException): tools.download("http://www.zlib.net/manual.html", dest, out=out, retry=3, retry_wait=0, overwrite=False) # overwrite = True tools.download("http://www.zlib.net/manual.html", dest, out=out, retry=3, retry_wait=0, overwrite=True) self.assertTrue(os.path.exists(dest)) content_new = load(dest) self.assertEqual(content, content_new) # Not authorized with self.assertRaises(ConanException): tools.download("https://httpbin.org/basic-auth/user/passwd", dest, overwrite=True) # Authorized tools.download("https://httpbin.org/basic-auth/user/passwd", dest, auth=("user", "passwd"), overwrite=True) # Authorized using headers tools.download("https://httpbin.org/basic-auth/user/passwd", dest, headers={"Authorization": "Basic dXNlcjpwYXNzd2Q="}, overwrite=True)
def source(self): self.output.info("Downloading %s" % self.source_tgz) tools.download(self.source_tgz, "rocksdb.tar.gz") tools.unzip("rocksdb.tar.gz") os.remove("rocksdb.tar.gz")
def source(self): zip_name = "gmp-%s.tar.bz2" % self.version folder_name = "gmp-%s" % self.version download("https://gmplib.org/download/gmp/%s" % zip_name, zip_name) unzip(zip_name) shutil.move(folder_name, "gmp")
def source(self): tools.download( "https://github.com/google/protobuf/" "releases/download/v3.1.0/protobuf-cpp-3.1.0.zip", "protobuf.zip") tools.unzip("protobuf.zip") os.unlink("protobuf.zip")
def source(self): if not os.path.exists("v0.8.8.zip"): tools.download("https://github.com/texus/TGUI/archive/v0.8.8.zip", "v0.8.8.zip") tools.unzip("v0.8.8.zip") os.rename("TGUI-0.8.8", "source")
def source(self): tools.get(**self.conan_data["sources"][self.version]) os.rename("curl-%s" % self.version, self._source_subfolder) tools.download("https://curl.haxx.se/ca/cacert.pem", "cacert.pem", verify=True)
def source(self): file_name = "{}-{}.cpp.gpl.zip".format(self.name, self.version) path = "{}/translator/re/{}".format(self.homepage, file_name) tools.download(path, file_name) tools.unzip(file_name, destination="source") os.remove(file_name)
def source(self): url = "https://github.com/miloyip/rapidjson/archive/%s" % self.zip_name download(url, self.zip_name) unzip(self.zip_name) os.unlink(self.zip_name)
def build(self): """ Define your project building. You decide the way of building it to reuse it later in any other project. """ env = ConfigureEnvironment(self.deps_cpp_info, self.settings) set_path_command = "" # Download nasm as build tool. This should go to source() if self.options.SSE == True: if self.settings.os == "Linux": # TODO: We should build nasm from source then. self.options.SSE = False # Or is removing here better? I'm not familiar with python.. else: nasm_version = "2.12.02" nasm_os_url_id = "" #nasm url identifier if self.settings.os == "Windows": if self.settings.arch == "x86": nasm_os_url_id = "win32" else: nasm_os_url_id = "win64" elif self.settings.os == "Macos": nasm_os_url_id = "macosx" nasm_folder_name = "nasm-%s-%s" % (nasm_version, nasm_os_url_id) nasm_zip_name = "%s.zip" % nasm_folder_name download("http://www.nasm.us/pub/nasm/releasebuilds/%s/%s/%s" % (nasm_version, nasm_os_url_id, nasm_zip_name), nasm_zip_name) self.output.warn("Downloading nasm: http://www.nasm.us/pub/nasm/releasebuilds/%s/%s/%s" % (nasm_version, nasm_os_url_id, nasm_zip_name)) unzip(nasm_zip_name) os.unlink(nasm_zip_name) nasm_path = os.path.join(os.getcwd(), nasm_folder_name) #env.environ["PATH"] += os.pathsep + nasm_path #its probably as easy as this, but i cant append to the path self.run operates in. if self.settings.os == "Windows": set_path_command = "set \"PATH=%s\" &&" % os.environ["PATH"] else: set_path_command = "PATH=\"%s\" &&" % os.environ["PATH"] if self.settings.os == "Linux" or self.settings.os == "Macos": if self.options.fPIC: env_line = env.command_line.replace('CFLAGS="', 'CFLAGS="-fPIC ') else: env_line = env.command_line self.run("cd %s && autoreconf -fiv" % self.ZIP_FOLDER_NAME) config_options = "" if self.settings.arch == "x86": if self.settings.os == "Linux": config_options = "--host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32" else: config_options = "--host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32" if self.settings.os == "Macos": old_str = '-install_name \$rpath/\$soname' new_str = '-install_name \$soname' replace_in_file("./%s/configure" % self.ZIP_FOLDER_NAME, old_str, new_str) self.run("cd %s && %s ./configure %s" % (self.ZIP_FOLDER_NAME, env_line, config_options)) self.run("cd %s && %s make" % (self.ZIP_FOLDER_NAME, env_line)) else: # We should (for simplicity) always use cmake shouldnt we? conan_magic_lines = '''project(libjpeg-turbo) cmake_minimum_required(VERSION 3.0) include(../conanbuildinfo.cmake) CONAN_BASIC_SETUP() ''' replace_in_file("%s/CMakeLists.txt" % self.ZIP_FOLDER_NAME, "cmake_minimum_required(VERSION 2.8.8)", conan_magic_lines) replace_in_file("%s/CMakeLists.txt" % self.ZIP_FOLDER_NAME, "project(libjpeg-turbo C)", "") cmake = CMake(self.settings) builddir = os.path.join(self.ZIP_FOLDER_NAME, "_build") if os.path.exists(builddir): shutil.rmtree(builddir) # We need to remove this folder first for windows os.makedirs(builddir) cmake_options = [] if self.options.shared == True: cmake_options += ["-DENABLE_STATIC=0"] else: cmake_options = ["-DENABLE_SHARED=0"] cmake_options += ["-DWITH_SIMD=%s" % "1" if self.options.SSE else "0"] # why this comment: "Don't change runtime, conan will take care of"? conan_basic_setup() runs before this cmake option replaces MT with MD again cmake_options += ["-DWITH_CRT_DLL=%s" % "1" if self.settings.compiler.runtime == "MD" or self.settings.compiler.runtime == "MDd" else "0"] self.run('%s cd %s && cmake .. %s %s' % (set_path_command, builddir, cmake.command_line, " ".join(cmake_options))) self.run("%s cd %s && cmake --build . %s" % (set_path_command, builddir, cmake.build_config))