Skip to content

Instantly share code, notes, and snippets.

@Artoria2e5
Last active February 19, 2016 21:23
Show Gist options
  • Save Artoria2e5/9852ec41a17adf45d042 to your computer and use it in GitHub Desktop.
Save Artoria2e5/9852ec41a17adf45d042 to your computer and use it in GitHub Desktop.
wx, gtk, and ~~perhaps~~ certainly more

I don't know if it works. Perhaps I should try Hyper-V'ing ArchLinux?

  • We should use the big full wxWidget tarball
  • We should make everything in one PKGBUILD, so qt, gtk2/3, xft...
  • fill in the blanks
    • some makedepends
    • all these packages should 'provide' to a virtual package called wxWidgets or so
    • some pkgdep
      • wxbase =-synced version
    • pkgdesc
  • wxconfig
  • wxbase rename
  • wxgui rename
  • indent the PKGBUILD way: tabs (github replaced everything with spaces) (my fault)
# Contributer: Eric Bélanger <eric@archlinux.org>
# Contributor: Star Brilliant <echo bTEzMjUzQGhvdG1haWwuY29tCg== | base64 -d>
# Contributor: Mingye Wang <arthur2e5@aosc.xyz>
pkgbase=wxgui
# note: deptree-break: wxgtk -> wx + wxgtk2
pkgname=(wxbase wxgui-{gtk2,gtk3,qt,x11}})
pkgver=3.0.2
pkgrel=6
pkgdesc="GTK+ implementation of wxWidgets API for GUI"
arch=('i686' 'x86_64')
url="http://wxwidgets.org"
license=('custom:wxWindows')
options=('!emptydirs')
# tell me, why do you love bzip2 so much?
source=(https://github.com/wxWidgets/wxWidgets/releases/download/v${pkgver}/wxWidgets-${pkgver}.tar.bz2
make-abicheck-non-fatal.patch)
sha1sums=('6461eab4428c0a8b9e41781b8787510484dea800'
'dfe38650c655395b90bf082b5734c4093508bfa3')
# backend constants for gtk (move to the funcs)
_gtk_depends=('gtk3' 'gstreamer0.10-base' 'libsm')
_gtk_makedepends=('gstreamer0.10-base-plugins' 'gconf' 'webkitgtk' 'glu')
_gtk_optdepends=('webkitgtk: for webview support')
prepare() {
cd "wxWidgets-${pkgver}"
# C++ ABI check is too strict and breaks with GCC 5.1
# https://bugzilla.redhat.com/show_bug.cgi?id=1200611
patch -Np1 -i ../make-abicheck-non-fatal.patch
}
##_build_wx_one pkg_suffix configure-flags
# thou shalt use ccache
_build_wx_one(){
cp -al "wxWidgets-${pkgver}"{,"-$1"}
./configure --prefix=/usr --libdir=/usr/lib --with-opengl --enable-unicode \
--enable-graphics_ctx --enable-mediactrl --enable-webview --with-regex=builtin \
--with-libpng=sys --with-libxpm=sys --with-libjpeg=sys --with-libtiff=sys \
--disable-precomp-headers "${@:1:}"
make
}
build() {
_build_wx_one gtk2 --with-gtk=2
_build_wx_one gtk3 --with-gtk=3
_build_wx_one qt --with-qt # EXPERIMENTAL UPSTREAM!!!! But someone will want qt.
_build_wx_one x11 --with-x11 --with-universal
_build_wx_one motif --with-motif
# choose a random one to cd into (for the locales).
cd "wxWidgets-${pkgver}-gtk2"
make -C locale allmo
}
# basically the complement of whatever we have deleted.
package_wxbase(){
# this is so dirty
# i like it (not really)
cd "wxWidgets-${pkgver}-gtk2"
make DESTDIR="${pkgdir}" install
# there should be some shopt-tweaking things in makepkg but who cares
shopt -s extglob
rm -rf -- !("${pkgdir}/usr/"{bin,include,share}|"${pkgdir}/usr/lib/libwx_base"*)
install -D -m644 docs/licence.txt "${pkgdir}/usr/share/licenses/${pkgbase}-$1/LICENSE"
}
# I am really lazy. we should do it with some... tricks.
_package_wx_one(){
provides+=('wxgtk' 'wxgui') # two dummy packages, one for backwards compatibility (why not make it three)
# yes, backwards compatibility: goo.gl/j6xKSc (biergaizi told me about the img)
cd "wxWidgets-${pkgver}-$1"
# TODO: find some better makefile targets
make DESTDIR="${pkgdir}" install
rm -rf "${pkgdir}/usr/"{bin,include,share} "${pkgdir}/usr/lib/libwx_base"*
install -D -m644 docs/licence.txt "${pkgdir}/usr/share/licenses/${pkgbase}-$1/LICENSE"
}
package_wxgui-gtk2(){
pkgdesc...
pkgdep...
_package_wx_one gtk2 "$@"
}
@m13253
Copy link

m13253 commented Feb 11, 2016

Submitted to Arch Bug Tracker https://bugs.archlinux.org/task/48145

@m13253
Copy link

m13253 commented Feb 11, 2016

Just a notice:
Gtk2 requires WebkitGtk2, Gtk3 requires WebkitGtk.
My Arch installation has another package named Webkit2Gtk, I do not know that it is.

@Artoria2e5
Copy link
Author

doing some cleanup and checking wxbase file list.

@Artoria2e5
Copy link
Author

back to looking at the deps (not really).

@MingcongBai
Copy link

My Arch installation has another package named Webkit2Gtk, I do not know that it is.

That's really webkitgtk4, the new generation, or the 2.8+ branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment