Skip to content

Commit

Permalink
pyqt: move to SIP 5.x (lxqt#465)
Browse files Browse the repository at this point in the history
SIP 4.x is no longer supported [1].

And drop CMake integration for PyQt bindings - it's too messy for SIP
5.x

[1] https://www.riverbankcomputing.com/software/sip/download
  • Loading branch information
Chih-Hsuan Yen authored Mar 12, 2022
1 parent 495b549 commit dc01cef
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 554 deletions.
7 changes: 4 additions & 3 deletions .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ set -ex
source shared-ci/prepare-archlinux.sh

# See *depends in https://github.com/archlinuxcn/repo/blob/master/archlinuxcn/qtermwidget-git/PKGBUILD
pacman -S --noconfirm --needed git cmake lxqt-build-tools-git qt5-tools python-sip4 sip4
pacman -S --noconfirm --needed git cmake lxqt-build-tools-git qt5-tools python-pyqt5 pyqt-builder sip

# TODO: re-enable PyQt bindings after switching to sip5
cmake -B build -S . \
-DBUILD_EXAMPLE=ON \
-DQTERMWIDGET_BUILD_PYTHON_BINDING=OFF \
-DQTERMWIDGET_USE_UTEMPTER=ON
make -C build

cd pyqt
CXXFLAGS="-I$PWD/../lib -I$PWD/../build/lib" LDFLAGS="-L$PWD/../build" sip-wheel --verbose
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build
.kdev4
*.pyc
*.whl
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ option(USE_UTF8PROC "Use libutf8proc for better Unicode support. Default OFF" OF


# just change version for releases
# keep this in sync with the version in pyqt/pyproject.toml
set(QTERMWIDGET_VERSION_MAJOR "1")
set(QTERMWIDGET_VERSION_MINOR "0")
set(QTERMWIDGET_VERSION_PATCH "0")
Expand Down Expand Up @@ -316,7 +317,7 @@ endif()

# python binding
if (QTERMWIDGET_BUILD_PYTHON_BINDING)
add_subdirectory(pyqt)
message(SEND_ERROR "QTERMWIDGET_BUILD_PYTHON_BINDING is no longer supported. Check README.md for how to build PyQt bindings.")
endif()
# end of python binding

Expand Down
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,10 @@ Copyright: Author Adriaan de Groot <groot@kde.org>
2008, e_k <e_k@users.sourceforge.net>
License: LGPL-2+
Files: pyqt/cmake/*
Copyright: 2012, Luca Beltrame <lbeltrame@kde.org>
2012, Rolf Eike Beer <eike@sf-mail.de>
2007-2014, Simon Edwards <simon@simonzone.com>
License: BSD-3-clause
Files: cmake/FindUtf8Proc.cmake
Copyright: 2009-2011, Kitware, Inc
2009-2011, Philip Lowman <philip@yhbt.com>
License: BSD-3-clause
Files: pyqt/cmake/PythonCompile.py
License: public-domain
```

## Installation
Expand All @@ -62,7 +53,7 @@ Code configuration is handled by CMake. CMake variable `CMAKE_INSTALL_PREFIX` wi

To build, run `make`. To install, run `make install` which accepts variable `DESTDIR` as usual.

To build PyQt bindings, specify an additional CMake option `QTERMWIDGET_BUILD_PYTHON_BINDING=ON` when building this library.
To build PyQt bindings, build this library first, and then invoke `sip-wheel` in pyqt/ directory. Environment variables `CXXFLAGS` and `LDFLAGS` can be used to specify non-installed or non-standard directories for headers and shared libraries, and the built Python wheel can be installed by standard tools like `pip`. See [the CI script](.ci/build.sh) for a complete example.

### Binary packages

Expand Down
61 changes: 0 additions & 61 deletions pyqt/CMakeLists.txt

This file was deleted.

Empty file removed pyqt/__init__.py
Empty file.
22 changes: 0 additions & 22 deletions pyqt/cmake/COPYING-CMAKE-SCRIPTS

This file was deleted.

54 changes: 0 additions & 54 deletions pyqt/cmake/FindPyQt5.cmake

This file was deleted.

39 changes: 0 additions & 39 deletions pyqt/cmake/FindPyQt5.py

This file was deleted.

73 changes: 0 additions & 73 deletions pyqt/cmake/FindPythonLibrary.cmake

This file was deleted.

64 changes: 0 additions & 64 deletions pyqt/cmake/FindSIP.cmake

This file was deleted.

Loading

0 comments on commit dc01cef

Please sign in to comment.