summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 95bbc71b5d898e77a9fb28a3b35717f00078859b (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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Maintainer:
# Contributor: Nathan Loewen <loewen.nathan@gmail.com>
# Contributor: Christian Hesse <mail@eworm.de>

## links
# https://www.freerdp.com/
# https://github.com/FreeRDP/FreeRDP

## options
: ${_build_sdl3:=false}

_pkgname="freerdp"
pkgname="$_pkgname-git"
pkgver=3.12.0.r53.g11e980a
pkgrel=1
pkgdesc="Free implementation of the Remote Desktop Protocol (RDP)"
url="https://github.com/FreeRDP/FreeRDP"
license=('Apache-2.0')
arch=('i686' 'x86_64')

depends=(
  fuse3
  uriparser
  libcups
  libx11
  libxcursor
  libxdamage
  libxext
  libxfixes
  libxi
  libxinerama
  libxkbcommon
  libxkbfile
  libxrandr
  libxrender
  libxtst
  pcsclite
  pkcs11-helper
  sdl2
  sdl2_ttf
  wayland
)
makedepends=(
  alsa-lib
  cjson
  cmake
  e2fsprogs
  ffmpeg
  git
  icu
  krb5
  libjpeg-turbo
  libp11
  libpng
  libpulse
  libusb
  libwebp
  ninja
  openssl
  pam
  zlib
)

if [[ "${_build_sdl3::1}" == "t" ]]; then
  depends+=(
    sdl3
    sdl3_ttf
  )
fi

_libver=${pkgver/.*/}
provides=(
  "$_pkgname=2:${pkgver%.r*}"
  libfreerdp$_libver.so
  libfreerdp-client$_libver.so
  libfreerdp-server$_libver
  libfreerdp-server-proxy$_libver.so
  libfreerdp-shadow$_libver.so
  libfreerdp-shadow-subsystem$_libver.so
  libwinpr$_libver.so
  libwinpr-tools$_libver.so
)
conflicts=("$_pkgname")

_pkgsrc="$_pkgname"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
  # allow None build type
  sed -E -e '/SUPPORTED_BUILD_TYPES/s/Debug/None/' -i "$_pkgsrc/cmake/CommonConfigOptions.cmake"

  # fix check_ipo_supported
  sed -E -e '/check_ipo_supported/s/\)/ LANGUAGES C)/' -i "$_pkgsrc/cmake/CommonConfigOptions.cmake"

  if [ "${_build_sdl3::1}" != "t" ]; then
    sed -E -e 's&^.*find_package\(SDL3\).*$&set(SDL3_FOUND OFF)&' -i "$_pkgsrc/client/SDL/CMakeLists.txt"
  fi
}

build() {
  local _cmake_options=(
    -B build
    -S "$_pkgsrc"
    -G Ninja
    -DCMAKE_BUILD_TYPE=None
    -DCMAKE_INSTALL_PREFIX='/usr'
    -DCMAKE_INSTALL_LIBDIR='lib'
    -DCMAKE_SKIP_INSTALL_RPATH=ON
    -DCHANNEL_RDPECAM_CLIENT=ON
    -DCHANNEL_URBDRC_CLIENT=ON
    -DPROXY_PLUGINDIR="/usr/lib/$_pkgname/server/proxy/plugins"
    -DRDTK_FORCE_STATIC_BUILD=ON # prevent file conflicts with freerdp2
    -DUWAC_FORCE_STATIC_BUILD=ON # prevent file conflicts with freerdp2
    -DWINPR_UTILS_IMAGE_JPEG=ON
    -DWINPR_UTILS_IMAGE_PNG=ON
    -DWINPR_UTILS_IMAGE_WEBP=ON
    -DWITH_ALSA=ON
    -DWITH_BINARY_VERSIONING=ON # prevent file conflicts with freerdp2
    -DWITH_CHANNELS=ON
    -DWITH_CLIENT_CHANNELS=ON
    -DWITH_CUPS=ON
    -DWITH_DSP_FFMPEG=ON
    -DWITH_FFMPEG=ON
    -DWITH_FUSE=ON
    -DWITH_ICU=ON
    -DWITH_JPEG=ON
    -DWITH_PCSC=ON
    -DWITH_PULSE=ON
    -DWITH_SERVER=ON
    -DWITH_SERVER_CHANNELS=ON
    -DWITH_SWSCALE=ON
    -DWITH_SYSTEMD=ON
    -DWITH_VERBOSE_WINPR_ASSERT=OFF
    -DWITH_WAYLAND=ON
    -DWITH_WINPR_TOOLS=ON
    -DWITH_X11=ON
    -DBUILD_TESTING=OFF
    -Wno-dev
  )

  if [ "${_build_sdl3::1}" != "t" ]; then
    _cmake_options+=(-DWITH_CLIENT_SDL3=OFF)
  fi

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

check() {
  ctest --test-dir build --output-on-failure || true
}

package() {
  depends+=(
    alsa-lib libasound.so
    e2fsprogs libcom_err.so
    ffmpeg libavcodec.so libavutil.so libswresample.so libswscale.so
    icu libicuuc.so
    json-c libjson-c.so
    krb5 libk5crypto.so libkrb5.so
    libjpeg-turbo libjpeg.so
    libpng libpng16.so
    libpulse libpulse.so
    libusb libusb-1.0.so
    libwebp libwebp.so
    openssl libcrypto.so libssl.so
    pam libpam.so
    zlib libz.so
  )

  DESTDIR="$pkgdir" cmake --install build
}