summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ffc667686c2bb0602ab94b286e4813ae7a005baa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Maintainer:
# Contributor: Peter Jung ptr1337 <admin@ptr1337.dev>
# Contributor: SoulHarsh007 <admin@soulharsh007.dev>
# Contributor: MedzikUser <nivua1fn@duck.com>

_pkgname="forkgram"
pkgname="$_pkgname"
pkgver=5.8.3
pkgrel=1
pkgdesc="Fork of the Telegram Desktop messaging app"
url="https://github.com/Forkgram/tdesktop"
license=('GPL-3.0-or-later')
arch=('x86_64')

depends=(
  ada
  ffmpeg
  hunspell
  jemalloc
  kcoreaddons
  libdispatch
  libpipewire
  libvpx
  libxcomposite
  libxdamage
  libxrandr
  libxtst
  minizip
  openal
  openh264
  opus
  protobuf
  qt6-base
  qt6-declarative
  qt6-svg
  qt6-wayland
  rnnoise
  xcb-util-keysyms
  xxhash
)
makedepends=(
  boost
  cmake
  extra-cmake-modules
  fmt
  git
  glib2-devel
  gobject-introspection
  libtg_owt
  microsoft-gsl
  mm-common
  ninja
  perl-xml-parser
  plasma-wayland-protocols
  python
  python-packaging
  range-v3
  tl-expected
  wayland-protocols
)
optdepends=(
  'webkit2gtk: embedded browser features'
  'xdg-desktop-portal: desktop integration'
)

conflicts=("forkgram-bin")

options=('!debug' '!emptydirs')

_pkgsrc="frk-v$pkgver-full"
_pkgext="tar.gz"
source=(
  "$_pkgname-$pkgver.$_pkgext"::"https://github.com/Forkgram/tdesktop/releases/download/v$pkgver/$_pkgsrc.$_pkgext"
)
sha256sums=(
  'e30c18a7eed6ab5cc7abbd3633ca73d5f5ae0407688412dac93f1f2ec258036e'
)

build() {
  local _cmake_options=(
    -B build
    -S "$_pkgsrc"
    -G Ninja
    -DCMAKE_BUILD_TYPE=None
    -DCMAKE_INSTALL_PREFIX=/usr
    -DDESKTOP_APP_DISABLE_AUTOUPDATE=ON
    -DTDESKTOP_API_TEST=ON
    -DTDESKTOP_API_ID=611335
    -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
    -DDESKTOP_APP_USE_PACKAGED_FONTS=OFF
    -Wno-dev
  )

  cmake "${_cmake_options[@]}"
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  # remove unwanted files
  find "$pkgdir/usr/share/icons" -name '*.png' -delete
  find "$pkgdir/usr/share/icons" -name '*.svg' -delete
  rm "$pkgdir/usr/share/applications/org.telegram.desktop.desktop"
  rm "$pkgdir/usr/share/metainfo/org.telegram.desktop.metainfo.xml"
  rm "$pkgdir/usr/share/dbus-1/services/org.telegram.desktop.service"

  # rename executable
  mv -v "$pkgdir"/usr/bin/{telegram-desktop,"$_pkgname"}

  # icon
  install -Dm644 "$srcdir/$_pkgsrc/Telegram/Resources/art/forkgram/logo_256.png" "$pkgdir/usr/share/pixmaps/$_pkgname.png"

  # service
  install -Dm644 /dev/stdin "$pkgdir/usr/share/dbus-1/services/forkgram.service" << END
[D-BUS Service]
Name=org.telegram.desktop
Exec=/usr/bin/$_pkgname
END

  # .desktop
  install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/$_pkgname.desktop" << END
[Desktop Entry]
Name=${_pkgname^}
Comment=$pkgdesc
TryExec=$_pkgname
Exec=$_pkgname -- %u
Icon=$_pkgname
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Chat;Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;x-scheme-handler/tonsite;
Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;$_pkgname
Actions=quit;
DBusActivatable=true
SingleMainWindow=true
X-GNOME-UsesNotifications=true
X-GNOME-SingleWindow=true

[Desktop Action quit]
Exec=$_pkgname -quit
Name=Quit ${_pkgname^}
Icon=application-exit
END
}