Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wrapper generation to CI builds #86

Merged
merged 2 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
runs-on: [ubuntu-latest]
docker-image: [gcc7, gcc11, centos7]
docker-image: [centos7, ubuntu2004, ubuntu2204]

steps:
- uses: actions/checkout@v3
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/dockerfiles/Dockerfile_centos7
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ RUN yum install -y \
qt5-qtbase-* \
qt5-qttools* \
qt5-qtsvg \
qt5-qtsvg-devel \
qt5-qtxmlpatterns \
qt5-qtxmlpatterns-devel \
qt5-qtmultimedia \
qt5-qtmultimedia-devel \
qt5-qt3d \
qt5-qt3d-devel
qt5-*-devel

RUN mkdir -p work

Expand All @@ -25,8 +22,21 @@ WORKDIR work
ARG QT_SELECT=qt5
RUN uname -a; gcc --version | grep "gcc"; python --version; qmake-qt5 --version

CMD ["make"]

# 1. build PythonQt and the generator

RUN qmake-qt5 -r PythonQt.pro \
PYTHON_VERSION=$(python --version | cut -d " " -f 2 | cut -d "." -f1,2) \
PYTHON_DIR=$(which python | xargs dirname | xargs dirname)
RUN make

CMD ["make"]
# 2. generate wrappers using the built generator

# workaround to allow to find the Qt include dirs for installed standard qt packages
RUN mkdir /usr/include/qt5ln; ln -s /usr/include/qt5 /usr/include/qt5ln/include

RUN echo "export QTDIR=/usr/include/qt5ln" > generate.sh
RUN echo "cd generator; ./pythonqt_generator" >> generate.sh

CMD ["bash", "generate.sh"]
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM gcc:7
FROM ubuntu:20.04

RUN apt-get update && apt-get install -y --force-yes \
RUN apt-get update

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes \
build-essential \
python3 \
python3-dev \
libpython3-dev \
qtbase5-dev \
qtbase5-private-dev \
qtchooser \
qt5-qmake \
qtbase5-dev-tools \
qttools5-dev \
Expand All @@ -29,8 +31,19 @@ WORKDIR work
ARG QT_SELECT=qt5
RUN uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version

# 1. build PythonQt and the generator

RUN qmake -r PythonQt.pro \
PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \
PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname)
PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname)
RUN make

# 2. generate wrappers using the built generator

# workaround to allow to find the Qt include dirs for installed standard qt packages
RUN mkdir /usr/include/qt5; ln -s /usr/include/x86_64-linux-gnu/qt5 /usr/include/qt5/include

RUN echo "export QTDIR=/usr/include/qt5" > generate.sh
RUN echo "cd generator; ./pythonqt_generator" >> generate.sh

CMD ["make"]
CMD ["bash", "generate.sh"]
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM gcc:11
FROM ubuntu:22.04

RUN apt-get update && apt-get install -y --force-yes \
RUN apt-get update

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes \
build-essential \
python3 \
python3-dev \
libpython3-dev \
qtbase5-dev \
qtbase5-private-dev \
qtchooser \
qt5-qmake \
qtbase5-dev-tools \
qttools5-dev \
Expand All @@ -29,8 +31,19 @@ WORKDIR work
ARG QT_SELECT=qt5
RUN uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version

# 1. build PythonQt and the generator

RUN qmake -r PythonQt.pro \
PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \
PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname)
RUN make

# 2. generate wrappers using the built generator

# workaround to allow to find the Qt include dirs for installed standard qt packages
RUN mkdir /usr/include/qt5; ln -s /usr/include/x86_64-linux-gnu/qt5 /usr/include/qt5/include

RUN echo "export QTDIR=/usr/include/qt5" > generate.sh
RUN echo "cd generator; ./pythonqt_generator" >> generate.sh

CMD ["make"]
CMD ["bash", "generate.sh"]
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion src/PythonQt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@

#include <QDir>

#include <pydebug.h>
#include <vector>

PythonQt* PythonQt::_self = nullptr;
Expand Down