Merge pull request #8083 from lazka/mingw-arch-var
CI: read mingw_arch array to decide which builds the PKGBUILD supports
This commit is contained in:
@@ -28,6 +28,7 @@ import shutil
|
||||
from collections import OrderedDict
|
||||
import hashlib
|
||||
import time
|
||||
import shlex
|
||||
import subprocess
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
@@ -89,6 +90,21 @@ def get_cache_key(pkgbuild_path: str) -> str:
|
||||
return h.hexdigest()
|
||||
|
||||
|
||||
def get_mingw_arch_list(pkgbuild_path: str) -> List[str]:
|
||||
bash = shutil.which("bash")
|
||||
assert bash is not None
|
||||
sub_commands = [
|
||||
shlex.join(['source', pkgbuild_path]),
|
||||
'echo -n "${mingw_arch[@]}"'
|
||||
]
|
||||
out = subprocess.check_output([bash, '-c', ';'.join(sub_commands)], universal_newlines=True)
|
||||
arch_list = out.strip().split()
|
||||
if not arch_list:
|
||||
arch_list = ["mingw32", "mingw64"]
|
||||
assert arch_list
|
||||
return arch_list
|
||||
|
||||
|
||||
def get_srcinfo_for_pkgbuild(args: Tuple[str, str]) -> Optional[CacheTuple]:
|
||||
pkgbuild_path, mode = args
|
||||
pkgbuild_path = os.path.abspath(pkgbuild_path)
|
||||
@@ -106,7 +122,7 @@ def get_srcinfo_for_pkgbuild(args: Tuple[str, str]) -> Optional[CacheTuple]:
|
||||
srcinfos = {}
|
||||
|
||||
if mode == "mingw":
|
||||
for name in ["mingw32", "mingw64"]:
|
||||
for name in get_mingw_arch_list(pkgbuild_path):
|
||||
env = os.environ.copy()
|
||||
env["MINGW_INSTALLS"] = name
|
||||
srcinfos[name] = subprocess.check_output(
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
# Maintainer: Peter Budai <peterbud@hotmail.com>
|
||||
|
||||
# XXX: skip 32bit build, no longer supported upstream
|
||||
[[ $MINGW_CHOST = "i686-w64-mingw32" ]] && exit 0;
|
||||
|
||||
_realname=darktable
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
|
||||
pkgver=3.4.1
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="darktable is an open source photography workflow application and raw developer (mingw-w64)"
|
||||
arch=('any')
|
||||
mingw_arch=('mingw64')
|
||||
url='https://www.darktable.org'
|
||||
license=('GPL3')
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
|
||||
|
||||
Reference in New Issue
Block a user