Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mingw: externalize deps #11091

Merged
merged 4 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions recipes/mingw-w64/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
versions:
"8.0.2":
folder: "linux"

folder: "linux"
10 changes: 0 additions & 10 deletions recipes/mingw-w64/linux/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,7 @@ 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"
sha256: "64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344"

51 changes: 7 additions & 44 deletions recipes/mingw-w64/linux/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -77,51 +80,10 @@ 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={}".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 ...")
Expand Down Expand Up @@ -207,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")
Expand Down