diff --git a/.gitignore b/.gitignore index 88a4ebbb..78b7af9e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,6 @@ container-build-cache/ # local genbindings configuration cmd/genbindings/genbindings.local* -# local pkg-config configuration -pkg-config/*.pc - # binaries *.exe diff --git a/README.md b/README.md index 88d35c91..1132e8c3 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ MIQT has a custom implementation of Qt `uic` and `rcc` tools, to allow using [Qt MIQT uses `pkg-config` to find all used Qt libraries. Every Qt library should have a definition file in `.pc` format, which provides CGO with the necessary `CXXFLAGS`/`LDFLAGS`. Your Qt development environment already included the necessary `.pc` definition files. -You can use the `PKG_CONFIG_PATH` environment variable to override where CGO looks for `.pc` files. [Read more »](pkg-config/README.md) +You can use the `PKG_CONFIG_PATH` environment variable to override where CGO looks for `.pc` files. [Read more »](doc/pkg-config.md) ### Q8. How can I upgrade a MIQT app from Qt 5 to Qt 6? diff --git a/cmd/genbindings/README.md b/cmd/genbindings/README.md index 5ea63b63..d7c6adc3 100644 --- a/cmd/genbindings/README.md +++ b/cmd/genbindings/README.md @@ -38,7 +38,7 @@ You should check the following configuration: 1. Git clone this repository 2. In `docker/genbindings.Dockerfile`, add your library's headers and pkg-config file. - - If your library does not include a pkg-config file, [you must create one.](pkg-config/README.md) + - If your library does not include a pkg-config file, [you must create one.](../../doc/pkg-config.md) 3. Patch `cmd/genbindings/config-libraries.go` to add a new `generate` block for your target library 4. Run `genbindings` to regenerate all bindings - The first run must populate clang ASTs into a cache directory and may be slower, but it is fast afterwards diff --git a/pkg-config/README.md b/doc/pkg-config.md similarity index 67% rename from pkg-config/README.md rename to doc/pkg-config.md index e26e0317..3e69f662 100644 --- a/pkg-config/README.md +++ b/doc/pkg-config.md @@ -8,6 +8,7 @@ To specify the CFLAGS/CXXFLAGS and LDFLAGS for a specific library, make a `MyLib ```pkgconfig Name: My Library +Requires: Qt6Widgets Libs: -lfoo Cflags: -I/path/ ``` @@ -16,6 +17,8 @@ Then run `PKG_CONFIG_PATH=/path/to/dir/ go build` so CGO will find your library. The `PKG_CONFIG_PATH` environment variable is understood both by CGO and by genbindings. +When running genbindings in the docker/genbindings container, custom pkg-config files are created inline in the Dockerfile. + ## Further reading - [Guide to pkg-config](https://people.freedesktop.org/~dbn/pkg-config-guide.html) @@ -25,3 +28,23 @@ The `PKG_CONFIG_PATH` environment variable is understood both by CGO and by genb $ pkg-config --variable pc_path pkg-config /usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ``` + +List all available packages known to pkg-config: + +```bash +pkg-config --list-all +``` + +A full example for QScintilla (Qt 5) from the [genbindings.Dockerfile](../docker/genbindings.Dockerfile): + +```pkg-config +includedir=/usr/include/x86_64-linux-gnu/qt5/Qsci/ + +Name: QScintilla +Description: Qt5 port of the Scintilla source code editing widget +URL: http://www.riverbankcomputing.co.uk/software/qscintilla +Version: 2.13.3 +Requires: Qt5Widgets, Qt5PrintSupport +Libs: -lqscintilla2_qt5 +Cflags: -I${includedir} +``` diff --git a/pkg-config/QScintilla.pc.example b/pkg-config/QScintilla.pc.example deleted file mode 100644 index fc740710..00000000 --- a/pkg-config/QScintilla.pc.example +++ /dev/null @@ -1,9 +0,0 @@ -includedir=/usr/include/x86_64-linux-gnu/qt5/Qsci/ - -Name: QScintilla -Description: Qt5 port of the Scintilla source code editing widget -URL: http://www.riverbankcomputing.co.uk/software/qscintilla -Version: 2.13.3 -Requires: Qt5Widgets, Qt5PrintSupport -Libs: -lqscintilla2_qt5 -Cflags: -I${includedir} diff --git a/pkg-config/QScintilla6.pc.example b/pkg-config/QScintilla6.pc.example deleted file mode 100644 index fd6f6af5..00000000 --- a/pkg-config/QScintilla6.pc.example +++ /dev/null @@ -1,9 +0,0 @@ -includedir=/usr/include/x86_64-linux-gnu/qt6/Qsci/ - -Name: QScintilla6 -Description: Qt6 port of the Scintilla source code editing widget -URL: http://www.riverbankcomputing.co.uk/software/qscintilla -Version: 2.13.3 -Requires: Qt6Widgets, Qt6PrintSupport -Libs: -lqscintilla2_qt6 -Cflags: -I${includedir} diff --git a/pkg-config/ScintillaEdit.pc.example b/pkg-config/ScintillaEdit.pc.example deleted file mode 100644 index 9146b64b..00000000 --- a/pkg-config/ScintillaEdit.pc.example +++ /dev/null @@ -1,9 +0,0 @@ -srcdir=/usr/local/src/scintilla/ - -Name: ScintillaEdit -Description: Scintilla's own upstream Qt port -URL: https://www.scintilla.org/ -Version: 5.5.2 -Requires: Qt5Widgets -Libs: -L${srcdir}/bin -lScintillaEdit -Cflags: -include stdint.h -I${srcdir}/qt/ScintillaEdit -I${srcdir}/qt/ScintillaEditBase -I${srcdir}/include -I${srcdir}/src