Skip to content

Commit

Permalink
Merge pull request #5037 from totaam/xpra
Browse files Browse the repository at this point in the history
add mingw-w64-python-xpra
  • Loading branch information
Alexpux authored Mar 13, 2019
2 parents 75ee79a + 4c6aa40 commit d6fe411
Showing 1 changed file with 177 additions and 0 deletions.
177 changes: 177 additions & 0 deletions mingw-w64-python-xpra/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Maintainer: Antoine Martin <[email protected]>

_realname=xpra
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-common"
"${MINGW_PACKAGE_PREFIX}-python2-${_realname}"
"${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=2.5rc2
pkgrel=1
pkgdesc="Remote access client / server software"
arch=('any')
url='https://xpra.org'
license=('GPL2')
depends=("${MINGW_PACKAGE_PREFIX}-ffmpeg"
"${MINGW_PACKAGE_PREFIX}-libyuv"
"${MINGW_PACKAGE_PREFIX}-libvpx"
"${MINGW_PACKAGE_PREFIX}-x264-git"
"${MINGW_PACKAGE_PREFIX}-libwebp"
"${MINGW_PACKAGE_PREFIX}-libjpeg-turbo")
optdepends=("${MINGW_PACKAGE_PREFIX}-libnotify: notification support"
"${MINGW_PACKAGE_PREFIX}-gst-plugins-bad: extra audio codecs"
"${MINGW_PACKAGE_PREFIX}-gst-plugins-ugly: extra audio codecs"
"${MINGW_PACKAGE_PREFIX}-gst-plugins-good: extra audio codecs"
"${MINGW_PACKAGE_PREFIX}-gst-python: audio support")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-pkg-config"
#python2 build deps:
"${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-cython2"
"${MINGW_PACKAGE_PREFIX}-pygobject2-devel"
"${MINGW_PACKAGE_PREFIX}-python2-pygtk"
#python3 build deps:
"${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-cython"
"${MINGW_PACKAGE_PREFIX}-gtk3"
"${MINGW_PACKAGE_PREFIX}-pygobject-devel"
"${MINGW_PACKAGE_PREFIX}-python3-cairo")
source=("https://xpra.org/src/xpra-${pkgver}.tar.xz")
sha512sums=('1a06a79fdcee8f4310ce8e6d31c9bfc23b384348b0c103a04683114d8f42ce03432556a62c0f9699219e8b3c8adfc4a7e4e741a3a0d249202c3ff9a4664ae902')

prepare() {
cd "${srcdir}"
for builddir in python{2,3}-build-${CARCH}; do
rm -rf ${builddir} | true
cp -r "${_realname}-${pkgver}" "${builddir}"
done
}

build() {
for pver in {2,3}; do
msg "Python ${pver} build for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
${MINGW_PREFIX}/bin/python${pver} setup.py build \
--without-cuda_kernels --without-data --without-html5 --with-modules
done
}

package_python3-xpra() {
depends+=("${MINGW_PACKAGE_PREFIX}-${_realname}-common"
"${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-gtk3"
"${MINGW_PACKAGE_PREFIX}-python3-lz4"
"${MINGW_PACKAGE_PREFIX}-python3-rencode"
"${MINGW_PACKAGE_PREFIX}-python3-pillow"
"${MINGW_PACKAGE_PREFIX}-python3-PyOpenGL"
"${MINGW_PACKAGE_PREFIX}-python3-comtypes"
"${MINGW_PACKAGE_PREFIX}-python3-setproctitle")
optdepends+=("${MINGW_PACKAGE_PREFIX}-python3-paramiko: SSH client and server support"
"${MINGW_PACKAGE_PREFIX}-python3-netifaces: mDNS and network integration"
"${MINGW_PACKAGE_PREFIX}-python3-pyu2f: U2F authentication"
"${MINGW_PACKAGE_PREFIX}-python3-ldap: LDAP authentication via python-ldap"
"${MINGW_PACKAGE_PREFIX}-python3-ldap3: LDAP authentication via python-ldap3"
"${MINGW_PACKAGE_PREFIX}-python3-cryptography: AES packet encryption"
"${MINGW_PACKAGE_PREFIX}-python3-zeroconf: mDNS support"
"${MINGW_PACKAGE_PREFIX}-python3-nvidia-ml: nvidia GPU support"
)


cd "${srcdir}/python3-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} \
--without-cuda_kernels --without-data --without-html5 --skip-build \
--root="${pkgdir}/${MINW_PREFIX}" --share-xpra="./share/xpra"

install -Dm644 COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/COPYING"
}

package_python2-xpra() {
depends+=("${MINGW_PACKAGE_PREFIX}-${_realname}-common"
"${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-pygtk"
"${MINGW_PACKAGE_PREFIX}-python2-gobject"
"${MINGW_PACKAGE_PREFIX}-python2-lz4"
"${MINGW_PACKAGE_PREFIX}-python2-rencode"
"${MINGW_PACKAGE_PREFIX}-python2-pillow"
"${MINGW_PACKAGE_PREFIX}-python2-PyOpenGL"
"${MINGW_PACKAGE_PREFIX}-python2-comtypes"
"${MINGW_PACKAGE_PREFIX}-python2-setproctitle"
"${MINGW_PACKAGE_PREFIX}-python2-zeroconf")
optdepends+=("${MINGW_PACKAGE_PREFIX}-python2-paramiko: SSH client and server support"
"${MINGW_PACKAGE_PREFIX}-python2-netifaces: mDNS and network integration"
"${MINGW_PACKAGE_PREFIX}-python2-pyu2f: U2F authentication"
"${MINGW_PACKAGE_PREFIX}-python2-ldap: LDAP authentication via python-ldap"
"${MINGW_PACKAGE_PREFIX}-python2-ldap3: LDAP authentication via python-ldap3"
"${MINGW_PACKAGE_PREFIX}-python2-cryptography: AES packet encryption"
"${MINGW_PACKAGE_PREFIX}-python2-nvidia-ml: nvidia GPU support"
)

cd "${srcdir}/python2-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \
--without-cuda_kernels --without-data --without-html5 --skip-build \
--root="${pkgdir}/${MINW_PREFIX}" --share-xpra="${pkgdir}/${MINGW_PREFIX}/share/xpra"

install -Dm644 COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/COPYING"
}

package_xpra-common() {
depends=()
optdepends=()
makedepends=("${MINGW_PACKAGE_PREFIX}-brotli")
cd "${srcdir}/${_realname}-${pkgver}"

${MINGW_PREFIX}/bin/python2 setup.py install --skip-build --minimal --with-data \
--home="${pkgdir}/${MINGW_PREFIX}" --root=""

SHARE_DIR="${pkgdir}${MINGW_PREFIX}/share"
APP_SHARE_DIR="${SHARE_DIR}/${_realname}"
install -Dm644 COPYING "${SHARE_DIR}/licenses/${_realname}/COPYING"
install -Dm644 README "${APP_SHARE_DIR}/README"
install -Dm644 bell.wav "${APP_SHARE_DIR}/bell.wav"

#for nvenc builds only:
#install -Dm644 dist/etc/${_realname}/*.keys "${APP_ETC}/"
#install -Dm644 dist/etc/${_realname}/cuda.conf "${APP_ETC}/${conffile}"

#python version agnostic launch scripts in /bin:
for script in xpra xpra_launcher; do
install -Dm755 scripts/${script} "${pkgdir}${MINGW_PREFIX}/bin/${script}"
done

#html5 client:
${MINGW_PREFIX}/bin/python2 ./setup_html5.py "${pkgdir}${MINGW_PREFIX}/share/${_realname}/www/"

#this is not a python installation package,
#so remove the python crud (all empty anyway):
rm ${pkgdir}/${MINGW_PREFIX}/lib/python/xpra*.egg-info
rmdir "${pkgdir}/${MINGW_PREFIX}/lib/python"
rmdir "${pkgdir}/${MINGW_PREFIX}/lib"
}


package_mingw-w64-i686-xpra-common() {
package_xpra-common
}

package_mingw-w64-i686-python2-xpra() {
package_python2-xpra
}

package_mingw-w64-i686-python3-xpra() {
package_python3-xpra
}

package_mingw-w64-x86_64-xpra-common() {
package_xpra-common
}

package_mingw-w64-x86_64-python2-xpra() {
package_python2-xpra
}

package_mingw-w64-x86_64-python3-xpra() {
package_python3-xpra
}

0 comments on commit d6fe411

Please sign in to comment.