#!/bin/env python -B import os import sipconfig from PyQt6 import QtCore # sip_inc_fedora = "/usr/share/python3-sip/PyQt5" # sip_inc_debian = "/usr/share/sip/PyQt5" sip_inc_archlinux = "/usr/lib/python3.10/site-packages/PyQt6/bindings" basename = "highlight" # The name of the SIP build file generated by SIP and used by the build system. build_file = basename + ".sbf" # Get the SIP configuration information. config = sipconfig.Configuration() # print ("sip_flags", QtCore.PYQT_CONFIGURATION["sip_flags"]) # Run SIP to generate the code. os.system(" ".join([config.sip_bin, "-c", ".", "-b", build_file, # "-I" + sip_inc_fedora, # "-I" + sip_inc_debian, "-I" + sip_inc_archlinux, QtCore.PYQT_CONFIGURATION["sip_flags"], basename + ".sip"])) # Create the Makefile. makefile = sipconfig.SIPModuleMakefile(config, build_file) makefile.extra_include_dirs = [ "/usr/include/qt6", "/usr/include/qt6/QtCore", "/usr/include/qt6/QtGui", "/usr/include/qt6/QtWidgets", "/usr/include/qt6/QtDesigner" ] makefile.extra_libs = ["Qt6Widgets", "Qt6Gui", "Qt6Core", "Qt6Designer", "Qt6DesignerComponents" ] # cflags = os.popen ("pkg-config Qt6Widgets --cflags").read() # libs = os.popen ("pkg-config Qt6Widgets --libs").read() # makefile.extra_cxxflags = cflags.split () # makefile.extra_lflags = libs.split () # makefile.extra_libs = [ "highlight" ] # Generate the Makefile itself. makefile.generate() # https://github.com/zanton/hello-sip-pyqt5