fix build tree organization [release 0.9.33-2mamba;Wed Mar 16 2016]

This commit is contained in:
Silvan Calarco 2024-01-05 18:22:22 +01:00
parent f8b9cf640e
commit cce55633b0
5 changed files with 307 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# telegram
The official desktop client for the Telegram messenger.

View File

@ -0,0 +1,103 @@
--- tdesktop-0.9.32/Telegram/SourceFiles/pspecific_linux.cpp.orig 2016-03-15 20:39:00.061631172 +0100
+++ tdesktop-0.9.32/Telegram/SourceFiles/pspecific_linux.cpp 2016-03-15 20:33:31.281860615 +0100
@@ -40,7 +40,7 @@
}
#define signals public
-#include <unity/unity/unity.h>
+//#include <unity/unity/unity.h>
namespace {
QByteArray escapeShell(const QByteArray &str) {
@@ -188,7 +188,7 @@
typedef guint (*f_g_idle_add)(GSourceFunc function, gpointer data);
f_g_idle_add ps_g_idle_add = 0;
- typedef void (*f_unity_launcher_entry_set_count)(UnityLauncherEntry* self, gint64 value);
+/* typedef void (*f_unity_launcher_entry_set_count)(UnityLauncherEntry* self, gint64 value);
f_unity_launcher_entry_set_count ps_unity_launcher_entry_set_count = 0;
typedef void (*f_unity_launcher_entry_set_count_visible)(UnityLauncherEntry* self, gboolean value);
@@ -196,7 +196,7 @@
typedef UnityLauncherEntry* (*f_unity_launcher_entry_get_for_desktop_id)(const gchar* desktop_id);
f_unity_launcher_entry_get_for_desktop_id ps_unity_launcher_entry_get_for_desktop_id = 0;
-
+*/
template <typename TFunction>
bool loadFunction(QLibrary &lib, const char *name, TFunction &func) {
if (!lib.isLoaded()) return false;
@@ -469,7 +469,7 @@
DEBUG_LOG(("Status icon api loaded!"));
}
- void setupUnity() {
+/* void setupUnity() {
if (noTryUnity) return;
QLibrary lib_unity(qstr("unity"), 9, 0);
@@ -480,7 +480,7 @@
if (!loadFunction(lib_unity, "unity_launcher_entry_set_count_visible", ps_unity_launcher_entry_set_count_visible)) return;
useUnityCount = true;
DEBUG_LOG(("Unity count api loaded!"));
- }
+ }*/
class _PsEventFilter : public QAbstractNativeEventFilter {
public:
@@ -496,7 +496,7 @@
};
_PsEventFilter *_psEventFilter = 0;
- UnityLauncherEntry *_psUnityLauncherEntry = 0;
+// UnityLauncherEntry *_psUnityLauncherEntry = 0;
};
PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent),
@@ -624,14 +624,14 @@
int32 counter = App::histories().unreadBadge();
setWindowTitle((counter > 0) ? qsl("Telegram (%1)").arg(counter) : qsl("Telegram"));
- if (_psUnityLauncherEntry) {
+/* if (_psUnityLauncherEntry) {
if (counter > 0) {
ps_unity_launcher_entry_set_count(_psUnityLauncherEntry, (counter > 9999) ? 9999 : counter);
ps_unity_launcher_entry_set_count_visible(_psUnityLauncherEntry, TRUE);
} else {
ps_unity_launcher_entry_set_count_visible(_psUnityLauncherEntry, FALSE);
}
- }
+ }*/
if (noQtTrayIcon) {
if (useAppIndicator) {
@@ -828,7 +828,7 @@
void PsMainWindow::psFirstShow() {
psCreateTrayIcon();
- if (useUnityCount) {
+/* if (useUnityCount) {
_psUnityLauncherEntry = ps_unity_launcher_entry_get_for_desktop_id("telegramdesktop.desktop");
if (_psUnityLauncherEntry) {
LOG(("Found Unity Launcher entry telegramdesktop.desktop!"));
@@ -840,9 +840,9 @@
LOG(("Could not get Unity Launcher entry!"));
}
}
- } else {
+ } else {*/
LOG(("Not using Unity Launcher count."));
- }
+/* }*/
finished = false;
@@ -1256,7 +1256,7 @@
DEBUG_LOG(("Loading libraries"));
setupGtk();
- setupUnity();
+ //setupUnity();
}
void finish() {

179
telegram.spec Normal file
View File

@ -0,0 +1,179 @@
%define qt_ver 5.5.1
%define qt_patchver %(echo %qt_ver | tr . _)
%define qt_majver %(echo %qt_ver | cut -d. -f1-2)
Name: telegram
Version: 0.9.33
Release: 2mamba
Summary: The official desktop client for the Telegram messenger
Group: Graphical Desktop/Applications/Internet
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://telegram.org/
## GITSOURCE https://github.com/telegramdesktop/tdesktop.git v0.9.32
Source: https://github.com/telegramdesktop/tdesktop.git/v%{version}/tdesktop-%{version}.tar.bz2
Source1: telegramdesktop.desktop
Source2: tg.protocol
Source3: http://download.qt-project.org/official_releases/qt/%{qt_majver}/%{qt_ver}/single/qt-everywhere-opensource-src-%{qt_ver}.tar.xz
Patch0: telegram-0.9.32-disable-unity.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libGL-devel
BuildRequires: libICE-devel
BuildRequires: libSM-devel
BuildRequires: libX11-devel
BuildRequires: libXext-devel
BuildRequires: libXi-devel
BuildRequires: libavcodec-ffmpeg-devel
BuildRequires: libavformat-ffmpeg-devel
BuildRequires: libavutil-ffmpeg-devel
BuildRequires: libfontconfig-devel
BuildRequires: libfreetype-devel
BuildRequires: libgcc
BuildRequires: libglib-devel
BuildRequires: libicu-devel
BuildRequires: libinput-devel
BuildRequires: libjasper-devel
BuildRequires: liblzma-devel
BuildRequires: libmng-devel
BuildRequires: libmtdev-devel
BuildRequires: libopenal-devel
BuildRequires: libopenssl-devel
BuildRequires: libopus-devel
BuildRequires: libproxy-devel
BuildRequires: libstdc++6-devel
BuildRequires: libswresample-ffmpeg-devel
BuildRequires: libswscale-ffmpeg-devel
BuildRequires: libtiff-devel
BuildRequires: libts-devel
BuildRequires: libudev-devel
BuildRequires: libva-devel
BuildRequires: libwebp-devel
BuildRequires: libxcb-devel
BuildRequires: libxkbcommon-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
Requires: kconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
The official desktop client for the Telegram messenger.
%debug_package
%prep
%setup -q -c -a0 -a3
#% setup -q -c -D -T
#:<< _EOF
git clone https://chromium.googlesource.com/breakpad/breakpad breakpad
git clone https://chromium.googlesource.com/linux-syscall-support breakpad-lss
mkdir -p Libraries
mv qt-everywhere-opensource-src-%{qt_ver} Libraries/QtStatic
cd Libraries/QtStatic/qtbase
patch -p1 < ../../../tdesktop-%{version}/Telegram/_qtbase_%{qt_patchver}_patch.diff
cd ../../..
if [ ! -h Libraries/breakpad ]; then
ln -s ../breakpad Libraries/breakpad
ln -s ../../../breakpad-lss Libraries/breakpad/src/third_party/lss
fi
cd tdesktop-%{version}
%patch0 -p1
sed -i 's/CUSTOM_API_ID//g' Telegram/Telegram.pro
sed -i 's,LIBS += /usr/local/lib/libxkbcommon.a,,g' Telegram/Telegram.pro
sed -i 's,LIBS += /usr/local/lib/libz.a,LIBS += -lz,g' Telegram/Telegram.pro
(
echo "DEFINES += TDESKTOP_DISABLE_AUTOUPDATE"
echo "DEFINES += TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME"
echo 'INCLUDEPATH += "%{_libdir}/glib-2.0/include"'
echo 'INCLUDEPATH += "%{_libdir}/gtk-2.0/include"'
echo 'INCLUDEPATH += "%{_includedir}/opus"'
echo 'LIBS += -lcrypto -lssl'
) >> Telegram/Telegram.pro
%build
# Build patched Qt
cd Libraries/QtStatic
./configure -prefix "%{_builddir}/telegram-%{version}/qt" -release -opensource -confirm-license -qt-zlib \
-qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb \
-qt-xkbcommon-x11 -no-opengl -static -nomake examples -nomake tests
%make module-qtbase module-qtimageformats
%make module-qtbase-install_subtargets module-qtimageformats-install_subtargets
cd ../..
# also add /usr/bin to disable icecc
export PATH="%{_builddir}/telegram-%{version}/qt/bin:/usr/bin:$PATH"
# Build breakpad
cd Libraries/breakpad
./configure
%make
cd ../..
cd tdesktop-%{version}
# Build MetaStyle
mkdir -p Linux/DebugIntermediateStyle
cd Linux/DebugIntermediateStyle
qmake CONFIG+=debug "../../Telegram/MetaStyle.pro"
%make
cd ../..
# Build MetaLang
mkdir -p Linux/DebugIntermediateLang
cd Linux/DebugIntermediateLang
qmake CONFIG+=debug "../../Telegram/MetaLang.pro"
%make
cd ../..
# Build Telegram Desktop
mkdir -p Linux/ReleaseIntermediate
cd Linux/ReleaseIntermediate
qmake CONFIG+=release ../../Telegram/Telegram.pro
pattern="^PRE_TARGETDEPS +="
grep "$pattern" ../../Telegram/Telegram.pro | sed "s/$pattern//g" | xargs make
qmake CONFIG+=release ../../Telegram/Telegram.pro
%make
cd ../..
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
cd tdesktop-%{version}
install -D -m755 Linux/Release/Telegram %{buildroot}%{_bindir}/telegram-desktop
install -D -m644 %{SOURCE1} %{buildroot}%{_datadir}/applications/telegram-desktop.desktop
install -D -m644 %{SOURCE2} %{buildroot}%{_kde4_servicesdir}/tg.protocol
for icon_size in 16 32 48 64 128 256 512; do
icon_dir="%{buildroot}%{_datadir}/icons/hicolor/${icon_size}x${icon_size}/apps"
install -D -m644 Telegram/SourceFiles/art/icon${icon_size}.png $icon_dir/telegram-desktop.png
done
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_kde4_servicesdir}/tg.protocol
%{_bindir}/telegram-desktop
%{_datadir}/applications/telegram-desktop.desktop
%{_datadir}/icons/hicolor/*/apps/telegram-desktop.png
%doc tdesktop-%{version}/LICENSE
%changelog
* Wed Mar 16 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.33-2mamba
- fix build tree organization
* Wed Mar 16 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.33-1mamba
- update to 0.9.33
* Tue Mar 15 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.32-1mamba
- package created using the webbuild interface

12
telegramdesktop.desktop Normal file
View File

@ -0,0 +1,12 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
Exec=/usr/bin/telegram-desktop -- %u
Icon=telegram-desktop
Terminal=false
StartupWMClass=telegram-desktop
Type=Application
Categories=Network;
MimeType=application/x-xdg-protocol-tg;x-scheme-handler/tg;

11
tg.protocol Normal file
View File

@ -0,0 +1,11 @@
[Protocol]
exec=/usr/bin/telegram-desktop -- %u
protocol=tg
input=none
output=none
helper=true
listing=false
reading=false
writing=false
makedir=false
deleting=false