Skip to content
Browse files

telegram-0.51 qt-telegram-static-5.6.0

  • Loading branch information...
1 parent 48f2ee1 commit 29e88af592d21b009b3d3139e1ff0bc037d0415d @sandikata committed Jun 22, 2016
View
5 dev-qt/qt-telegram-static/Manifest
@@ -1,4 +1,9 @@
+AUX qtdbus-5.6.0-deadlock.patch 5755 SHA256 e0d21136772598715bbe1e3321da43ee07966764f2fe66d60ad5afb8112a2e5e SHA512 d007a1feb61e1704f785cfab3e46ca0a5f9932156127c370d67c348800b8fa3cfbf5998f3c1c70b65aaa1b3aa8cdccc196327035a294920863efc5b745166294 WHIRLPOOL 0109ce5309592824be31fa0b1eaaaea60e2e46e9ae46996b8afe6c9a3e0538721657d0ddbc4b972ac7f54930ee95f3ce8c61683310278435712c700728f6f84b
DIST qt-telegram-static-5.5.1_p20160406-qtbase.patch 594568 SHA256 54406d9b4bfe8499892c11b43febe8b70e8a9beee08bd51f84adce7698463ac2 SHA512 0a1ee2ddd3b824ee995e00ed0e0bdb1afdda06c6307111bf44f03d4e6f298e74acd2ad2b293266fa7340badc83637364ec74bf29b66984201294169fc7718d97 WHIRLPOOL 62b49a7c719a19ed30b4135915bf6e50a811f118e538eb7c9b3bab75d77c1c4a7815f0578a3389efa489f0cef425a5920656c35c9010e1782cbe13d1cbc20585
+DIST qt-telegram-static-5.6.0_p20160510-qtbase.patch 598164 SHA256 c2db99483d73aa56b40702f3acd221e485924541e0fe36d03845510a548fd541 SHA512 80d49c8738010bcb0f9e6c753704986cd1c9135fff3b99c39036effab91dd4b2efbfeb5c2897944e8a2439dd675c6c1fb62b6391fcc251ab9060fa7610531733 WHIRLPOOL 1f253059d927ac44e6bfd90089c6d19c6cdfb3a7ca0ab77b567b39c878efef6f0b035f1d73bab1c9d282d22c40564e2a37718680e543c173a3890bb6e4349cc6
DIST qtbase-opensource-src-5.5.1.tar.xz 46389212 SHA256 dfa4e8a4d7e4c6b69285e7e8833eeecd819987e1bdbe5baa6b6facd4420de916 SHA512 4d31de136870025dfb7544f255798884af1ad4f3060b0c00a0467c98af1f7de368eb298d4c52ba6d1ad27e36060b30c0314ce7ba0744b15642420ec89587a575 WHIRLPOOL 8975a54a720105d1b12b4f50072b98157f6a91020ecd7bad12ab4a92b7ac4663713a82e87f033cc6ad49602a5f9468c6d3ee23120be6c15d63e55ea0b5a343c4
+DIST qtbase-opensource-src-5.6.0.tar.xz 46757096 SHA256 6efa8a5c559e92b2e526d48034e858023d5fd3c39115ac1bfd3bb65834dbd67a SHA512 5b2a5842346475be0944fc44bc09ff5b5d5da167246310de132f034e17ebbcbbf103b6f085dbf8b566389694bd095227aa1ed569b93e0f9a8f02da51d8fe076e WHIRLPOOL 2f6817a0fbf5ad7f3457e778a33bcf38791ea6e0df68e7de4b0fc3ea8e84b35bc6c5bba2d574105dbaba8edbc8c2d954b13e4cf1784991544f7f77c8d6d68590
DIST qtimageformats-opensource-src-5.5.1.tar.xz 1892820 SHA256 c97fee00c602f9f089fea480546d6e9d61a2b2297c2f163bfd9f8aba92b754a5 SHA512 cee25ebf12d8e95c9539aa3b8d6f464f65fbceb1c637961bd2fd997ae803a5fda4b9a2ad96fe406cfa95609213f0ce9f2c82dba6ccc7413217b4e1a2f99a8049 WHIRLPOOL 0f35b3bf40e92706ef0d4893fef54bff6de168db92ebf94732c44ba7721a5c37ea34fe7be8f44c41d3220d0748c9c7354e1f935f89da7b159841256daa42379b
+DIST qtimageformats-opensource-src-5.6.0.tar.xz 1908556 SHA256 2c854275a689a513ba24f4266cc6017d76875336671c2c8801b4b7289081bada SHA512 a1089199d8acd44ebef5b54e4eb268545d0670b527f547ec8c60f70597f645e9fbad98b2221d2816c2df994f0beea1f43a500bbe5523fd4e40b7c3234dffbc5c WHIRLPOOL dbb1dd382fc6bba2aa8658b0b32aff635346e54cc7914d7cec69f06e0532f0bc7a8b931fa520c4d88bfbb5bb5341c46ebb557ad5446c0cebdfd46cc1335a53b6
EBUILD qt-telegram-static-5.5.1_p20160406.ebuild 7641 SHA256 c92244b220c166669d9b32dd1bd992eecbfc70e71fd28144cc600a762d8f82c9 SHA512 e9d4214b92cbc65a56fe2c460d61ba47d069cf35934564657cb9e993f7bf7668a2584e721b2c79def110a96c63633820f7738a815f370a202d278207b63f3220 WHIRLPOOL 9e8427b6cfa8641316eece8ec0fba2f3df71307e213aa34242def311710008d56c39a32ded9278e2c0a3d1aa0b7b2f20fd9df9af2fdd7b2ea1800185f5772062
+EBUILD qt-telegram-static-5.6.0_p20160510.ebuild 8132 SHA256 4ea880128a70c367d4c4ba9c359502f74af1886ad4283dc89b6453c1882e1b01 SHA512 c27475607f04eae9d27e19373d182781612673309b55d52c3756ee492a3c2167a769be468bd229fdd2d31906b4d609dd42dd41ff9c923a89c9f248e2cf1afbd4 WHIRLPOOL 1d43030875242a50735a64ca2b79a47d604003ec3e3e2ac6b2a141509ca500b8450c5d413cd62de3fd4323aa2460ab53bd9cd52315b7366316a36facdf467734
View
122 dev-qt/qt-telegram-static/files/qtdbus-5.6.0-deadlock.patch
@@ -0,0 +1,122 @@
+From: Thiago Macieira <thiago.macieira@intel.com>
+Date: Tue, 15 Mar 2016 18:00:20 +0000 (-0700)
+Subject: Fix QtDBus deadlock inside kded/kiod
+X-Git-Url: https://codereview.qt-project.org/gitweb?p=qt%2Fqtbase.git;a=commitdiff_plain;h=11c5e716b08b6b3c5a7c9fce96b0cde8624ec869;hp=85a57f7a2e85ac61bb65e66b003cb21f58d5a5b7
+
+Fix QtDBus deadlock inside kded/kiod
+
+Whenever a message spy was installed, we failed to actually process
+looped-back messages by queueing them for processing by the spy. That
+had as a consequence that the caller got an error reply. Worse, since
+the message had been queued, QtDBus would attempt to deliver it later.
+Since that message had isLocal==true, bad things happened inside the
+manager thread.
+
+The correct solution is not to queue the message for the filter. If the
+message is local, then simply deliver directly, as we're still in the
+user's thread. This used to be the behavior in Qt 5.5.
+
+Task-number: QTBUG-51676
+Change-Id: I1dc112894cde7121e8ce302ae51b438ade1ff612
+---
+
+diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
+index cd44861..478a2c4 100644
+--- a/src/dbus/qdbusintegrator.cpp
++++ b/src/dbus/qdbusintegrator.cpp
+@@ -481,6 +481,11 @@ QDBusSpyCallEvent::~QDBusSpyCallEvent()
+
+ void QDBusSpyCallEvent::placeMetaCall(QObject *)
+ {
++ invokeSpyHooks(msg, hooks, hookCount);
++}
++
++inline void QDBusSpyCallEvent::invokeSpyHooks(const QDBusMessage &msg, const Hook *hooks, int hookCount)
++{
+ // call the spy hook list
+ for (int i = 0; i < hookCount; ++i)
+ hooks[i](msg);
+@@ -509,7 +514,12 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
+ {
+ if (!ref.load())
+ return false;
+- if (!dispatchEnabled && !QDBusMessagePrivate::isLocal(amsg)) {
++
++ // local message are always delivered, regardless of filtering
++ // or whether the dispatcher is enabled
++ bool isLocal = QDBusMessagePrivate::isLocal(amsg);
++
++ if (!dispatchEnabled && !isLocal) {
+ // queue messages only, we'll handle them later
+ qDBusDebug() << this << "delivery is suspended";
+ pendingMessages << amsg;
+@@ -523,13 +533,23 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
+ // let them see the signal too
+ return false;
+ case QDBusMessage::MethodCallMessage:
+- // run it through the spy filters (if any) before the regular processing
++ // run it through the spy filters (if any) before the regular processing:
++ // a) if it's a local message, we're in the caller's thread, so invoke the filter directly
++ // b) if it's an external message, post to the main thread
+ if (Q_UNLIKELY(qDBusSpyHookList.exists()) && qApp) {
+ const QDBusSpyHookList &list = *qDBusSpyHookList;
+- qDBusDebug() << this << "invoking message spies";
+- QCoreApplication::postEvent(qApp, new QDBusSpyCallEvent(this, QDBusConnection(this),
+- amsg, list.constData(), list.size()));
+- return true;
++ if (isLocal) {
++ Q_ASSERT(QThread::currentThread() != thread());
++ qDBusDebug() << this << "invoking message spies directly";
++ QDBusSpyCallEvent::invokeSpyHooks(amsg, list.constData(), list.size());
++ } else {
++ qDBusDebug() << this << "invoking message spies via event";
++ QCoreApplication::postEvent(qApp, new QDBusSpyCallEvent(this, QDBusConnection(this),
++ amsg, list.constData(), list.size()));
++
++ // we'll be called back, so return
++ return true;
++ }
+ }
+
+ handleObjectCall(amsg);
+@@ -1451,9 +1471,9 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg)
+ // that means the dispatchLock mutex is locked
+ // must not call out to user code in that case
+ //
+- // however, if the message is internal, handleMessage was called
+- // directly and no lock is in place. We can therefore call out to
+- // user code, if necessary
++ // however, if the message is internal, handleMessage was called directly
++ // (user's thread) and no lock is in place. We can therefore call out to
++ // user code, if necessary.
+ ObjectTreeNode result;
+ int usedLength;
+ QThread *objThread = 0;
+@@ -1492,12 +1512,14 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg)
+ usedLength, msg));
+ return;
+ } else if (objThread != QThread::currentThread()) {
+- // synchronize with other thread
++ // looped-back message, targeting another thread:
++ // synchronize with it
+ postEventToThread(HandleObjectCallPostEventAction, result.obj,
+ new QDBusActivateObjectEvent(QDBusConnection(this), this, result,
+ usedLength, msg, &sem));
+ semWait = true;
+ } else {
++ // looped-back message, targeting current thread
+ semWait = false;
+ }
+ } // release the lock
+diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h
+index 2bbebdf..c0d9c22 100644
+--- a/src/dbus/qdbusintegrator_p.h
++++ b/src/dbus/qdbusintegrator_p.h
+@@ -145,6 +145,7 @@ public:
+ {}
+ ~QDBusSpyCallEvent();
+ void placeMetaCall(QObject *) Q_DECL_OVERRIDE;
++ static inline void invokeSpyHooks(const QDBusMessage &msg, const Hook *hooks, int hookCount);
+
+ QDBusConnection conn; // keeps the refcount in QDBusConnectionPrivate up
+ QDBusMessage msg;
View
307 dev-qt/qt-telegram-static/qt-telegram-static-5.6.0_p20160510.ebuild
@@ -0,0 +1,307 @@
+# Copyright 2015-2016 Jan Chren (rindeal)
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit versionator
+
+{
+ telegram_ver="0.9.48"
+
+ QT_VER="$(get_version_component_range 1-3)"
+ QT_PATCH_DATE="$(get_version_component_range 4 | tr -d 'p')"
+}
+{
+ # 'module > subdir > package' bindings: https://wiki.gentoo.org/wiki/Project:Qt/Qt5status
+ QT5_MODULE='qtbase' # base ( core dbus gui network widgets ) imageformats
+ QT_MODULES=( qtbase qtimageformats ) # list of qt modules used to generate SRC_URI
+
+ inherit check-reqs eutils qmake-utils qt5-build
+
+ # prevent qttest from being assigned to DEPEND, this is a very dirty hack
+ E_DEPEND="${E_DEPEND/test? \( \~dev-qt\/qttest-* \)}"
+}
+{
+ SLOT="${QT_VER}/${QT_PATCH_DATE}" ; readonly SLOT
+ # this path must be in sync with net-im/telegram ebuild
+ QT5_PREFIX="${EPREFIX}/opt/${PN}/${SLOT}" ; readonly QT5_PREFIX
+}
+
+GH_REPO="telegramdesktop/tdesktop"
+DESCRIPTION='Patched Qt for net-im/telegram'
+HOMEPAGE="https://github.com/${GH_REPO} https://www.qt.io"
+
+# convert date to ISO8601 and format it properly as a git rev
+_qt_patch_rev="master@{${QT_PATCH_DATE:0:4}-${QT_PATCH_DATE:4:2}-${QT_PATCH_DATE:6:2}}"
+_qt_patch_uri_path="Telegram/Patches/qtbase_${QT_VER//./_}.diff"
+QT_PATCH_LOCAL_NAME="${P}-qtbase.patch"
+
+SRC_URI="https://github.com/${GH_REPO}/raw/${_qt_patch_rev}/${_qt_patch_uri_path} -> ${QT_PATCH_LOCAL_NAME}"
+my_gen_qt_uris() {
+ local m qt_submodules_base_uri="
+ https://download.qt-project.org/official_releases/qt/${QT_VER%.*}/${QT_VER}/submodules"
+ for m in "${QT_MODULES[@]}" ; do
+ SRC_URI+="${qt_submodules_base_uri}/${m}-opensource-src-${QT_VER}.tar.xz"
+ done
+}
+my_gen_qt_uris
+
+KEYWORDS='~amd64 ~arm ~arm64 ~x86'
+IUSE='bindist gtkstyle ibus +icu libinput libproxy systemd tslib'
+
+RDEPEND=(
+ ## BEGIN - QtCore
+ 'dev-libs/glib:2'
+ '>=dev-libs/libpcre-8.38[pcre16,unicode]'
+ '>=sys-libs/zlib-1.2.5'
+ 'virtual/libiconv'
+ 'icu? ( dev-libs/icu )'
+ # 'systemd? ( sys-apps/systemd )'
+ ## END - QtCore
+
+ ## BEGIN - QtDbus
+ '>=sys-apps/dbus-1.4.20'
+ ## END - QtDbus
+
+ ## BEGIN - QtGui
+ 'dev-libs/glib:2'
+ # '~dev-qt/qtcore-${PV}'
+ 'media-libs/fontconfig'
+ '>=media-libs/freetype-2.6.1:2'
+ '>=media-libs/harfbuzz-1.0.6:0'
+ '>=sys-libs/zlib-1.2.5'
+ 'virtual/opengl'
+ # 'dbus? ( ~dev-qt/qtdbus-${PV} )'
+ # 'egl? ( media-libs/mesa[egl] )'
+ # 'eglfs? ('
+ # 'media-libs/mesa[gbm]'
+ # 'x11-libs/libdrm'
+ # ')'
+ # 'evdev? ( sys-libs/mtdev )'
+ 'gtkstyle? ('
+ 'x11-libs/gtk+:2'
+ 'x11-libs/pango'
+ '!!x11-libs/cairo[qt4]'
+ ')'
+ # 'gles2? ( media-libs/mesa[gles2] )'
+ 'virtual/jpeg:0' # jpeg
+ 'libinput? ('
+ 'dev-libs/libinput:0'
+ 'x11-libs/libxkbcommon'
+ ')'
+ 'media-libs/libpng:0' # png
+ 'tslib? ( x11-libs/tslib )'
+ # 'tuio? ( ~dev-qt/qtnetwork-${PV} )'
+ # 'udev? ( virtual/libudev )'
+ # BEGIN - QtGui - XCB
+ 'x11-libs/libICE'
+ 'x11-libs/libSM'
+ 'x11-libs/libX11'
+ '>=x11-libs/libXi-1.7.4'
+ 'x11-libs/libXrender'
+ '>=x11-libs/libxcb-1.10[xkb]'
+ '>=x11-libs/libxkbcommon-0.4.1[X]'
+ 'x11-libs/xcb-util'-{image,keysyms,renderutil,wm}
+ # END - QtGui - XCB
+ ## END - QtGui
+
+ ## BEGIN - QtImageFormats
+ 'media-libs'/{jasper,libmng,libwebp,tiff}':0'
+ ## END - QtImageFormats
+
+ ## BEGIN - QtNetwork
+ 'dev-libs/openssl:0[bindist=]'
+ '>=sys-libs/zlib-1.2.5'
+ 'libproxy? ( net-libs/libproxy )'
+ ## END - QtNetwork
+)
+DEPEND=("${RDEPEND[@]}"
+ 'virtual/pkgconfig'
+)
+PDEPEND=(
+ # 'ibus? ( app-i18n/ibus )' # QtGui
+)
+
+DEPEND="${DEPEND[*]}"
+RDEPEND="${RDEPEND[*]}"
+PDEPEND="${PDEPEND[*]}"
+
+RESTRICT='test'
+
+## !!! ORDER MATTERS !!!
+QT5_TARGET_SUBDIRS=(
+ ## BEGIN - QtCore
+ 'qtbase/src/tools/'{bootstrap,moc,rcc}
+ 'qtbase/src/corelib'
+ ## END - QtCore
+
+ ## BEGIN - QtDbus (core)
+ 'qtbase/src/dbus'
+ 'qtbase/src/tools/qdbusxml2cpp' # Telegram doesn't use cpp2xml
+ ## END - QtDbus
+
+ ## BEGIN - QtNetwork (core, dbus)
+ 'qtbase/src/network'
+ ## END - QtNetwork
+
+ ## BEGIN - QtGui (core, dbus)
+ 'qtbase/src/'{gui,platform{headers,support}}
+ 'qtbase/src/plugins/'{generic,imageformats,platforms,platform{inputcontexts,themes}}
+ ## END - QtGui
+
+ ## BEGIN - QtImageFormats (core, gui)
+ 'qtimageformats'
+ ## END - QtImageFormats
+
+ ## BEGIN - QtWidgets (core, gui)
+ 'qtbase/src/tools/uic'
+ 'qtbase/src/widgets'
+ ## END - QtWidgets
+)
+
+QTBASE_PATCHES=()
+if version_is_at_least "5.6.0" "${QT_VER}" ; then
+ QTBASE_PATCHES+=( "${FILESDIR}"/qtdbus-5.6.0-deadlock.patch)
+fi
+
+# size varies between 400M-1100M depending on compiler flags
+CHECKREQS_DISK_BUILD='800M'
+
+S="${WORKDIR}"
+QT5_BUILD_DIR="${S}"
+qtbase_dir="${S}/qtbase"
+
+src_unpack() {
+ qt5-build_src_unpack
+
+ local m
+ for m in ${QT_MODULES[@]} ; do
+ mv -v "${m}-opensource-src-${QT_VER}" "${m}" || die
+ done
+}
+
+# override env to use our prefix and paths expected by tg sources
+qt5_prepare_env() {
+ QT5_HEADERDIR="${QT5_PREFIX}/include"
+ QT5_LIBDIR="${QT5_PREFIX}/lib"
+ QT5_ARCHDATADIR="${QT5_PREFIX}"
+ QT5_BINDIR="${QT5_ARCHDATADIR}/bin"
+ QT5_PLUGINDIR="${QT5_ARCHDATADIR}/plugins"
+ QT5_LIBEXECDIR="${QT5_ARCHDATADIR}/libexec"
+ QT5_IMPORTDIR="${QT5_ARCHDATADIR}/imports"
+ QT5_QMLDIR="${QT5_ARCHDATADIR}/qml"
+ QT5_DATADIR="${QT5_PREFIX}/share"
+ QT5_DOCDIR="${QT5_PREFIX}/share/doc/qt-${QT_VER}"
+ QT5_TRANSLATIONDIR="${QT5_DATADIR}/translations"
+ QT5_EXAMPLESDIR="${QT5_DATADIR}/examples"
+ QT5_TESTSDIR="${QT5_DATADIR}/tests"
+ QT5_SYSCONFDIR="${EPREFIX}/etc/xdg"
+ readonly QT5_PREFIX QT5_HEADERDIR QT5_LIBDIR QT5_ARCHDATADIR QT5_BINDIR QT5_PLUGINDIR \
+ QT5_LIBEXECDIR QT5_IMPORTDIR QT5_QMLDIR QT5_DATADIR QT5_DOCDIR QT5_TRANSLATIONDIR \
+ QT5_EXAMPLESDIR QT5_TESTSDIR QT5_SYSCONFDIR
+
+ # WARNING: this is very dangerous to change, if you put QT5_ARCHDATADIR here,
+ # the installation will result into a spaghetti mix up.
+ # See: mkspecs/features/qt_config.prf
+ export QMAKEMODULES="${QT5_BUILD_DIR}/mkspecs/modules:${S}/mkspecs/modules"
+}
+
+src_prepare() {
+ cd "${qtbase_dir}" || die
+
+ eapply "${DISTDIR}/${QT_PATCH_LOCAL_NAME}" # this bitch is why this ebuild exists
+
+ [[ ${#QTBASE_PATCHES[@]} > 0 ]] && eapply "${QTBASE_PATCHES[@]}"
+
+ # apply user patches now, because qt5-build_src_prepare() calls default() in a wrong dir
+ pushd "${S}" >/dev/null || die
+ eapply_user
+ popd >/dev/null || die
+
+ ## BEGIN - QtGui
+ # avoid automagic dep on qtnetwork
+ sed -e '/SUBDIRS += tuiotouch/d' \
+ -i -- 'src/plugins/generic/generic.pro' || die
+ ## END - QtGui
+
+ qt5-build_src_prepare
+}
+
+# not using this feature
+qt5_symlink_tools_to_build_dir() { : ; }
+
+# customized qt5-build_src_configure()
+src_configure() {
+ echo
+ einfo "${PN} is going to be installed into '${QT5_PREFIX}'"
+ echo
+
+ local myconf=(
+ -static
+
+ # use system libs
+ -system-{freetype,harfbuzz,libjpeg,libpng,pcre,xcb,xkbcommon-x11,zlib}
+
+ # enabled features
+ -{fontconfig,gui,iconv,xcb,xcb-xlib,xinput2,xkb,xrender,widgets}
+ -{dbus,openssl}-linked
+ # disabled features
+ -no-{glib,nis,qml-debug}
+
+ # Telegram doesn't support sending files >4GB
+ -no-largefile
+
+ $(usex amd64 -reduce-relocations '') # buggy on other arches
+
+ $(qt_use gtkstyle)
+ $(qt_use icu)
+ $(qt_use libinput)
+ $(qt_use libproxy)
+ $(qt_use systemd journald)
+ $(qt_use tslib)
+ )
+
+ # This configure will build qmake for use in builds of other modules.
+ # The global qmake will not work.
+ S="${qtbase_dir}" QT5_BUILD_DIR="${qtbase_dir}" \
+ qt5_base_configure
+
+ # The following round of qmakes will output some warning messages, which look like this:
+ #
+ # .../qtbase/bin/<TOOL>: not found
+ #
+ # Just ignore them, they're harmless.
+ my_qt5_qmake() {
+ # this ensures that correct qmake will be called
+ local QT5_MODULE= QT5_BINDIR="${qtbase_dir}/bin"
+ qt5_qmake
+ }
+ qt5_foreach_target_subdir \
+ my_qt5_qmake
+}
+
+src_compile() {
+ qt5_foreach_target_subdir \
+ emake
+}
+
+src_install() {
+ qt5_foreach_target_subdir \
+ emake INSTALL_ROOT="${ED}" install
+
+ emake -C "${qtbase_dir}" INSTALL_ROOT="${ED}" install_{qmake,mkspecs}
+
+ # fix .prl files
+ local args=(
+ # - Drop QMAKE_PRL_BUILD_DIR because it references the build dir
+ -e '/^QMAKE_PRL_BUILD_DIR/d'
+ # - Fix -L paths referencing build dir
+ -e "s|-L${S}[^ ]*||g"
+ )
+ find "${ED}" -type f -name '*.prl' | xargs sed "${args[@]}" -i --
+ assert
+}
+
+# unneeded funcs
+qt5-build_pkg_postinst() { : ; }
+qt5-build_pkg_postrm() { : ; }
View
161 eclass/eclass-patches.eclass
@@ -0,0 +1,161 @@
+# Copyright 2016 Jan Chren (rindeal)
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: eclass-patches.eclass
+# @MAINTAINER:
+# Jan Chren (rindeal) <dev.rindeal+gentoo-overlay@gmail.com>
+# @BLURB: Collection of overrides of functions from eclasses from the tree
+# @DESCRIPTION:
+
+case "${EAPI:-0}" in
+ 5|6) ;;
+ *) die "Unsupported EAPI='${EAPI}' for '${ECLASS}'" ;;
+esac
+
+# @FUNCTION: get-flag
+# @USAGE: <flag>
+# @DESCRIPTION:
+# Find and echo the value for a particular flag. Accepts shell globs.
+#
+# Example:
+# @CODE
+# CFLAGS="-march=i686 -O1"
+# get-flag -march # outputs "-march=i686"
+# get-flag march # outputs "i686"
+# get-flag '-O*' # outputs "-O1"
+# @CODE
+# ORIGIN: flag-o-matic
+# PR: https://github.com/gentoo/gentoo/pull/1425
+get-flag() {
+ local var pattern="${1}"
+ # ensure ${needle} starts with a single dash
+ local needle="-${pattern#-}"
+
+ for var in $(all-flag-vars) ; do
+ local i flags=( ${!var} )
+
+ # reverse loop because last flag wins
+ for (( i = ${#flags[@]} - 1 ; i >= 0 ; i-- )) ; do
+ local flag="${flags[i]}"
+ # strip value as it's not needed for comparison
+ local haystack="${flag%%=*}"
+
+ # as long as ${needle} remains unquoted, wildcards will work
+ if [[ "${haystack}" == ${needle} ]] ; then
+ # preserve only value if only flag name was provided
+ local ret="${flag#-${pattern}=}"
+
+ # ${ret} might contain `-e` or `-n` which confuses echo
+ printf '%s\n' "${ret}"
+
+ return 0
+ fi
+ done
+ done
+
+ return 1
+}
+
+## Origin: cmake-utils.eclass
+## PR: https://github.com/gentoo/gentoo/pull/1481
+_ninjaopts_from_makeopts() {
+ local makeopts="${1:-"${MAKEOPTS}"}" ninjaopts=()
+ local jobs= keep= load=
+
+ set -- ${makeopts}
+ while (( ${#} )) ; do
+ case "${1}" in
+ -j|--jobs)
+ if [[ -n ${2} ]] && [[ ${2} =~ ^[0-9]+$ ]] ; then
+ jobs=${2}
+ shift
+ else
+ # `man 1 make`:
+ # If the -j option is given without an argument, make will not limit
+ # the number of jobs that can run simultaneously.
+ jobs=99
+ fi
+ ;;
+ -k|--keep-going)
+ # `man 1 make`:
+ # Continue as much as possible after an error
+ # `ninja --help`:
+ # keep going until N jobs fail
+ # ninja internals:
+ # ninja handles 0 as inifinity in this case
+ keep=0
+ ;;
+ -l|--load-average)
+ if [[ -n ${2} ]] && [[ ${2} =~ ^[0-9]+\.?[0-9]*$ ]] ; then
+ # ninja internals:
+ # ninja supports floating-point numbers here
+ load=${2}
+ shift
+ else
+ # `man 1 make`:
+ # With no argument, removes a previous load limit.
+ load=
+ fi
+ ;;
+ -S|--no-keep-going|--stop)
+ # `make --help`:
+ # Turns off -k
+ keep=
+ ;;
+ -j*|--jobs=*|-l*|--load-average=*)
+ eshopts_push -s extglob
+
+ local arg="${1##*([^0-9])}"
+ case "${1##*(-)}" in
+ j*) jobs=${arg} ;;
+ l*) load=${arg} ;;
+ esac
+
+ eshopts_pop
+ ;;
+ esac
+ shift
+ done
+
+ ninjaopts+=( ${jobs:+"-j"} ${jobs} )
+ ninjaopts+=( ${keep:+"-k"} ${keep} )
+ ninjaopts+=( ${load:+"-l"} ${load} )
+
+ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: '${makeopts}' -> '${ninjaopts[*]}'"
+
+ NINJAOPTS="${ninjaopts[*]}"
+}
+
+## Origin: cmake-utils.eclass
+## PR: https://github.com/gentoo/gentoo/pull/1481
+# @FUNCTION: _cmake_ninja_src_make
+# @INTERNAL
+# @DESCRIPTION:
+# Build the package using ninja generator
+_cmake_ninja_src_make() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ [[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage."
+
+ if [[ -z ${NINJAOPTS+x} ]] ; then
+ declare -g NINJAOPTS
+ _ninjaopts_from_makeopts
+ fi
+
+ [[ "${CMAKE_VERBOSE}" != "OFF" ]] && NINJAOPTS+=" -v"
+
+ set -- ninja ${NINJAOPTS} "$@"
+ echo "$@"
+ "$@" || die
+}
+
+## Origin: portage - bin/isolated-functions.sh
+## PR: https://github.com/gentoo/portage/pull/26
+has() {
+ local needle=$'\a'"$1"$'\a'
+ shift
+ local IFS=$'\a'
+ local haystack=$'\a'"$@"$'\a'
+
+ [[ "${haystack}" == *"${needle}"* ]]
+}
View
119 eclass/git-hosting.eclass
@@ -0,0 +1,119 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: git-hosting.eclass
+# @MAINTAINER:
+# Jan Chren (rindeal) <dev.rindeal+gentoo@gmail.com>
+# @BLURB: Support eclass for packages hosted on online git hosting services like Github
+
+if [ -z "${_GH_ECLASS}" ] ; then
+
+case "${EAPI:-0}" in
+ 6) ;;
+ *) die "Unsupported EAPI='${EAPI}' for '${ECLASS}'" ;;
+esac
+
+
+# @ECLASS-VARIABLE: GH_URI
+# @DESCRIPTION:
+# String in the format:
+#
+# <provider>[/<user_name>[/<repository_name>]]
+#
+# Default <user_name> and <repository_name> is ${PN}
+[ -z "${GH_URI}" ] && die "GH_URI must be set"
+_GH_URI_A=( ${GH_URI//\// } )
+_GH_PROVIDER="${_GH_URI_A[0]}"
+_GH_USER="${_GH_URI_A[1]:-"${PN}"}"
+_GH_REPO="${_GH_URI_A[2]:-"${PN}"}"
+unset _GH_URI_A
+
+# @ECLASS-VARIABLE: GH_REF
+# @DEFAULT: ${PV}
+# @DESCRIPTION:
+# Tag/commit/git_ref (except branches) that is fetched from Github.
+#
+# a research conducted on April 2016 among the first 700 repos with >10000 stars shows:
+# - no tags: 158
+# - `v` prefix: 350
+# - no prefix: 192
+: ${GH_REF:="${PV}"}
+
+# @ECLASS-VARIABLE: GH_FETCH_TYPE
+# @DESCRIPTION:
+# Defines if fetched from git ("live") or archive ("snapshot")
+if [ -z "${GH_FETCH_TYPE}" ] ; then
+ if [[ ${PV} == *9999* ]] ; then
+ GH_FETCH_TYPE='live'
+ else
+ GH_FETCH_TYPE='snapshot'
+ fi
+fi
+
+case "${_GH_PROVIDER}" in
+ 'bitbucket')
+ _GH_DOMAIN='bitbucket.org' ;;
+ 'github')
+ _GH_DOMAIN='github.com' ;;
+ 'gitlab')
+ _GH_DOMAIN='gitlab.com' ;;
+ *) die "Unsupported provider '${_GH_PROVIDER}'" ;;
+esac
+
+_GH_BASE_URI="https://${_GH_DOMAIN}/${_GH_USER}/${_GH_REPO}"
+
+if [ -z "${SRC_URI}" ] ; then
+ case "${_GH_PROVIDER}" in
+ 'bitbucket')
+ SRC_URI="${_GH_BASE_URI}/get/${GH_REF}.tar.bz2 -> ${P}.tar.bz2" ;;
+ 'github')
+ SRC_URI="${_GH_BASE_URI}/archive/${GH_REF}.tar.gz -> ${P}.tar.gz" ;;
+ 'gitlab')
+ SRC_URI="${_GH_BASE_URI}/repository/archive.tar.gz?ref=${GH_REF} -> ${P}.tar.gz" ;;
+ *) die "Unsupported provider '${_GH_PROVIDER}'" ;;
+ esac
+fi
+
+if [ -z "${EGIT_REPO_URI}" ] ; then
+ EGIT_REPO_URI="
+ ${_GH_BASE_URI}.git
+ git@${_GH_DOMAIN}:${_GH_USER}/${_GH_REPO}.git"
+fi
+
+case "${GH_FETCH_TYPE}" in
+ 'live')
+ if [ -n "${GH_REF}" ] && [ -z "${EGIT_COMMIT}" ] ; then
+ EGIT_COMMIT="${GH_REF}"
+ fi
+
+ inherit git-r3
+ ;;
+ 'snapshot')
+ inherit vcs-snapshot
+ ;;
+ *) die "Unsupported fetch type: '${GH_FETCH_TYPE}'" ;;
+esac
+
+: ${HOMEPAGE:="${_GH_BASE_URI}"}
+
+# prefer their CDN over Gentoo mirrors
+RESTRICT="${RESTRICT} primaryuri"
+
+
+EXPORT_FUNCTIONS src_unpack
+
+
+# @FUNCTION: github_src_unpack
+git-hosting_src_unpack() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ case "${GH_FETCH_TYPE}" in
+ 'live') git-r3_src_unpack ;;
+ 'snapshot') vcs-snapshot_src_unpack ;;
+ *) die ;;
+ esac
+}
+
+
+_GH_ECLASS=1
+fi
View
99 eclass/github.eclass
@@ -0,0 +1,99 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: github.eclass
+# @MAINTAINER:
+# Jan Chren (rindeal) <dev.rindeal+gentoo-overlay@gmail.com>
+# @BLURB: Support eclass for packages hosted on Github
+# @DESCRIPTION:
+# Support eclass for packages hosted on Github
+# Based on https://github.com/mrueg/mrueg-overlay/blob/master/eclass/github.eclass
+
+if [ -z "${_GH_ECLASS}" ] ; then
+
+case "${EAPI:-0}" in
+ 5|6) ;;
+ *) die "Unsupported EAPI='${EAPI}' (unknown) for '${ECLASS}'" ;;
+esac
+
+
+# @ECLASS-VARIABLE: GH_REPO
+# @DESCRIPTION:
+# Github repository name or a string in the format: `<user_name>/<repository_name>`
+: ${GH_REPO:="${PN}"}
+
+if [[ "${GH_REPO}" == *'/'* ]] ; then
+ GH_USER="${GH_REPO%%/*}"
+ GH_REPO="${GH_REPO##*/}"
+fi
+
+# @ECLASS-VARIABLE: GH_USER
+# @DESCRIPTION:
+# Github user/group name
+: ${GH_USER:="${PN}"}
+
+# @ECLASS-VARIABLE: GH_TAG
+# @DESCRIPTION:
+# Tag/commit that is fetched from Github
+
+# @ECLASS-VARIABLE: GH_BUILD_TYPE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Defines if fetched from git ("live") or tarball ("release")
+if [ -z "${GH_BUILD_TYPE}" ] ; then
+ if [[ "${PV}" == *9999* ]] ; then
+ GH_BUILD_TYPE='live'
+ else
+ GH_BUILD_TYPE='release'
+ fi
+fi
+
+
+case "${GH_BUILD_TYPE}" in
+ 'release')
+ inherit vcs-snapshot
+
+ # a research conducted on April 2016 among the first 700 repos with >10000 stars shows:
+ # - no tags: 158
+ # - `v` prefix: 350
+ # - no prefix: 192
+ : ${GH_TAG:="${PV}"}
+ SRC_URI="https://github.com/${GH_USER}/${GH_REPO}/archive/${GH_TAG}.tar.gz -> ${P}.tar.gz"
+ ;;
+ 'live')
+ inherit git-r3
+
+ [ -n "${GH_TAG}" ] && [ -z "${EGIT_COMMIT}" ] && \
+ EGIT_COMMIT="${GH_TAG}"
+ EGIT_REPO_URI="https://github.com/${GH_USER}/${GH_REPO}.git"
+ ;;
+ *)
+ die "Invalid GH_BUILD_TYPE: '${GH_BUILD_TYPE}'"
+ ;;
+esac
+
+
+HOMEPAGE="https://github.com/${GH_USER}/${GH_REPO}"
+
+# prefer GitHub servers over mirrors
+RESTRICT+=' primaryuri'
+
+
+EXPORT_FUNCTIONS src_unpack
+
+
+# @FUNCTION: github_src_unpack
+# @DESCRIPTION:
+# Function for unpacking Github packages
+github_src_unpack() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ case "${GH_BUILD_TYPE}" in
+ 'live') git-r3_src_unpack ;;
+ 'release') vcs-snapshot_src_unpack ;;
+ *) die ;;
+ esac
+}
+
+_GH_ECLASS=1
+fi
View
202 eclass/l10n.eclass
@@ -0,0 +1,202 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Copyright 2016 Jan Chren (rindeal)
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: l10n.eclass
+# @MAINTAINER:
+# Jan Chren <dev.rindeal+gentoo@gmail.com>
+# @BLURB: convenience functions to handle localizations
+# @DESCRIPTION:
+# The l10n (localization) eclass offers a number of functions to more
+# conveniently handle localizations (translations) offered by packages.
+# These are meant to prevent code duplication for such boring tasks as
+# determining the cross-section between the user's set LINGUAS and what
+# is offered by the package; and generating the right list of linguas_*
+# USE flags.
+
+if [ -z "${_L10N_ECLASS}" ] ; then
+
+case "${EAPI:-0}" in
+ 5|6) ;;
+ *) die "Unsupported EAPI='${EAPI}' (unknown) for '${ECLASS}'" ;;
+esac
+
+# @ECLASS-VARIABLE: PLOCALES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Variable listing the locales for which localizations are offered by
+# the package. Check profiles/desc/linguas.desc to see if the locales
+# are listed there. Add any missing ones there.
+#
+# Example: PLOCALES=( cy de el_GR en_US pt_BR vi zh_CN )
+declare -g -a _PLOCALES
+if [[ "$(declare -p PLOCALES)" == 'declare -a'* ]] ; then
+ _PLOCALES=( "${PLOCALES[@]}" )
+else
+ eqawarn "Declaring PLOCALES as a variable is deprecated. Please use an array instead."
+ _PLOCALES=( ${PLOCALES} )
+fi
+
+# Add linguas useflags
+IUSE+=" ${_PLOCALES[@]/#/linguas_}"
+
+# @ECLASS-VARIABLE: PLOCALE_BACKUP
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# In some cases the package fails when none of the offered PLOCALES are
+# selected by the user. In that case this variable should be set to a
+# default locale (usually 'en' or 'en_US') as backup.
+#
+# Example: PLOCALE_BACKUP='en_US'
+
+# @ECLASS-VARIABLE: PLOCALES_MAP
+# @DEFAULT: Default PLOCALES_MAP has values same as keys
+# @DESCRIPTION:
+#
+# Example:
+# @CODE
+# PLOCALES_MAP+=( ['en']='eng' ['de']='ger german' )
+# @CODE
+[ -v PLOCALES_MAP ] || declare -g -A PLOCALES_MAP
+for _l10n_l in "${_PLOCALES[@]}" ; do
+ # overwrite only if not already set
+ [ -z "${PLOCALES_MAP["${_l10n_l}"]}" ] && \
+ PLOCALES_MAP+=( ["${_l10n_l}"]="${_l10n_l}" )
+done
+unset _l10n_l
+
+# @ECLASS-VARIABLE: PLOCALES_MASK
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array of locales which will be ignored
+declare -g -A _PLOCALES_MASK=()
+for _l10n_l in "${PLOCALES_MASK[@]}" ; do
+ _PLOCALES_MASK+=( ["${_l10n_l}"]= )
+done
+unset _l10n_l
+
+
+# @FUNCTION: l10n_get_locales
+# @USAGE: [disabled]
+# @DESCRIPTION:
+# Determine which LINGUAS USE flags the user has enabled that are offered
+# by the package, as listed in PLOCALES, and return them. In case no locales
+# are selected, fall back on PLOCALE_BACKUP. When the disabled argument is
+# given, return the disabled useflags instead of the enabled ones.
+l10n_get_locales() {
+ local flag="${1}"
+
+ if [ ! -v _l10n_on_locs ] ; then
+ declare -g _l10n_on_locs= _l10n_off_locs=
+ local l on_locs=() off_locs=()
+
+ for l in "${_PLOCALES[@]}" ; do
+ if use "linguas_${l}" ; then
+ on_locs+=( "${l}" )
+ else
+ off_locs+=( "${l}" )
+ fi
+ done
+
+ # cache the results in global variables
+ _l10n_on_locs="${on_locs[*]}"
+ _l10n_off_locs="${off_locs[*]}"
+ fi
+
+ local locs
+ if [ "${flag}" = 'disabled' ] ; then
+ locs="${_l10n_off_locs}"
+ else
+ locs="${_l10n_on_locs:-"${PLOCALE_BACKUP}"}"
+ fi
+
+ echo "${locs}"
+}
+
+_l10n_for_each_locale_do() {
+ local l ll
+ for l in "${_locales[@]}" ; do
+ for ll in ${PLOCALES_MAP["${l}"]} ; do
+ "${@}" ${ll}
+ done
+ done
+}
+
+# @FUNCTION: l10n_for_each_locale_do
+# @USAGE: <function>
+# @DESCRIPTION:
+# Convenience function for processing localizations. The parameter should
+# be a function (defined in the consuming eclass or ebuild) which takes
+# an individual localization as (last) parameter.
+#
+# Example: l10n_for_each_locale_do install_locale
+l10n_for_each_locale_do() {
+ local _locales=( $(l10n_get_locales) )
+ _l10n_for_each_locale_do "$@"
+}
+
+# @FUNCTION: l10n_for_each_disabled_locale_do
+# @USAGE: <function>
+# @DESCRIPTION:
+# Complementary to l10n_for_each_locale_do, this function will process
+# locales that are disabled. This could be used for example to remove
+# locales from a Makefile, to prevent them from being built needlessly.
+l10n_for_each_disabled_locale_do() {
+ local _locales=( $(l10n_get_locales disabled) )
+ _l10n_for_each_locale_do "$@"
+}
+
+# @FUNCTION: l10n_find_plocales_changes
+# @USAGE: <translations dir> <filename pre pattern> <filename post pattern>
+# @DESCRIPTION:
+# Ebuild maintenance helper function to find changes in package offered
+# locales when doing a version bump. This could be added for example to
+# src_prepare
+#
+# Example: l10n_find_plocales_changes "${S}/src/translations" "${PN}_" '.ts'
+l10n_find_plocales_changes() {
+ debug-print-function ${FUNCNAME} "$@"
+ [[ ${#} != 3 ]] && die "Exactly 3 arguments are needed!"
+ local l dir="${1}" pre="${2}" post="${3}"
+
+ # using assoc array to allow instant lookup
+ declare -A found known
+
+ einfo "Looking in '${dir}' for changes in locales ..."
+ pushd "${dir}" >/dev/null || die "Cannot access '${dir}'"
+ for l in "${pre}"*"${post}" ; do
+ l="${l#"${pre}"}"
+ l="${l%"${post}"}"
+ [ -v _PLOCALES_MASK["${l}"] ] && continue
+ found+=( ["${l}"]= )
+ done
+ popd >/dev/null || die
+
+ _l10n_add_to_known(){ known+=( ["${1}"]= ); }
+ local _locales=( "${_PLOCALES[@]}" )
+ _l10n_for_each_locale_do _l10n_add_to_known
+ unset -f _l10n_add_to_known
+
+ local added=() removed=()
+ for l in "${!known[@]}" ; do
+ [[ -v found["${l}"] ]] || removed+=( "${l}" )
+ done
+ for l in "${!found[@]}" ; do
+ [[ -v known["${l}"] ]] || added+=( "${l}" )
+ done
+
+ if [[ $(( ${#added[@]} + ${#removed[@]} )) > 0 ]] ; then
+ einfo "There are changes in locales!"
+ if [[ ${#added[@]} > 0 ]] ; then
+ einfo "Locales added: '${added[*]}'"
+ fi
+ if [[ ${#removed[@]} > 0 ]] ; then
+ einfo "Locales removed: '${removed[*]}'"
+ fi
+ else
+ einfo "No changes found"
+ fi
+}
+
+_L10N_ECLASS=1
+fi
View
5 net-im/telegram/Manifest
@@ -1,2 +1,5 @@
-DIST telegram-0.9.40.tar.gz 11243600 SHA256 936f9327d43bd5264601cbe42ef0e3ee6881278b193be3d5c3fff989a465aca1 SHA512 aed0dc8c825153a4f0e7f6e4d236a0313b13300a6d399395092a5a9f82fe00edbd297a21856d0780877796c68ab93d1abe3e07362085343d928048b9b4c5465d WHIRLPOOL 6bf88f02d1d6aee44592f2ac45cbb41df73a4e0e8e99d1166e9c705fbe259abf3ee4f1272ab60002fd033f22e43bc24b252f26a8a0d3d2e89d7eccbee86d9783
+AUX format_pro.awk 537 SHA256 c63b780195552af3d07633b39449d09a76c14afc4025ae36d7a08d0d0c9e257b SHA512 9f5b94cae2f0ec2668321fa5540bf7f1ac66415f4fe64f1605e259c0124485bcd6c0947982f543330694729ed8f731e553b90b0358ba659ec8758eee44f4d04b WHIRLPOOL b01e64364d8542e2668c7d4337678b50cd8463ade37e95b536b81198b18f7777e26369ec504a30941190d7b118233f835be2981bed9b0498bb6793d5127b865f
+DIST telegram-0.9.40.tar.gz 2062212 SHA256 d085f9da0ecae29c4e093d5e1b21723325d86726b2b0072f521e8bc17ab1e79b SHA512 d45ebdf7a8a953c7ae645ddcd9ea765cb95516d41d5c5ae5c859e0a8ac8ccce036afa389523a8d05732541b55a645935b1ff3a5480031e8a156b1ca248ce1157 WHIRLPOOL 70cbe7f51068d0df0afab9c322cd572b730d40340f545c8741ca5f5c5dcd5a781fb1814f9e459e3074af032afc39e9770b798f68c14153ca34746279700f1985
+DIST telegram-0.9.51.tar.gz 11482866 SHA256 246c321c009f7eeb3b616503b19c270688a790bf691feac838b3d91bfd51c55b SHA512 9a8911d87f4a3538c3cdbaf5e929ec9c51e44cd96f331c9f4dcb245798f9c09ef7510cb4ea9fef02359df900ae58aeb9c45691c9dad0516b62a80c7ccb34a723 WHIRLPOOL 1cd3803796b3b7221708b00f2ba14cde27aec280992b072dc3518200e724c1f93f9ac07076a3afa1f3b80f1fb5461840806ce98d01771178ab3e3ac66ac910ed
EBUILD telegram-0.9.40.ebuild 5257 SHA256 8baccca63c4007480ea6738a588bae7c93c21975c60a548fe690eb4a8d7dacc1 SHA512 a7bbfd1c227a165db741115470f4974a3063b6fb72584b744b18f22421bda08cd8666303a3487d00de90cf4646746f850d37181cf222ae70be9995d17aebdfa3 WHIRLPOOL 2946a6e2ba4cf44aa7580241d15b60aede4dc6cf1135b763ef1c20f2ece855ed4c77023b3279c77d4f1f4beb0890cafdcf0b566c5787f1d459b9d65753749c30
+EBUILD telegram-0.9.51.ebuild 8202 SHA256 9e22d0c1375f6d9c4b60c4f43a290c7dcb5408e68ce627869d37db9fc62f564a SHA512 710e23c3a07f86ea2527e180b7046eacf0d470cf20c2a6bb35e65a0da4d147007ee9c398dd72474bb427e03fa1d0fad457a64bcc0fe97477c1e2af56f99a672f WHIRLPOOL 0070d3690792b4f7e21eeddc529c52ce2b1ab2db7cf8df0390a33e584c15d1c04a0fcce5c3b6a42af435452eb56541d6f241ba36771ccbe355302793b741f503
View
30 net-im/telegram/files/format_pro.awk
@@ -0,0 +1,30 @@
+#!/usr/bin/awk -f
+
+BEGIN {
+ var = ""
+ in_breaked_line = 0
+}
+
+{
+ if ( in_breaked_line ) {
+ if ( match($0,"(.*)(.)", a) == 0) {
+ in_breaked_line = 0
+ print
+ next
+ }
+
+ if ( a[2] != "\\" ){
+ in_breaked_line = 0
+ }
+ print var,"+=",( in_breaked_line ? a[1] : $0 )
+ next
+ }
+
+ if( match($0, "^ *([A-Z_]*)[^=]*=(.*)\\\\$", a) == 0 ) {
+ print
+ } else {
+ in_breaked_line = 1
+ var = a[1]
+ print var,"+=",a[2]
+ }
+}
View
273 net-im/telegram/telegram-0.9.51.ebuild
@@ -0,0 +1,273 @@
+# Copyright 2016 Jan Chren (rindeal)
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+GH_URI='github/telegramdesktop/tdesktop'
+GH_REF="v${PV}"
+
+inherit flag-o-matic fdo-mime eutils qmake-utils git-hosting versionator
+
+DESCRIPTION='Official cross-platorm desktop client for Telegram'
+HOMEPAGE='https://desktop.telegram.org/'
+LICENSE='GPL-3' # with OpenSSL exception
+
+SLOT='0'
+
+KEYWORDS='~amd64 ~arm ~x86'
+IUSE='proxy'
+
+CDEPEND=(
+ 'dev-libs/libappindicator:3' # pspecific_linux.cpp
+ '>=media-libs/openal-1.17.2' # Telegram requires shiny new versions
+ 'sys-libs/zlib[minizip]'
+ 'virtual/ffmpeg[opus]'
+)
+RDEPEND=(
+ '!net-im/telegram-bin'
+ '!net-im/telegram-desktop'{,-bin}
+)
+DEPEND=( "${CDEPEND[@]}"
+ ">=dev-qt/qt-telegram-static-5.6.0_p20160510:5.6.0" # 5.6.0 is required since 0.9.49
+ 'virtual/pkgconfig'
+ '>=sys-apps/gawk-4.1' # required for inplace support for .pro files formatter
+)
+DEPEND="${DEPEND[*]}"
+RDEPEND="${RDEPEND[*]}"
+
+RESTRICT+=' test'
+
+PLOCALES=( de es it ko nl pt_BR )
+inherit l10n
+
+CHECKREQS_DISK_BUILD='1G'
+inherit check-reqs
+
+TG_DIR="${S}/Telegram"
+TG_PRO="${TG_DIR}/Telegram.pro"
+
+# override qt5 path for use with eqmake5
+qt5_get_bindir() { echo "${QT5_PREFIX}/bin" ; }
+
+src_prepare-locales() {
+ local dir='Resources/langs' pre='lang_' post='.strings'
+ l10n_find_plocales_changes "${dir}" "${pre}" "${post}"
+ rm_loc() {
+ rm -v -f "${dir}/${pre}${1}${post}" || die
+ sed -e "\|${pre}${1}${post}|d" \
+ -i -- "${TG_PRO}" 'Resources/telegram.qrc' || die
+ }
+ l10n_for_each_disabled_locale_do rm_loc
+}
+
+src_prepare-delete_and_modify() {
+ local args
+
+ ## patch "${TG_PRO}"
+ args=(
+ # delete any references to local includes/libs
+ -e 's|^(.*[^ ]*/usr/local/[^ \\]* *\\?)|# local includes/libs # \1|'
+ # delete any hardcoded includes
+ -e 's|^(.*INCLUDEPATH *\+= *"/usr.*)|# hardcoded includes # \1|'
+ # delete any hardcoded libs
+ -e 's|^(.*LIBS *\+= *-l.*)|# hardcoded libs # \1|'
+ # delete refs to bundled Google Breakpad
+ -e 's|^(.*breakpad/src.*)|# Google Breakpad # \1|'
+ # delete refs to bundled minizip, Gentoo uses it's own patched version
+ -e 's|^(.*minizip.*)|# minizip # \1|'
+ # delete CUSTOM_API_ID defines, use default ID
+ -e 's|^(.*CUSTOM_API_ID.*)|# CUSTOM_API_ID # \1|'
+ # remove hardcoded flags
+ -e 's|^(.*QMAKE_[A-Z]*FLAGS.*)|# hardcoded flags # \1|'
+ # use release versions
+ -e 's:(.*)Debug(Style|Lang)(.*):\1Release\2\3 # Debug -> Release Style/Lang:g'
+ -e 's|(.*)/Debug(.*)|\1/Release\2 # Debug -> Release|g'
+ )
+ sed -r "${args[@]}" \
+ -i -- "${TG_PRO}" || die
+
+ ## nuke libunity references
+ args=(
+ # ifs cannot be deleted, so replace them with 0
+ -e 's|if *\( *_psUnityLauncherEntry *\)|if(0)|'
+ # this is probably not needed, but anyway
+ -e 's|noTryUnity *= *false,|noTryUnity = true,|'
+ # delete various refs and includes
+ -e 's:(.*(unity\.h|f_unity|ps_unity_|UnityLauncher).*):// \1:'
+ )
+ sed -r "${args[@]}" \
+ -i -- 'SourceFiles/pspecific_linux.cpp' || die
+
+ # patch c++ version, this was fixed in 0.9.52
+ sed -r -e 's|(CONFIG .*)c\+\+11|\1c++14|' \
+ -i -- *.pro || die
+}
+
+src_prepare-appends() {
+ # make sure there is at least one empty line at the end before adding anything
+ echo >> "${TG_PRO}"
+
+ printf '%s\n\n' '# --- EBUILD APPENDS BELOW ---' >> "${TG_PRO}" || die
+
+ ## add corrected dependencies back
+ local deps=( 'minizip' )
+ local libs=( "${deps[@]}"
+ 'lib'{avcodec,avformat,avutil,swresample,swscale}
+ 'openal' 'openssl' 'zlib' )
+ local includes=( "${deps[@]}" 'appindicator3-0.1' ) # TODO: dee-1.0
+
+ my_do() {
+ local x var="$1" flags="$2" transformer="$3" ; shift 3
+ for x in "${@}" ; do
+ printf '%s += ' "${var}" >>"${TG_PRO}" || die
+ pkg-config "${flags}" "${x}" | tr '\n' ' ' | eval "${transformer}" >>"${TG_PRO}"
+ assert
+ echo " # ${x}" >>"${TG_PRO}" || die
+ done
+ }
+ my_do INCLUDEPATH --cflags-only-I 'sed "s|-I||g"' "${includes[@]}"
+ my_do LIBS --libs 'cat' "${libs[@]}"
+}
+
+src_prepare() {
+ eapply_user
+
+ cd "${TG_DIR}" || die
+
+ rm -rf *.*proj* || die # delete Xcode/MSVS files
+ rm -rf ThirdParty || die # prevent accidentically using something from there
+
+ if [ -z "${QT_TELEGRAM_STATIC_SLOT}" ] ; then
+ local qtstatic='dev-qt/qt-telegram-static'
+ local qtstatic_PVR="$(best_version "${qtstatic}" | sed "s|.*${qtstatic}-||")"
+ local qtstatic_PV="${qtstatic_PVR%%-*}" # strip revision
+ declare -g QT_VER="${qtstatic_PV%%_p*}" QT_PATCH_DATE="${qtstatic_PV##*_p}"
+ declare -g QT_TELEGRAM_STATIC_SLOT="${QT_VER}/${QT_PATCH_DATE}"
+ else
+ einfo "Using QT_TELEGRAM_STATIC_SLOT from environment - '${QT_TELEGRAM_STATIC_SLOT}'"
+ declare -g QT_VER="${QT_TELEGRAM_STATIC_SLOT%%/*}" QT_PATCH_DATE="${QT_TELEGRAM_STATIC_SLOT##*/}"
+ fi
+
+ echo
+ einfo "${P} is going to be linked against 'Qt ${QT_VER} (p${QT_PATCH_DATE})'"
+ echo
+
+ if [[ $(get_version_component_range 2 ${QT_VER}) < 6 ]] ; then
+ ewarn "You've requested to link against Qt < 5.6.0, this will likely won't work"
+ fi
+
+ declare -g QT5_PREFIX="${EPREFIX}/opt/qt-telegram-static/${QT_TELEGRAM_STATIC_SLOT}"
+ [ -d "${QT5_PREFIX}" ] || die "QT5_PREFIX dir doesn't exist: '${QT5_PREFIX}'"
+
+ readonly QT_TELEGRAM_STATIC_SLOT QT_VER QT_PATCH_DATE
+
+ # This formatter converts multiline var defines to multiple lines.
+ # Such .pro files are then easier to debug and modify in src_prepare-delete_and_modify().
+ gawk -f "${FILESDIR}/format_pro.awk" -i inplace -- *.pro || die
+
+ src_prepare-locales
+ src_prepare-delete_and_modify
+ src_prepare-appends
+}
+
+src_configure() {
+ ## add flags previously stripped from "${TG_PRO}"
+ append-cxxflags '-fno-strict-aliasing' -std=c++14
+ # `append-ldflags '-rdynamic'` was stripped because it's used probably only for GoogleBreakpad
+ # which is not supported anyway
+
+ # care a little less about the unholy mess
+ append-cxxflags '-Wno-unused-'{function,parameter,variable,but-set-variable}
+ append-cxxflags '-Wno-switch'
+
+ # prefer patched qt
+ export PATH="$(qt5_get_bindir):${PATH}"
+
+ ( # disable updater
+ echo 'DEFINES += TDESKTOP_DISABLE_AUTOUPDATE'
+
+ # disable registering `tg://` scheme from within the app
+ echo 'DEFINES += TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME'
+
+ # https://github.com/telegramdesktop/tdesktop/commit/0b2bcbc3e93a7fe62889abc66cc5726313170be7
+ $(usex proxy 'DEFINES += TDESKTOP_DISABLE_NETWORK_PROXY' '')
+
+ # disable google-breakpad support
+ echo 'DEFINES += TDESKTOP_DISABLE_CRASH_REPORTS'
+ ) >>"${TG_PRO}" || die
+}
+
+my_eqmake5() {
+ local args=(
+ CONFIG+='release'
+ QT_TDESKTOP_VERSION="${QT_VER}"
+ QT_TDESKTOP_PATH="${QT5_PREFIX}"
+ )
+ eqmake5 "${args[@]}" "$@"
+}
+
+src_compile() {
+ local d module
+
+ for module in style numbers ; do # order of modules matters
+ d="${S}/Linux/obj/codegen_${module}/Release"
+ mkdir -v -p "${d}" && cd "${d}" || die
+
+ elog "Building: ${PWD/${S}\/}"
+ my_eqmake5 "${TG_DIR}/build/qmake/codegen_${module}/codegen_${module}.pro"
+ emake
+ done
+
+ for module in Lang ; do # order of modules matters
+ d="${S}/Linux/ReleaseIntermediate${module}"
+ mkdir -v -p "${d}" && cd "${d}" || die
+
+ elog "Building: ${PWD/${S}\/}"
+ my_eqmake5 "${TG_DIR}/Meta${module}.pro"
+ emake
+ done
+
+ d="${S}/Linux/ReleaseIntermediate"
+ mkdir -v -p "${d}" && cd "${d}" || die
+
+ elog "Preparing the main build ..."
+ # this qmake will fail to find "${TG_DIR}/GeneratedFiles/*", but it's required for ...
+ my_eqmake5 "${TG_PRO}"
+ # ... this make, which will generate those files
+ local targets=( $( awk '/^PRE_TARGETDEPS *\+=/ { $1=$2=""; print }' "${TG_PRO}" ) )
+ [ ${#targets[@]} -eq 0 ] && die
+ emake ${targets[@]}
+
+ # now we have everything we need, so let's begin!
+ elog "Building Telegram ..."
+ my_eqmake5 "${TG_PRO}"
+ emake
+}
+
+src_install() {
+ newbin "${S}/Linux/Release/Telegram" "${PN}"
+
+ local s
+ for s in 16 32 48 64 128 256 512 ; do
+ newicon -s ${s} "${TG_DIR}/Resources/art/icon${s}.png" "${PN}.png"
+ done
+
+ local make_desktop_entry_args
+ make_desktop_entry_args=(
+ "${EPREFIX}/usr/bin/${PN} %u" # exec
+ "${PN^}" # name
+ "${PN}" # icon
+ 'Network;InstantMessaging;Chat' # categories
+ )
+ make_desktop_entry_extras=(
+ 'MimeType=x-scheme-handler/tg;'
+ )
+ make_desktop_entry "${make_desktop_entry_args[@]}" \
+ "$( printf '%s\n' "${make_desktop_entry_extras[@]}" )"
+
+ einstalldocs
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+}

0 comments on commit 29e88af

Please sign in to comment.
Something went wrong with that request. Please try again.