qtwebapp: add pkg-config file

So that I can use it for more easy devendoring
This commit is contained in:
Ross Smyth
2026-06-02 18:09:00 -04:00
parent cdc94f6de7
commit 9fce930eb9
2 changed files with 47 additions and 2 deletions
+33 -2
View File
@@ -1,9 +1,10 @@
{
fetchFromGitHub,
stdenv,
testers,
validatePkgConfig,
lib,
qt6,
...
}:
stdenv.mkDerivation (finalAttrs: {
pname = "qtwebapp";
@@ -15,6 +16,8 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-RbFgz2ed1eEVy44LX+milP4hPSeiabakU3TMvHYR7TU=";
};
__structuredAttrs = true;
sourceRoot = "source/QtWebApp";
postPatch = ''
@@ -29,19 +32,47 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
qt6.qmake
qt6.wrapQtAppsHook
validatePkgConfig
];
buildInputs = [
propagatedBuildInputs = [
# For libs in the pkg-config, they must be
# propagated so that packages that depend on
# it can properly use it.
qt6.qtbase
qt6.qt5compat
];
qmakeFlags = [ "QtWebApp.pro" ];
pkgConfigFile = ./pkg-config.in;
postInstall = ''
mkdir -p "$out/lib/pkgconfig"
cp "$pkgConfigFile" "$out/lib/pkgconfig/QtWebApp.pc"
substituteInPlace "$out/lib/pkgconfig/QtWebApp.pc" \
--subst-var out \
--subst-var version
mkdir -p "$out/include/QtWebApp/httpserver"
cp httpserver/*.h "$out/include/QtWebApp/httpserver"
mkdir -p "$out/include/QtWebApp/logging"
cp logging/*.h "$out/include/QtWebApp/logging"
mkdir -p "$out/include/QtWebApp/templateengine"
cp templateengine/*.h "$out/include/QtWebApp/templateengine"
'';
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = {
maintainers = with lib.maintainers; [ xddxdd ];
description = "HTTP server library in C++, inspired by Java Servlets";
homepage = "https://stefanfrings.de/qtwebapp/index-en.html";
license = lib.licenses.lgpl3Plus;
pkgConfigModules = [
"QtWebApp"
];
};
})
+14
View File
@@ -0,0 +1,14 @@
prefix=@out@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir_http=${prefix}/include/QtWebApp/httpserver
includedir_logging=${prefix}/include/QtWebApp/logging
includedir_template=${prefix}/include/QtWebApp/templateengine
Name: QtWebApp
Description: HTTP server and utility library in C++
Version: @version@
Requires: Qt6Network Qt6Core5Compat
Libs: -L${libdir} -lQtWebApp
Cflags: -I${includedir_http} -I${includedir_logging} -I${includedir_template}