diff options
author | Michael Weiss <dev.primeos@gmail.com> | 2018-03-21 22:08:22 +0100 |
---|---|---|
committer | Michael Weiss <dev.primeos@gmail.com> | 2018-03-22 00:43:30 +0100 |
commit | f60d7e2add2906a50615045599c83087b90ff130 (patch) | |
tree | dc4863a5ecfe4b77bf37a677bedf7fe6da8047ef /pkgs/applications/networking/instant-messengers | |
parent | 0477af8a09da7eeca751542f4293b5b6f95366cb (diff) | |
download | nixlib-f60d7e2add2906a50615045599c83087b90ff130.tar nixlib-f60d7e2add2906a50615045599c83087b90ff130.tar.gz nixlib-f60d7e2add2906a50615045599c83087b90ff130.tar.bz2 nixlib-f60d7e2add2906a50615045599c83087b90ff130.tar.lz nixlib-f60d7e2add2906a50615045599c83087b90ff130.tar.xz nixlib-f60d7e2add2906a50615045599c83087b90ff130.tar.zst nixlib-f60d7e2add2906a50615045599c83087b90ff130.zip |
tdesktop: Clean up the patching
Diffstat (limited to 'pkgs/applications/networking/instant-messengers')
-rw-r--r-- | pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix | 6 | ||||
-rw-r--r-- | pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix | 52 |
2 files changed, 28 insertions, 30 deletions
diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix index 134066cd352a..adf718a70ea1 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix @@ -6,10 +6,16 @@ in { stable = true; version = "1.2.6"; sha256Hash = "15g0m2wwqfp13wd7j31p8cx1kpylx5m8ljaksnsqdkgyr9l1ar8w"; + # svn log svn://svn.archlinux.org/community/telegram-desktop/trunk + archPatchesRevision = "283641"; + archPatchesHash = "0v4213vrabfa2dmwnqgb8n6hl54938mw9glaim3amyslxphmdrfb"; }; preview = mkTelegram { stable = false; version = "1.2.12"; sha256Hash = "1b9qc4a14jqjl30z4bjh1zbqsmgl25kdp0hj8p7xbj34zlkzfw5m"; + # svn ls -v --depth empty svn://svn.archlinux.org/community/telegram-desktop/trunk + archPatchesRevision = "308775"; + archPatchesHash = "0ggx64kdadrbd4bw5z0wi0fdg6hni7n9nxz9dp56p8hlw1wgpsls"; }; } diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix index a165e90c3bdc..89bc3da56b8a 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix @@ -1,6 +1,6 @@ -{ stable, version, sha256Hash }: +{ stable, version, sha256Hash, archPatchesRevision, archPatchesHash }: -{ mkDerivation, lib, fetchgit, fetchpatch +{ mkDerivation, lib, fetchgit, fetchsvn , pkgconfig, pythonPackages, cmake, makeWrapper , qtbase, qtimageformats, gtk3, libappindicator-gtk3, libnotify , dee, ffmpeg, openalSoft, minizip, libopus, alsaLib, libpulseaudio, range-v3 @@ -12,7 +12,7 @@ mkDerivation rec { name = "telegram-desktop-${version}"; inherit version; - # Submodules + # Telegram-Desktop with submodules src = fetchgit { url = "git://github.com/telegramdesktop/tdesktop"; rev = "v${version}"; @@ -20,29 +20,21 @@ mkDerivation rec { fetchSubmodules = true; }; - # TODO: Not active anymore. - tgaur = fetchgit { - url = "https://aur.archlinux.org/telegram-desktop-systemqt.git"; - rev = "1ed27ce40913b9e6e87faf7a2310660c2790b98e"; - sha256 = "1i7ipqgisaw54g1nbg2cvpbx89g9gyjjb3sak1486pxsasp1qhyc"; + # Arch patches (svn export telegram-desktop/trunk) + archPatches = fetchsvn { + url = "svn://svn.archlinux.org/community/telegram-desktop/trunk"; + rev = archPatchesRevision; + sha256 = archPatchesHash; }; - patches = [ (if stable - then (fetchpatch { - name = "tdesktop.patch"; - url = "https://git.archlinux.org/svntogit/community.git/plain/repos/community-x86_64/tdesktop.patch?h=packages/telegram-desktop&id=f0eefac36f529295f8b065a14b6d5f1a51d7614d"; - sha256 = "1a4wap5xnp6zn4913r3zdpy6hvkcfxcy4zzimy7fwzp7iwy20iqa"; - }) - else (fetchpatch { - name = "tdesktop.patch"; - url = "https://git.archlinux.org/svntogit/community.git/plain/repos/community-x86_64/tdesktop.patch?h=packages/telegram-desktop&id=59ca8bd4428cf2fb3f02d7f1e1a5558545a4c075"; - sha256 = "0jj2kifzx83f9nhk30csy2373avpyx0ci70a8bc7j2dm3wxym50l"; - })) - ]; + # TODO: libtgvoip.patch no-gtk2.patch + patches = [ "${archPatches}/tdesktop.patch" ]; postPatch = '' - substituteInPlace Telegram/SourceFiles/platform/linux/linux_libs.cpp --replace '"appindicator"' '"${libappindicator-gtk3}/lib/libappindicator3.so"' - substituteInPlace Telegram/SourceFiles/platform/linux/linux_libnotify.cpp --replace '"notify"' '"${libnotify}/lib/libnotify.so"' + substituteInPlace Telegram/SourceFiles/platform/linux/linux_libs.cpp \ + --replace '"appindicator"' '"${libappindicator-gtk3}/lib/libappindicator3.so"' + substituteInPlace Telegram/SourceFiles/platform/linux/linux_libnotify.cpp \ + --replace '"notify"' '"${libnotify}/lib/libnotify.so"' ''; nativeBuildInputs = [ pkgconfig pythonPackages.gyp cmake makeWrapper ]; @@ -61,8 +53,8 @@ mkDerivation rec { ]; NIX_CFLAGS_COMPILE = [ - "-DTDESKTOP_DISABLE_AUTOUPDATE" "-DTDESKTOP_DISABLE_CRASH_REPORTS" + "-DTDESKTOP_DISABLE_AUTOUPDATE" "-DTDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" "-I${minizip}/include/minizip" # See Telegram/gyp/qt.gypi @@ -74,13 +66,12 @@ mkDerivation rec { "-I${getDev libopus}/include/opus" "-I${getDev alsaLib}/include/alsa" "-I${getDev libpulseaudio}/include/pulse" - ]) [ "QtCore" "QtGui" "QtDBus" ]; + ]) [ "QtCore" "QtGui" "QtDBus" ]; CPPFLAGS = NIX_CFLAGS_COMPILE; preConfigure = '' - pushd "Telegram/ThirdParty/libtgvoip" - patch -Np1 -i "${tgaur}/libtgvoip.patch" + patch -Np1 -i "${archPatches}/libtgvoip.patch" popd sed -i Telegram/gyp/telegram_linux.gypi \ @@ -102,22 +93,23 @@ mkDerivation rec { --depth=Telegram/gyp \ --generator-output=../.. \ -Goutput_dir=out \ - --format=cmake \ + --format=cmake \ Telegram/gyp/Telegram.gyp cd out/Release NUM=$((`wc -l < CMakeLists.txt` - 2)) - sed -i "$NUM r $tgaur/CMakeLists.inj" CMakeLists.txt + sed -i "$NUM r $archPatches/CMakeLists.inj" CMakeLists.txt export ASM=$(type -p gcc) ''; installPhase = '' install -Dm755 Telegram $out/bin/telegram-desktop + mkdir -p $out/share/applications $out/share/kde4/services - sed "s,/usr/bin,$out/bin,g" $tgaur/telegram-desktop.desktop > $out/share/applications/telegram-desktop.desktop - sed "s,/usr/bin,$out/bin,g" $tgaur/tg.protocol > $out/share/kde4/services/tg.protocol + install -m444 "$src/lib/xdg/telegramdesktop.desktop" "$out/share/applications/telegram-desktop.desktop" + sed "s,/usr/bin,$out/bin,g" $archPatches/tg.protocol > $out/share/kde4/services/tg.protocol for icon_size in 16 32 48 64 128 256 512; do install -Dm644 "../../../Telegram/Resources/art/icon''${icon_size}.png" "$out/share/icons/hicolor/''${icon_size}x''${icon_size}/apps/telegram-desktop.png" done |