Skip to content

Commit

Permalink
app-mobilephone/scrcpy: fix bash-completion
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/925435
Signed-off-by: Bernard Cafarelli <[email protected]>
  • Loading branch information
voyageur committed Feb 28, 2024
1 parent a8c2356 commit 5c7e444
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app-mobilephone/scrcpy/files/scrcpy-2.3.1-bash-completion.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/app/data/bash-completion/scrcpy b/app/data/bash-completion/scrcpy
index 0c8543107..694ce1899 100644
--- a/app/data/bash-completion/scrcpy
+++ b/app/data/bash-completion/scrcpy
@@ -115,13 +115,13 @@ _scrcpy() {
COMPREPLY=($(compgen -W 'front back external' -- "$cur"))
return
;;
- --orientation
- --display-orientation)
- COMPREPLY=($(compgen -> '0 90 180 270 flip0 flip90 flip180 flip270' -- "$cur"))
+ --orientation \
+ |--display-orientation)
+ COMPREPLY=($(compgen -W '0 90 180 270 flip0 flip90 flip180 flip270' -- "$cur"))
return
;;
--record-orientation)
- COMPREPLY=($(compgen -> '0 90 180 270' -- "$cur"))
+ COMPREPLY=($(compgen -W '0 90 180 270' -- "$cur"))
return
;;
--lock-video-orientation)
47 changes: 47 additions & 0 deletions app-mobilephone/scrcpy/scrcpy-2.3.1-r2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit meson xdg

DESCRIPTION="Display and control your Android device"
HOMEPAGE="https://github.com/Genymobile/scrcpy"
# Source code and server part on Android device
SRC_URI="
https://github.com/Genymobile/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
https://github.com/Genymobile/${PN}/releases/download/v${PV}/${PN}-server-v${PV}
"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~ppc64 ~x86"

DEPEND="
media-libs/libsdl2[X]
media-video/ffmpeg:=
virtual/libusb:1
"
# Manual install for ppc64 until bug #723528 is fixed
RDEPEND="
${DEPEND}
!ppc64? ( dev-util/android-tools )
"

PATCHES=( "${FILESDIR}"/${P}-bash-completion.patch )

src_configure() {
local emesonargs=(
-Dprebuilt_server="${DISTDIR}/${PN}-server-v${PV}"
)
meson_src_configure
}

pkg_postinst() {
xdg_pkg_postrm

einfo "If you use pipewire because of a problem with libsdl2 it is possible that"
einfo "scrcpy will not start, in which case start the program by exporting the"
einfo "environment variable SDL_AUDIODRIVER=pipewire."
einfo "For more information see https://github.com/Genymobile/scrcpy/issues/3864."
}

0 comments on commit 5c7e444

Please sign in to comment.