diff options
author | toolonely <lonely_@tutanota.com> | 2021-01-28 23:02:11 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-01-30 10:29:12 +0700 |
commit | d09d223181cf38610fbbdc18ea8dcd33ab0c5e39 (patch) | |
tree | 27a747cb81ffff93ea511a44f632b055017b8993 | |
parent | 6ad5458642604db036c6f9a9f69928cac2705ecc (diff) | |
download | slackbuilds-d09d223181cf38610fbbdc18ea8dcd33ab0c5e39.tar.gz |
network/scrcpy: Added (display and control your Android device)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | network/scrcpy/README | 22 | ||||
-rw-r--r-- | network/scrcpy/scrcpy.SlackBuild | 104 | ||||
-rw-r--r-- | network/scrcpy/scrcpy.info | 12 | ||||
-rw-r--r-- | network/scrcpy/slack-desc | 19 |
4 files changed, 157 insertions, 0 deletions
diff --git a/network/scrcpy/README b/network/scrcpy/README new file mode 100644 index 0000000000..e921297b10 --- /dev/null +++ b/network/scrcpy/README @@ -0,0 +1,22 @@ +scrcpy is a tool that allows to display and control an Android device +connected on USB (or over TCP/IP). It does not require any root access. + +scrcpy requires adb as runtime dependency. adb is part of the package +android-tools on slackbuilds.org . + +scrcpy requires the Android device to be switched to Developer Mode +and have a few options switched on (tested on a Redmi 9C NFC phone): + +- USB debugging + +On some devices it also requires: + +- USB debugging (Security settings) + +See https://github.com/Genymobile/scrcpy#requirements for additional +details. + +This SlackBuild uses the prebuilt server instead of compiling it from +source, to minimize dependencies. + +Note: the SlackBuild was tested on Slackware64-14.2 only diff --git a/network/scrcpy/scrcpy.SlackBuild b/network/scrcpy/scrcpy.SlackBuild new file mode 100644 index 0000000000..b7b5d586c8 --- /dev/null +++ b/network/scrcpy/scrcpy.SlackBuild @@ -0,0 +1,104 @@ +#!/bin/sh + +# Slackware build script for scrcpy + +# Copyright 2021 toolonely <lonely_@tutanota.com> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=scrcpy +VERSION=${VERSION:-1.17} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +mkdir build +cd build + CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + meson .. \ + --buildtype=release \ + --infodir=/usr/info \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --localstatedir=/var \ + --mandir=/usr/man \ + --prefix=/usr \ + --sysconfdir=/etc \ + --strip \ + -Db_lto=true \ + -Dprebuilt_server=$CWD/scrcpy-server-v$VERSION + ninja + DESTDIR=$PKG ninja install +cd .. + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/scrcpy/scrcpy.info b/network/scrcpy/scrcpy.info new file mode 100644 index 0000000000..f715e06499 --- /dev/null +++ b/network/scrcpy/scrcpy.info @@ -0,0 +1,12 @@ +PRGNAM="scrcpy" +VERSION="1.17" +HOMEPAGE="https://github.com/Genymobile/scrcpy" +DOWNLOAD="https://github.com/Genymobile/scrcpy/archive/v1.17/scrcpy-1.17.tar.gz \ + https://github.com/Genymobile/scrcpy/releases/download/v1.17/scrcpy-server-v1.17" +MD5SUM="6ed058f41b918abe44f0a46b7d187a3f \ + 1de2cadd13e4da6f957aeaed9926adc6" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="meson ffmpeg SDL2" +MAINTAINER="toolonely" +EMAIL="lonely_@tutanota.com" diff --git a/network/scrcpy/slack-desc b/network/scrcpy/slack-desc new file mode 100644 index 0000000000..57efb9463d --- /dev/null +++ b/network/scrcpy/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +scrcpy: scrcpy (display and control your Android device) +scrcpy: +scrcpy: This application provides display and control of Android devices +scrcpy: connected on USB (or over TCP/IP). It does not require any +scrcpy: root access. +scrcpy: +scrcpy: https://github.com/Genymobile/scrcpy +scrcpy: +scrcpy: +scrcpy: +scrcpy: |