From ab15a4660945f1907060dd20018239fb5b33def3 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 8 Jun 2022 18:14:03 +0200 Subject: [PATCH 1/4] mingw: externalize deps --- recipes/mingw-w64/linux/conandata.yml | 9 ----- recipes/mingw-w64/linux/conanfile.py | 53 +++++---------------------- 2 files changed, 9 insertions(+), 53 deletions(-) diff --git a/recipes/mingw-w64/linux/conandata.yml b/recipes/mingw-w64/linux/conandata.yml index ece2d6599b4fa..bdc27ee970ef8 100644 --- a/recipes/mingw-w64/linux/conandata.yml +++ b/recipes/mingw-w64/linux/conandata.yml @@ -6,15 +6,6 @@ sources: binutils: url: "http://ftp.gnu.org/gnu/binutils/binutils-2.35.2.tar.bz2" sha256: "cfa7644dbecf4591e136eb407c1c1da16578bd2b03f0c2e8acdceba194bb9d61" - gmp: - url: "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz" - sha256: "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2" - mpfr: - url: "https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.xz" - sha256: "0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f" - mpc: - url: "https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz" - sha256: "17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459" gcc: "10.3.0": url: "http://ftp.gnu.org/gnu/gcc/gcc-10.3.0/gcc-10.3.0.tar.xz" diff --git a/recipes/mingw-w64/linux/conanfile.py b/recipes/mingw-w64/linux/conanfile.py index ebd55e7c0a3d1..b727de8b6a734 100644 --- a/recipes/mingw-w64/linux/conanfile.py +++ b/recipes/mingw-w64/linux/conanfile.py @@ -37,6 +37,9 @@ def validate(self): def build_requirements(self): self.build_requires("m4/1.4.19") + self.build_requires("gmp/6.2.1") + self.build_requires("mpfr/4.1.0") + self.build_requires("mpc/1.2.0") def _download_source(self): arch_data = self.conan_data["sources"][self.version] @@ -77,51 +80,13 @@ def build(self): env = {"PATH": os.environ["PATH"] + ":" + os.path.join(self.package_folder, "bin")} with tools.environment_append(env): - self.output.info("Building gmp ...") - os.mkdir(os.path.join(self.build_folder, "gmp")) - with tools.chdir(os.path.join(self.build_folder, "gmp")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--disable-shared" - ] - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "gmp"), - args=conf_args, target=False, host=False, build=False) - autotools.make() - autotools.install() - - self.output.info("Building mpfr ...") - os.mkdir(os.path.join(self.build_folder, "mpfr")) - with tools.chdir(os.path.join(self.build_folder, "mpfr")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--disable-shared", - "--with-gmp={}".format(self.package_folder) - ] - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mpfr"), - args=conf_args, target=False, host=False, build=False) - autotools.make() - autotools.install() - - self.output.info("Building mpc ...") - os.mkdir(os.path.join(self.build_folder, "mpc")) - with tools.chdir(os.path.join(self.build_folder, "mpc")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--disable-shared", - "--with-gmp={}".format(self.package_folder), - "--with-mpfr={}".format(self.package_folder) - ] - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mpc"), - args=conf_args, target=False, host=False, build=False) - autotools.make() - autotools.install() with_gmp_mpfc_mpc = [ - "--with-gmp={}".format(self.package_folder), - "--with-mpfr={}".format(self.package_folder), - "--with-mpc={}".format(self.package_folder) + "--with-gmp=system", + "--with-gmp-prefix={}".format(self.deps_cpp_info["gmp"].rootpath.replace("\\", "/")), + "--with-mpfr=system", + "--with-mpfr-prefix={}".format(self.deps_cpp_info["mpfr"].rootpath.replace("\\", "/")), + "--with-mpc=system", + "--with-mpc-prefix={}".format(self.deps_cpp_info["mpc"].rootpath.replace("\\", "/")) ] self.output.info("Building binutils ...") From 61c3b960ac6bba11a7b97acdabf3d5f863ec717e Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 9 Jun 2022 09:39:31 +0200 Subject: [PATCH 2/4] Update conanfile.py --- recipes/mingw-w64/linux/conanfile.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/recipes/mingw-w64/linux/conanfile.py b/recipes/mingw-w64/linux/conanfile.py index b727de8b6a734..3da23fd7e4174 100644 --- a/recipes/mingw-w64/linux/conanfile.py +++ b/recipes/mingw-w64/linux/conanfile.py @@ -81,12 +81,9 @@ def build(self): with tools.environment_append(env): with_gmp_mpfc_mpc = [ - "--with-gmp=system", - "--with-gmp-prefix={}".format(self.deps_cpp_info["gmp"].rootpath.replace("\\", "/")), - "--with-mpfr=system", - "--with-mpfr-prefix={}".format(self.deps_cpp_info["mpfr"].rootpath.replace("\\", "/")), - "--with-mpc=system", - "--with-mpc-prefix={}".format(self.deps_cpp_info["mpc"].rootpath.replace("\\", "/")) + "--with-gmp={}".format(self.deps_cpp_info["gmp"].rootpath.replace("\\", "/")), + "--with-mpfr={}".format(self.deps_cpp_info["mpfr"].rootpath.replace("\\", "/")), + "--with-mpc={}".format(self.deps_cpp_info["mpc"].rootpath.replace("\\", "/")) ] self.output.info("Building binutils ...") From acb4fd95acf21ccd62bbc47608d14fc35d9f38d1 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 9 Jun 2022 12:17:27 +0000 Subject: [PATCH 3/4] don't propagate libs to gcc --- recipes/mingw-w64/linux/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/mingw-w64/linux/conanfile.py b/recipes/mingw-w64/linux/conanfile.py index 3da23fd7e4174..0aac88eb400c0 100644 --- a/recipes/mingw-w64/linux/conanfile.py +++ b/recipes/mingw-w64/linux/conanfile.py @@ -169,6 +169,7 @@ def build(self): # Not 100% sure why, but the following options are required, otherwise # gcc fails to build with posix threads ]) + autotools_gcc.libs = [] autotools_gcc.configure(configure_dir=os.path.join(self.build_folder, "sources", "gcc"), args=conf_args, target=target_tag, host=False, build=False) autotools_gcc.make(target="all-gcc") From c264337c5f31ab78c131dc018b8928099b75527d Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 9 Jun 2022 12:59:53 +0000 Subject: [PATCH 4/4] fixup yml formatting --- recipes/mingw-w64/config.yml | 3 +-- recipes/mingw-w64/linux/conandata.yml | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/recipes/mingw-w64/config.yml b/recipes/mingw-w64/config.yml index 8bd9d1c5980b8..ccd4069ab51d6 100644 --- a/recipes/mingw-w64/config.yml +++ b/recipes/mingw-w64/config.yml @@ -1,4 +1,3 @@ versions: "8.0.2": - folder: "linux" - + folder: "linux" diff --git a/recipes/mingw-w64/linux/conandata.yml b/recipes/mingw-w64/linux/conandata.yml index bdc27ee970ef8..4c165fd2e4f36 100644 --- a/recipes/mingw-w64/linux/conandata.yml +++ b/recipes/mingw-w64/linux/conandata.yml @@ -10,4 +10,3 @@ sources: "10.3.0": url: "http://ftp.gnu.org/gnu/gcc/gcc-10.3.0/gcc-10.3.0.tar.xz" sha256: "64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344" -