123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- # Maintainer (arch): Antonio Rojas <arojas@archlinux.org>
- # Maintainer (arch): Felix Yan <felixonmars@archlinux.org>
- # Maintainer: Parabola Hackers <dev@lists.parabola.nu>
- # Contributor: bill-auger <bill-auger@programmer.net>
- # parabola changes and rationale:
- # libre:
- # - remove 'qt6-webengine' dependency and recommendation
- # technical:
- # - add support for armv7h and i686
- # - build from versioned source-ball rather than VCS
- # - pin to strongly-coupled dependency versions
- pkgbase=pyside6
- pkgname=(pyside6
- pyside6-tools
- shiboken6)
- _qtver=6.8.0.1
- pkgver=${_qtver/-/}
- pkgrel=2
- _pkgver_i686=6.4.2
- _pkgrel_i686=5.0
- eval "[[ -v _pkgver_${CARCH} ]] && pkgver=\$_pkgver_${CARCH}" # our different arches do not
- eval "[[ -v _pkgrel_${CARCH} ]] && pkgrel=\$_pkgrel_${CARCH}" # always roll at the same speed
- _src_dir=pyside-setup-everywhere-src-${pkgver%\.*} # source-ball filename and inner dirname
- [[ "${CARCH}" != i686 ]] || _src_dir=pyside-setup-opensource-src-${pkgver}
- pkgrel+=.parabola1
- arch=(x86_64)
- arch+=(armv7h i686)
- url='https://www.qt.io'
- license=(LGPL)
- makedepends=(clang
- cmake
- git
- llvm
- ninja
- python-numpy
- python-setuptools
- qt6-3d
- qt6-charts
- qt6-connectivity
- qt6-datavis3d
- qt6-graphs
- qt6-httpserver
- qt6-location
- qt6-multimedia
- qt6-networkauth
- qt6-positioning
- qt6-quick3d
- qt6-remoteobjects
- qt6-scxml
- qt6-sensors
- qt6-serialbus
- qt6-serialport
- qt6-shadertools
- qt6-speech
- qt6-svg
- qt6-tools
- qt6-webchannel
- qt6-webengine
- qt6-websockets)
- makedepends=( ${makedepends[*]/git/} ) # build from source-ball
- makedepends=( ${makedepends[*]/qt6-webengine/} ) # blacklisted
- source=(git+https://code.qt.io/pyside/pyside-setup#tag=v$pkgver
- fix-build.patch)
- source[0]=https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-${pkgver}-src/${_src_dir}.tar.xz
- sha256sums=('7ae346f2d85f04c8828f2344c96cc211f342983d3ee81cc02923897a6b5c4940'
- '77b83cb164ea87d826259864f6a81fb33199510e1948d6daaf5c8d5ab55735a7')
- [[ "${CARCH}" != i686 ]] || sha256sums[0]='1ec9d0936332efd229650cf10fed36cadddff7a613a2ea6e897de4d504c1b505'
- _version_constraint() # (dep_pkgname [precision])
- {
- Log() { [[ "${FUNCNAME[2]}" == package ]] && echo "$@" >&2 || : ; }
- local dep_pkgname=$1
- declare -i req_precision=$2
- local full_version=$(pacman -S --print-format='%v' ${dep_pkgname} 2> /dev/null | tail -n 1)
- local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;)
- local def_precision=$(( n_dots + 1 ))
- local is_prec_valid=$(( req_precision > 0 && req_precision <= def_precision ))
- local precision=$((( is_prec_valid )) && echo ${req_precision} || echo ${def_precision})
- local epoch_rx='[0-9]+:'
- local pkgver_rx='[0-9A-Za-z_]+'
- pkgver_rx=$(sed 's|\]|\+]|' <<<${pkgver_rx}) # according to the wiki, '+' is not allowed,
- # but some pkgver have it (eg: 5.15.10+kde+r130)
- local subver_rx='\.'${pkgver_rx}
- local pkgrel_rx='[0-9]+'
- local garbage_rx='[^0-9].*'
- local capture_rx=${pkgver_rx}
- for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ;
- local epoch version pkgrel has_dot_char version_min version_max constraint_string
- declare -i subver subver_inc pkgrel_inc
- if [[ "${full_version}" =~ ^(${epoch_rx})*(${capture_rx})(${subver_rx})*-(${pkgrel_rx}).*$ ]]
- then epoch=${BASH_REMATCH[1]} # optional epoch
- version=${BASH_REMATCH[2]} # pkgver cut to the requested precision
- #unused=${BASH_REMATCH[3]} # discarded pkgver segments
- pkgrel=${BASH_REMATCH[4]} # pkgrel with non-numerics right-trimmed
- has_dot_char=$([[ "${version}" =~ \. ]] ; echo $(( ! $? )) ; )
- subver=$(sed "s|${garbage_rx}||" <<<${version##*.}) # right-trim from any non-numeric
- version=$( (( has_dot_char )) && echo ${version%.*}.${subver} || echo ${subver} )
- version=${epoch}${version}
- subver_inc=$(( subver + 1 ))
- pkgrel_inc=$(( pkgrel + 1 ))
- version_min=$( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel} || \
- echo ${version} )
- version_max=$( ( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel_inc} ) || \
- ( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} ) || \
- echo ${subver_inc} )
- constraint_string="${dep_pkgname}>=${version_min} ${dep_pkgname}<${version_max}"
- Log "Applied version constraint: '${constraint_string}'"
- else Log "ERROR: in _version_constraint() parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'"
- exit 1
- fi
- unset -f Log
- echo -n "${constraint_string}"
- }
- prepare() {
- # link source-ball root dir as VCS root dirname
- ln -fs ${_src_dir} pyside-setup
- [[ "${CARCH}" != i686 ]] || return 0
- cd pyside-setup
- patch -p1 < ../fix-build.patch
- }
- build() {
- CLANG_INSTALL_DIR="/usr" \
- cmake -B build -S pyside-setup -G Ninja \
- -DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_BUILD_TYPE=None \
- -DSHIBOKEN_PYTHON_LIBRARIES=`pkgconf python3-embed --libs` \
- -DBUILD_TESTS=OFF \
- -DFORCE_LIMITED_API=no \
- -DNO_QT_TOOLS=yes
- PYTHONPATH="$PWD"/build/sources \
- cmake --build build
- }
- package_shiboken6() {
- pkgdesc='Generates bindings for C++ libraries using CPython source code'
- depends=(clang
- gcc-libs
- glibc
- libxml2
- libxslt
- llvm
- python
- qt6-base)
- depends+=( $(_version_constraint python 2) ) # per FORCE_LIMITED_API=no
- depends+=( $(_version_constraint clang 3) ) # TODO: needed? , too precise?
- optdepends=('python: Python bindings')
- DESTDIR="$pkgdir" cmake --install build/sources/shiboken6
- # Install egg-info
- export PATH="/usr/lib/qt6/bin:$PATH"
- cd pyside-setup
- python setup.py egg_info --build-type=shiboken6
- python setup.py egg_info --build-type=shiboken6-generator
- _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
- cp -r shiboken6*.egg-info "$pkgdir"/$_pythonpath
- }
- package_pyside6() {
- pkgdesc='Enables the use of Qt6 APIs in Python applications'
- depends=(gcc-libs
- glibc
- python
- qt6-base
- qt6-declarative
- shiboken6)
- optdepends=('qt6-3d: Qt3D bindings'
- 'qt6-charts: QtCharts bindings'
- 'qt6-connectivity: QtBluetooth and QtNfc bindings'
- 'qt6-datavis3d: QtDataVisualization bindings'
- 'qt6-graphs: QtGraphs bindings'
- 'qt6-httpserver: QtHttpServer bindings'
- 'qt6-location: QtLocation bindings'
- 'qt6-multimedia: QtMultimedia bindings'
- 'qt6-networkauth: QtNetworkAuth bindings'
- 'qt6-positioning: QtPositioning bindings'
- 'qt6-quick3d: QtQuick3D bindings'
- 'qt6-remoteobjects: QtRemoteObjects bindings'
- 'qt6-scxml: QtScxml bindings'
- 'qt6-sensors: QtSensors bindings'
- 'qt6-serialbus: QtSerialBus bindings'
- 'qt6-serialport: QtSerialPort bindings'
- 'qt6-speech: QtTextToSpeech bindings'
- 'qt6-svg: QtSvg bindings'
- 'qt6-tools: QtHelp, QtUiTools bindings'
- 'qt6-webchannel: QtWebChannel bindings'
- #'qt6-webengine: QtWebEngine bindings'
- 'qt6-websockets: QtWebSockets bindings')
- provides=(qt6-python-bindings)
- DESTDIR="$pkgdir" cmake --install build/sources/pyside6
- # Install egg-info
- export PATH="/usr/lib/qt6/bin:$PATH"
- cd pyside-setup
- python setup.py egg_info --build-type=pyside6
- _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
- cp -r PySide6.egg-info "$pkgdir"/$_pythonpath
- }
- package_pyside6-tools() {
- pkgdesc='Tools for pyside6'
- depends=(pyside6
- python)
- optdepends=('nuitka: for deploy.py')
- DESTDIR="$pkgdir" cmake --install build/sources/pyside-tools
- # Add convenience pyside6-designer wrapper
- # Entry points in /usr/bin are not installed in the cmake build. This is the only one that does anything besides wrapping the Qt executable
- echo "export LD_PRELOAD="`python -c "from sysconfig import get_config_var; print(get_config_var('LDLIBRARY'))"` > pyside6-designer
- echo "exec designer6 \$@" >> pyside6-designer
- install -Dm755 pyside6-designer -t "$pkgdir"/usr/bin
- }
|