tdesktop: 0.9.49 -> 0.9.56
This commit is contained in:
parent
323eb06499
commit
f990abb801
@ -9,18 +9,40 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
/* Find the index of the first element in the list matching the specified
|
||||||
|
predicate or returns null if no such element exists.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
findFirstIndex (x: x > 3) [ 1 6 4 ]
|
||||||
|
=> 1
|
||||||
|
*/
|
||||||
|
findFirstIndex = pred: list:
|
||||||
|
# Poor man's Either via a list.
|
||||||
|
let searchFun = old: curr:
|
||||||
|
if lib.isList old then old
|
||||||
|
else if pred curr then [old]
|
||||||
|
else old + 1;
|
||||||
|
res = lib.foldl searchFun 0 list;
|
||||||
|
in if lib.isList res then lib.elemAt res 0 else null;
|
||||||
|
|
||||||
|
extractVersion = ver:
|
||||||
|
let suffix = findFirstIndex (x: x == "-") (lib.stringToCharacters ver);
|
||||||
|
in if suffix == null then ver else lib.substring 0 suffix ver;
|
||||||
|
|
||||||
system-x86_64 = lib.elem stdenv.system lib.platforms.x86_64;
|
system-x86_64 = lib.elem stdenv.system lib.platforms.x86_64;
|
||||||
packagedQt = "5.6.0";
|
packagedQt = "5.6.0";
|
||||||
|
systemQt = extractVersion qtbase.version;
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
name = "telegram-desktop-${version}";
|
name = "telegram-desktop-${version}";
|
||||||
version = "0.9.49";
|
version = "0.9.56";
|
||||||
qtVersion = lib.replaceStrings ["."] ["_"] packagedQt;
|
qtVersion = lib.replaceStrings ["."] ["_"] packagedQt;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "telegramdesktop";
|
owner = "telegramdesktop";
|
||||||
repo = "tdesktop";
|
repo = "tdesktop";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "1smz0d07xcpv7kv5v739b5a8wrgv5fx0wy15d3zzm3s69418a6nc";
|
sha256 = "000ngg6arfb6mif0hvin099f83q3sn7mw4vfvrikskczblw3a5lc";
|
||||||
};
|
};
|
||||||
|
|
||||||
tgaur = fetchgit {
|
tgaur = fetchgit {
|
||||||
@ -60,6 +82,7 @@ in stdenv.mkDerivation rec {
|
|||||||
"INCLUDEPATH+=${dee}/include/dee-1.0"
|
"INCLUDEPATH+=${dee}/include/dee-1.0"
|
||||||
"INCLUDEPATH+=${libdbusmenu-glib}/include/libdbusmenu-glib-0.4"
|
"INCLUDEPATH+=${libdbusmenu-glib}/include/libdbusmenu-glib-0.4"
|
||||||
"INCLUDEPATH+=${breakpad}/include/breakpad"
|
"INCLUDEPATH+=${breakpad}/include/breakpad"
|
||||||
|
"QT_TDESKTOP_VERSION=${systemQt}"
|
||||||
"LIBS+=-lcrypto"
|
"LIBS+=-lcrypto"
|
||||||
"LIBS+=-lssl"
|
"LIBS+=-lssl"
|
||||||
];
|
];
|
||||||
@ -74,14 +97,14 @@ in stdenv.mkDerivation rec {
|
|||||||
patchPhase
|
patchPhase
|
||||||
sed -i 'Telegram/Telegram.pro' \
|
sed -i 'Telegram/Telegram.pro' \
|
||||||
-e 's,CUSTOM_API_ID,,g' \
|
-e 's,CUSTOM_API_ID,,g' \
|
||||||
-e "s,/usr/local/tdesktop/Qt-[^/]*,$PWD/../qt,g" \
|
|
||||||
-e 's,/usr,/does-not-exist,g' \
|
-e 's,/usr,/does-not-exist,g' \
|
||||||
-e '/LIBS += .*libxkbcommon.a/d' \
|
-e '/LIBS += .*libxkbcommon.a/d' \
|
||||||
-e 's,LIBS += .*libz.a,LIBS += -lz,' \
|
-e 's,LIBS += .*libz.a,LIBS += -lz,' \
|
||||||
-e 's,LIBS += .*libbreakpad_client.a,LIBS += ${breakpad}/lib/libbreakpad_client.a,' \
|
-e 's,LIBS += .*libbreakpad_client.a,LIBS += ${breakpad}/lib/libbreakpad_client.a,' \
|
||||||
-e 's, -flto,,g' \
|
-e 's, -flto,,g' \
|
||||||
-e 's, -static-libstdc++,,g' \
|
-e 's, -static-libstdc++,,g'
|
||||||
-e 's,${packagedQt},${qtbase.version},g'
|
|
||||||
|
export qmakeFlags="$qmakeFlags QT_TDESKTOP_PATH=$PWD/../qt"
|
||||||
|
|
||||||
export QMAKE=$PWD/../qt/bin/qmake
|
export QMAKE=$PWD/../qt/bin/qmake
|
||||||
( mkdir -p ../Libraries
|
( mkdir -p ../Libraries
|
||||||
@ -90,7 +113,8 @@ in stdenv.mkDerivation rec {
|
|||||||
tar -xaf $i
|
tar -xaf $i
|
||||||
done
|
done
|
||||||
cd qtbase-*
|
cd qtbase-*
|
||||||
patch -p1 < ../../$sourceRoot/Telegram/Patches/qtbase_${qtVersion}.diff
|
# This patch is outdated but the fixes doesn't feel very important
|
||||||
|
patch -p1 < ../../$sourceRoot/Telegram/Patches/qtbase_${qtVersion}.diff || true
|
||||||
for i in $qtPatches; do
|
for i in $qtPatches; do
|
||||||
patch -p1 < $i
|
patch -p1 < $i
|
||||||
done
|
done
|
||||||
@ -121,17 +145,17 @@ in stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
( mkdir -p Linux/obj/codegen_style/Debug
|
( mkdir -p Linux/obj/codegen_style/Debug
|
||||||
cd Linux/obj/codegen_style/Debug
|
cd Linux/obj/codegen_style/Debug
|
||||||
$QMAKE CONFIG+=debug ../../../../Telegram/build/qmake/codegen_style/codegen_style.pro
|
$QMAKE $qmakeFlags ../../../../Telegram/build/qmake/codegen_style/codegen_style.pro
|
||||||
buildPhase
|
buildPhase
|
||||||
)
|
)
|
||||||
( mkdir -p Linux/obj/codegen_numbers/Debug
|
( mkdir -p Linux/obj/codegen_numbers/Debug
|
||||||
cd Linux/obj/codegen_numbers/Debug
|
cd Linux/obj/codegen_numbers/Debug
|
||||||
$QMAKE CONFIG+=debug ../../../../Telegram/build/qmake/codegen_numbers/codegen_numbers.pro
|
$QMAKE $qmakeFlags ../../../../Telegram/build/qmake/codegen_numbers/codegen_numbers.pro
|
||||||
buildPhase
|
buildPhase
|
||||||
)
|
)
|
||||||
( mkdir -p Linux/DebugIntermediateLang
|
( mkdir -p Linux/DebugIntermediateLang
|
||||||
cd Linux/DebugIntermediateLang
|
cd Linux/DebugIntermediateLang
|
||||||
$QMAKE CONFIG+=debug ../../Telegram/MetaLang.pro
|
$QMAKE $qmakeFlags ../../Telegram/MetaLang.pro
|
||||||
buildPhase
|
buildPhase
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user