From 8a4a75cc59e7c1951deb58a5918ebe1b67a81881 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lu=C3=ADs=20Ferreira?= <lsferreira169@gmail.com>
Date: Tue, 5 Feb 2019 20:51:58 +0000
Subject: [PATCH] dub: fix detecting packages with different compilers and
 archs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix 'not founded' message for packages with another name for
specific configurations instead of just 'library'.

Signed-off-by: Luís Ferreira <lsferreira169@gmail.com>
---
 mesonbuild/dependencies/base.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 9da0d7c50..819612484 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -1674,9 +1674,9 @@ class DubDependency(ExternalDependency):
             return ''
 
         # Ex.: library-debug-linux.posix-x86_64-ldc_2081-EF934983A3319F8F8FF2F0E107A363BA
-        build_name = 'library-{}-{}-{}-{}_{}'.format(description['buildType'], '.'.join(description['platform']), '.'.join(description['architecture']), comp, d_ver)
+        build_name = '-{}-{}-{}-{}_{}'.format(description['buildType'], '.'.join(description['platform']), '.'.join(description['architecture']), comp, d_ver)
         for entry in os.listdir(module_build_path):
-            if entry.startswith(build_name):
+            if build_name in entry:
                 for file in os.listdir(os.path.join(module_build_path, entry)):
                     if file == lib_file_name:
                         if folder_only: