Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
clarify the rolling release status
Browse files Browse the repository at this point in the history
  • Loading branch information
ericLemanissier committed Apr 26, 2021
1 parent 264594b commit d64c37e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 73 deletions.
7 changes: 7 additions & 0 deletions recipes/msys2/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ sources:
"https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20210105.tar.xz",
]
sha256: "982e54de087d53adfc6a8caf7614d4a7add36dd02dcb0b7838060dd893e9f596"
"cci.latest":
"x86_64":
url: [
"http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20210105.tar.xz",
"https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20210105.tar.xz",
]
sha256: "982e54de087d53adfc6a8caf7614d4a7add36dd02dcb0b7838060dd893e9f596"
71 changes: 3 additions & 68 deletions recipes/msys2/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,71 +60,13 @@ class MSYS2Conan(ConanFile):
def validate(self):
if self.settings.os != "Windows":
raise ConanInvalidConfiguration("Only Windows supported")
if tools.Version(self.version) >= "20210105" and self.settings.arch != "x86_64":
if self.settings.arch != "x86_64":
raise ConanInvalidConfiguration("Only Windows x64 supported")
if tools.Version(self.version) <= "20161025":
raise ConanInvalidConfiguration("msys2 v.20161025 is no longer supported")

@property
def _keyring_subfolder(self):
return os.path.join(self.package_folder, "bin", "keyring")

@property
def _keyring_file(self):
return os.path.join(self._keyring_subfolder, "msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz")

@property
def _keyring_sig(self):
return os.path.join(self._keyring_subfolder, "msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig")

# download the new keyring
# https://www.msys2.org/news/#2020-06-29-new-packagers
def _download_keyring(self):
tools.download( "http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz",
self._keyring_file,
sha256="f1cc152902fd6018868b64d015cab9bf547ff9789d8bd7c0d798fb2b22367b2b" )
tools.download( "http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig",
self._keyring_sig,
sha256="bbd22e88f33c81c40b145c34d8027d60f714d4fd1d0dccd456895f398cc56297" )

def _install_pacman_keyring(self):
with tools.chdir(os.path.join(self._msys_dir, "usr", "bin")):
self.run('bash -l -c "pacman-key --init;pacman-key --populate"')
verify_command = 'bash -l -c "pacman-key --verify %s"' % self._keyring_sig.replace("\\", "/")
self.run(verify_command)

install_command = 'bash -l -c "pacman -U %s --noconfirm"' % self._keyring_file.replace("\\", "/")
self.run(install_command)
self._kill_pacman()

def _update_very_old_pacman(self):
if (tools.Version(self.version) < "20200517"):
# Fix (https://github.com/msys2/MSYS2-packages/issues/1967)
# install zstd and pacman manually
pacman_packages_x64=["http://repo.msys2.org/msys/x86_64/libzstd-1.4.4-2-x86_64.pkg.tar.xz",
"http://repo.msys2.org/msys/x86_64/zstd-1.4.4-2-x86_64.pkg.tar.xz",
"http://repo.msys2.org/msys/x86_64/pacman-5.2.1-6-x86_64.pkg.tar.xz"]

if (self.settings.arch == "x86_64"):
for i in pacman_packages_x64:
self.run('bash -l -c "pacman --noconfirm -U %s"' % i)

pacman_packages_x32=["http://repo.msys2.org/msys/i686/libzstd-1.4.4-2-i686.pkg.tar.xz",
"http://repo.msys2.org/msys/i686/zstd-1.4.4-2-i686.pkg.tar.xz",
"http://repo.msys2.org/msys/i686/pacman-5.2.1-6-i686.pkg.tar.xz"]

if (self.settings.arch == "x86"):
for i in pacman_packages_x32:
self.run('bash -l -c "pacman --noconfirm -U %s"' % i)

self._kill_pacman()


def _update_pacman(self):
with tools.chdir(os.path.join(self._msys_dir, "usr", "bin")):
try:
self._update_very_old_pacman()

self._kill_pacman()
# https://www.msys2.org/news/ see 2020-05-31 - Update may fail with "could not open file"
# update pacman separately first
Expand Down Expand Up @@ -168,21 +110,17 @@ def _kill_pacman(self):

@property
def _msys_dir(self):
subdir = "msys64" if (tools.Version(self.version) >= "20210105" or self.settings.arch == "x86_64") else "msys32"
subdir = "msys64"
return os.path.join(self.package_folder, "bin", subdir)

def source(self):
# sources are different per configuration - do download in build
pass

def _do_source(self):
tools.get(**self.conan_data["sources"][self.version][str(self.settings.arch)])
self._download_keyring()

def build(self):
os.makedirs(os.path.join(self.package_folder, "bin"))
with tools.chdir(os.path.join(self.package_folder, "bin")):
self._do_source()
tools.get(**self.conan_data["sources"][self.version][str(self.settings.arch)])
with lock():
self._do_build()

Expand All @@ -193,9 +131,6 @@ def _do_build(self):
if self.options.additional_packages:
packages.extend(str(self.options.additional_packages).split(","))

if (tools.Version(self.version) < "20210105"):
self._install_pacman_keyring()

self._update_pacman()

with tools.chdir(os.path.join(self._msys_dir, "usr", "bin")):
Expand Down
6 changes: 1 addition & 5 deletions recipes/msys2/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
versions:
"20190524":
folder: "all"
"20200517":
folder: "all"
"20210105":
"cci.latest":
folder: "all"

0 comments on commit d64c37e

Please sign in to comment.