From 562af72b8de38d5abc8e65f494de6a2e292b41bc Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 16 Oct 2020 16:08:15 +0200 Subject: [PATCH] meson: fix DLL prefix meson was creating cygXXX DLLs instead of msys-XXX DLLs. This extends the cygwin patch to fix that. --- meson/PKGBUILD | 4 ++-- meson/cygwin-disguise.patch | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/meson/PKGBUILD b/meson/PKGBUILD index 3b7d87b8..b1f7b1e2 100644 --- a/meson/PKGBUILD +++ b/meson/PKGBUILD @@ -2,7 +2,7 @@ pkgname=meson pkgver=0.55.3 -pkgrel=1 +pkgrel=2 pkgdesc='High-productivity build system' arch=('any') url="https://mesonbuild.com/" @@ -11,7 +11,7 @@ depends=('python' 'python-setuptools' 'ninja') source=("https://github.com/mesonbuild/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz" "cygwin-disguise.patch") sha256sums=('6bed2a25a128bbabe97cf40f63165ebe800e4fcb46db8ab7ef5c2b5789f092a5' - '94eccd752284a08811c41b2afd1801ccc0274affac7ada5356b413a8f0f43164') + '17842839cda27fbcd4e2a03b1ff660e6d46bf8d55985129273ac28a64efc2275') prepare() { cd "${srcdir}/${pkgname}-${pkgver}" diff --git a/meson/cygwin-disguise.patch b/meson/cygwin-disguise.patch index 056ceb16..59ae5915 100644 --- a/meson/cygwin-disguise.patch +++ b/meson/cygwin-disguise.patch @@ -61,3 +61,42 @@ index 84abfc33..59aabff0 100644 def run_with_mono(fname): if fname.endswith('.exe') and not (is_windows() or is_cygwin()): +diff --git a/mesonbuild/build.py b/mesonbuild/build.py +index be9763489..b7a5e0483 100644 +--- a/mesonbuild/build.py ++++ b/mesonbuild/build.py +@@ -1785,7 +1785,7 @@ class SharedLibrary(BuildTarget): + self.gcc_import_filename = '{0}{1}.dll.a'.format(self.prefix if self.prefix is not None else 'lib', self.name) + # Shared library is of the form cygfoo.dll + # (ld --dll-search-prefix=cyg is the default) +- prefix = 'cyg' ++ prefix = 'msys-' + # Import library is called libfoo.dll.a + self.import_filename = self.gcc_import_filename + if self.soversion: +diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py +index e146f5f62..9b787eae3 100644 +--- a/mesonbuild/compilers/mixins/clike.py ++++ b/mesonbuild/compilers/mixins/clike.py +@@ -1043,7 +1043,7 @@ class CLikeCompiler(Compiler): + stlibext += ['lib'] + elif env.machines[self.for_machine].is_cygwin(): + shlibext = ['dll', 'dll.a'] +- prefixes = ['cyg'] + prefixes ++ prefixes = ['msys-'] + prefixes + else: + # Linux/BSDs + shlibext = ['so'] +diff --git a/run_unittests.py b/run_unittests.py +index db61ca6b1..16ce7e960 100755 +--- a/run_unittests.py ++++ b/run_unittests.py +@@ -1887,6 +1887,8 @@ class BasePlatformTests(unittest.TestCase): + base = os.path.splitext(filename)[0] + if base.startswith(('lib', 'cyg')): + return base[3:] ++ if base.startswith('msys-'): ++ return base[5:] + return base + + def assertBuildRelinkedOnlyTarget(self, target):