xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #678: PKGBUILD

File PKGBUILD, 3.7 KB (added by Antoine Martin, 4 years ago)

modified build file for python-gobject2 with the gio-types patch

Line 
1# Maintainer: Alexey Pavlov <alexpux@gmail.com>
2
3_realname=pygobject
4pkgbase=mingw-w64-${_realname}
5pkgname=("${MINGW_PACKAGE_PREFIX}-python2-gobject2" "${MINGW_PACKAGE_PREFIX}-python3-gobject2" "${MINGW_PACKAGE_PREFIX}-pygobject2-devel")
6pkgver=2.28.6
7pkgrel=4
8pkgdesc="Allows you to load glade interface files in a program at runtime (mingw-w64)"
9arch=(any)
10url="http://www.pygtk.org"
11license=('LGPL')
12makedepends=("${MINGW_PACKAGE_PREFIX}-python2" "${MINGW_PACKAGE_PREFIX}-python3" "${MINGW_PACKAGE_PREFIX}-gobject-introspection" "${MINGW_PACKAGE_PREFIX}-gnome-common")
13options=('staticlibs' 'strip')
14source=(https://download.gnome.org/sources/pygobject/${pkgver%.*}/${_realname}-${pkgver}.tar.xz
15        win32-fix.patch
16        python-m4.patch
17                gio-types.patch)
18sha256sums=('fb8a1d4f665130a125011659bd347c7339c944232163dbb9a34fd0686577adb8'
19            '9917129ed8e6271733ff5ebd4149141216262f1df71e9e77bb3c8fc19b4676ab'
20            'f409c43d8f4a2c8a486448bb75674f3b2bd1fdf58bb03a72a8427bcf5bda8e36'
21                        '34607855e41e07ae203017e3c2e7e9a96a82bc39ea9963f27e037ef71afc9183')
22
23prepare() {
24  cd "${srcdir}/${_realname}-${pkgver}"
25  patch -p1 -i ${srcdir}/win32-fix.patch
26  patch -p1 -i ${srcdir}/python-m4.patch
27  patch -p1 -i ${srcdir}/gio-types.patch
28  WANT_AUTOMAKE=latest autoreconf -fi
29}
30
31build() {
32  rm -rf python{2,3}-build
33  mkdir python{2,3}-build devel
34  CFLAGS+=" -Wno-error=format"
35
36  for builddir in python{2,3}-build; do
37    pushd ${builddir} > /dev/null
38      PYTHON=${MINGW_PREFIX}/bin/${builddir%-build} \
39      ../${_realname}-${pkgver}/configure \
40        --prefix=${MINGW_PREFIX} \
41        --build=${MINGW_CHOST} \
42        --host=${MINGW_CHOST} \
43        --target=${MINGW_CHOST} \
44        --disable-silent-rules \
45        --disable-introspection
46      make VERBOSE=1
47    popd > /dev/null
48  done
49}
50
51
52package_python2-gobject2() {
53  pkgdesc="Python 2 bindings for GObject2 (mingw-w64)"
54  depends=("${MINGW_PACKAGE_PREFIX}-glib2"
55           "${MINGW_PACKAGE_PREFIX}-libffi"
56           "${MINGW_PACKAGE_PREFIX}-gobject-introspection-runtime"
57           "${MINGW_PACKAGE_PREFIX}-pygobject2-devel=${pkgver}")
58
59  cd python2-build
60  make DESTDIR="${pkgdir}" install
61
62  find "${pkgdir}${MINGW_PREFIX}"/share/pygobject -name '*.py' -exec \
63  sed -i '1s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|' {} +
64
65  rm -r "${pkgdir}${MINGW_PREFIX}"/share/gtk-doc
66
67  # Split devel stuff
68  cd ${srcdir}
69  mkdir -p devel${MINGW_PREFIX}/{bin,lib,share/pygobject}
70  mv "${pkgdir}${MINGW_PREFIX}"/bin/pygobject-codegen-2.0 devel${MINGW_PREFIX}/bin/
71  mv {"${pkgdir}",devel}${MINGW_PREFIX}/include
72  mv {"${pkgdir}",devel}${MINGW_PREFIX}/lib/pkgconfig
73  mv {"${pkgdir}",devel}${MINGW_PREFIX}/share/pygobject/xsl
74}
75
76package_python3-gobject2() {
77  pkgdesc="Python 3 bindings for GObject2 (mingw-w64)"
78  depends=("${MINGW_PACKAGE_PREFIX}-glib2"
79           "${MINGW_PACKAGE_PREFIX}-libffi"
80           "${MINGW_PACKAGE_PREFIX}-gobject-introspection-runtime"
81           "${MINGW_PACKAGE_PREFIX}-pygobject2-devel=${pkgver}")
82
83  cd python3-build
84  make DESTDIR="${pkgdir}" install
85
86  # Delete devel stuff
87  rm -f "${pkgdir}${MINGW_PREFIX}"/bin/pygobject-codegen-2.0
88  rm -r "${pkgdir}${MINGW_PREFIX}"/{include,lib/pkgconfig,share/{gtk-doc,pygobject}}
89}
90
91package_pygobject2-devel() {
92  pkgdesc="Development files for the pygobject bindings"
93
94  mv ${srcdir}/devel${MINGW_PREFIX} "${pkgdir}/"
95}
96
97package_mingw-w64-i686-pygobject2-devel() {
98  package_pygobject2-devel
99}
100
101package_mingw-w64-x86_64-pygobject2-devel() {
102  package_pygobject2-devel
103}
104
105package_mingw-w64-i686-python2-gobject2() {
106  package_python2-gobject2
107}
108
109package_mingw-w64-i686-python3-gobject2() {
110  package_python3-gobject2
111}
112
113package_mingw-w64-x86_64-python2-gobject2() {
114  package_python2-gobject2
115}
116
117package_mingw-w64-x86_64-python3-gobject2() {
118  package_python3-gobject2
119}