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 should require m4 #9172

Merged
merged 3 commits into from
Feb 7, 2022
Merged
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
22 changes: 10 additions & 12 deletions recipes/mingw-w64/linux/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def validate(self):
raise ConanInvalidConfiguration("gcc version {} is not in the list of valid versions: {}"
.format(str(self.options.gcc), valid_gcc))

def build_requirements(self):
self.build_requires("m4/1.4.19")

def _download_source(self):
arch_data = self.conan_data["sources"][self.version]

Expand Down Expand Up @@ -257,16 +260,17 @@ def build(self):

def package(self):
self.copy("COPYING", src=os.path.join(self.build_folder, "sources", "mingw-w64"), dst="licenses")
tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la")
tools.remove_files_by_mask(os.path.join(self.package_folder, "x86_64-w64-mingw32", "lib"), "*.la")
tools.remove_files_by_mask(os.path.join(self.package_folder, "x86_64-w64-mingw32", "lib32"), "*.la")
tools.remove_files_by_mask(os.path.join(self.package_folder, "bin", "gcc", "x86_64-w64-mingw32", "10.3.0"), "*.la")
tools.remove_files_by_mask(self.package_folder, "*.la")
tools.rmdir(os.path.join(self.package_folder, "share", "man"))
tools.rmdir(os.path.join(self.package_folder, "share", "doc"))
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
# Remove symlinks, we need to create them in the package_info step
# replace with relative symlinks so they'll resolve correctly on consumer's machine
os.unlink(os.path.join(self.package_folder, 'mingw'))
os.unlink(os.path.join(self.package_folder, self._target_tag, 'lib64'))
self.run("ln -s {} {}".format(os.path.join(os.curdir, self._target_tag),
os.path.join(self.package_folder, 'mingw')))
self.run("ln -s {} {}".format(os.path.join(os.curdir, 'lib'),
os.path.join(self.package_folder, self._target_tag, 'lib64')))
Comment on lines +270 to +273
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using tools.fix_symlinks() ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just in case, calling os.symlink should be more portable than ln -s command line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tools.fix_symlinks() doesn't work:

ERROR: The file is a broken symlink, verify that you are packaging the needed destination files: '/home/conan/.conan/data/mingw-w64/8.0.2/_/_/package/4cfe33ba23f3b0106f09220780349c6834f3da6e/lib/libcc1.so.0'.You can skip this check adjusting the 'general.skip_broken_symlinks_check' at the conan.conf file.

the link is generated relative to the package folder and not the link itself:

ls -l /home/conan/.conan/data/mingw-w64/8.0.2/_/_/package/4cfe33ba23f3b0106f09220780349c6834f3da6e/lib/libcc1.so.0
lrwxrwxrwx 1 conan 1001 19 Feb  7 08:24 /home/conan/.conan/data/mingw-w64/8.0.2/_/_/package/4cfe33ba23f3b0106f09220780349c6834f3da6e/lib/libcc1.so.0 -> lib/libcc1.so.0.0.0


def package_info(self):
if getattr(self, "settings_target", None):
Expand Down Expand Up @@ -307,10 +311,4 @@ def package_info(self):
self.env_info.STRIP = prefix + "strip"
self.env_info.GCOV = prefix + "gcov"
self.env_info.RC = prefix + "windres"
# Symlinks cannot be created in package step, otherwise the link target is wrong.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait the old comment said this was not possible 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not possible because the links were absolute.
To your question above, it does work consuming from an Artifactory server.

if not os.path.exists(os.path.join(self.package_folder, 'mingw')):
self.run("ln -s {} {}".format(os.path.join(self.package_folder, self._target_tag),
os.path.join(self.package_folder, 'mingw')))
if not os.path.exists(os.path.join(self.package_folder, self._target_tag, 'lib64')):
self.run("ln -s {} {}".format(os.path.join(self.package_folder, self._target_tag, 'lib'),
os.path.join(self.package_folder, self._target_tag, 'lib64')))
self.env_info.DLLTOOL = prefix + "dlltool"