changeset 239:cae61340cc86

configure: check pkg-config for qt
author Paper <paper@paper.us.eu.org>
date Fri, 19 Jan 2024 12:29:53 -0500
parents d2b7e974221e
children 6ffe42286978
files .builds/linux.yml .builds/windows.yml configure.ac
diffstat 3 files changed, 33 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/.builds/linux.yml	Fri Jan 19 11:17:42 2024 -0500
+++ b/.builds/linux.yml	Fri Jan 19 12:29:53 2024 -0500
@@ -29,7 +29,7 @@
 
       # resources
       mkdir -p rc
-      cp ../rc/Minori.desktop rc/Minori.desktop
+      cp ../rc/linux/Minori.desktop rc/Minori.desktop
       cp ../rc/favicon256.png rc/Minori.png
 
       # use linuxdeploy to make an appimage
--- a/.builds/windows.yml	Fri Jan 19 11:17:42 2024 -0500
+++ b/.builds/windows.yml	Fri Jan 19 12:29:53 2024 -0500
@@ -17,30 +17,43 @@
 sources:
   - https://hg.sr.ht/~mrpapersonic/minori
 tasks:
+  - get-wine: |
+      sudo dpkg --add-architecture i386
+
+      sudo mkdir -pm755 /etc/apt/keyrings
+      sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
+
+      sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
+
+      sudo apt update
+
+      sudo apt install -y --install-recommends winehq-devel
   - autoreconf: |
       cd minori
       autoreconf -i
-  - build-win64: |
+  - install-win64-deps: |
       export WINEARCH=win64
       git clone https://github.com/holyblackcat/quasi-msys2 quasi-msys2-win64
       cd quasi-msys2-win64
       echo MINGW64 >msystem.txt
       make install _gcc _qt5-base _qt5-tools _curl
-      mkdir -p ../minori/build64
-      cd ../minori/build64
+      sudo ln -nfs $(realpath ./root/mingw64) /mingw64
+  - build-win64: |
+      export WINEARCH=win64
+      mkdir -p minori/build64
+      cd minori/build64
       sudo bash -c 'echo -n 1 >/proc/sys/fs/binfmt_misc/status'
       bash -c 'source ../../quasi-msys2-win64/env/all.src && ../configure && make'
-  - get-wine32: |
-      sudo dpkg --add-architecture i386
-      sudo apt-get update
-      sudo apt-get -y install wine32:i386
-  - build-win32: |
+  - install-win32-deps: |
       export WINEARCH=win32
       export WINEPREFIX="$HOME/.wine32"
       git clone https://github.com/holyblackcat/quasi-msys2 quasi-msys2-win32
       cd quasi-msys2-win32
       echo MINGW32 >msystem.txt
       make install _gcc _qt5-base _qt5-tools _curl
+  - build-win32: |
+      export WINEARCH=win32
+      export WINEPREFIX="$HOME/.wine32"
       mkdir -p ../minori/build32
       cd ../minori/build32
       sudo bash -c 'echo -n 1 >/proc/sys/fs/binfmt_misc/status'
--- a/configure.ac	Fri Jan 19 11:17:42 2024 -0500
+++ b/configure.ac	Fri Jan 19 12:29:53 2024 -0500
@@ -18,11 +18,21 @@
 AM_PROG_AR
 LT_INIT
 
+have_qt=no
 # Qt?
 AX_HAVE_QT
 
 if test "x$have_qt" = "xno"; then
-	AC_MSG_ERROR([*** Qt not found.])
+	PKG_CHECK_MODULES([QT], [Qt6Widgets >= 6.0.0], [have_qt=yes], [])
+	# prioritize qt 5
+	PKG_CHECK_MODULES([QT], [Qt5Widgets >= 5.15.0], [have_qt=yes], [])
+
+	if test "x$have_qt" = "xno"; then
+		AC_MSG_ERROR([*** Qt not found.])
+	fi
+
+	QT_CXXFLAGS=$QT_CFLAGS
+	AC_SUBST([QT_CXXFLAGS])
 fi
 
 # need this for moc