Coder Social home page Coder Social logo

Comments (5)

rom1v avatar rom1v commented on May 25, 2024

I'm currently using the distribution-packaged (Ubuntu) version of scrcpy

The packaged version is very very old. You should always run the latest version 😉

a way to pass an installation prefix directory to the build systems (ninja and meson).

During your meson setup:

meson setup builddir --prefix=/your/prefix/directory
./build-auto/app/scrcpy -s xxxxxxxxxxx

You can run without installing:

./run build-auto -s xxxxxxxxxxx

(check the content of the run script)

from scrcpy.

jaybeers avatar jaybeers commented on May 25, 2024

I actually worked this out while I was opening the issue, but it occurred to me that somebody else might benefit from the answer, and having the full question in there would make the whole thing more discoverable, so...

Turns out you can run the executable right out of the build directory; you just have to specify the path to the scrcpy-server file. This file is provided in the build directory, but the scrcpy invocation doesn't look for it there. If you just want a quick and dirty way to run, you can just run this in the build directory:

SCRCPY_SERVER_PATH="./scrcpy-server" ./build-auto/app/scrcpy

I wrote up this simple shell script which should make things a little friendlier; I put mine in ${HOME}/.local/bin/scrcpy-homedir, but it'll work from any directory.

#!/bin/sh

base_directory="${HOME}/build/scrcpy"

###############################################################################
###############################################################################

SCRCPY_SERVER_PATH="${base_directory}/scrcpy-server" ${base_directory}/build-auto/app/scrcpy ${*}

## EOF
########

from scrcpy.

jaybeers avatar jaybeers commented on May 25, 2024

You can run without installing:

./run build-auto -s xxxxxxxxxxx

Ah, OK. That seems to produce the same result, but less fiddly than my version. :) Thanks for the help! So, just to close the loop, this is what I'm updating the shell script to:

#!/bin/sh

base_directory="${HOME}/build/scrcpy"

###############################################################################
###############################################################################

${base_directory}/run build-auto ${*}

## EOF
########

from scrcpy.

rom1v avatar rom1v commented on May 25, 2024

But it is still better to build and install.

If x is your builddir:

ninja -Cx
sudo ninja -Cx install

I don't want to run an arbitrary "make install"-type command that puts who knows what files in who knows which directories.

It installs the files documented here

Here are the relevant lines in meson:

scrcpy/app/meson.build

Lines 177 to 193 in 206809a

executable('scrcpy', src,
dependencies: dependencies,
include_directories: src_dir,
install: true,
c_args: [])
# <https://mesonbuild.com/Builtin-options.html#directories>
datadir = get_option('datadir') # by default 'share'
install_man('scrcpy.1')
install_data('data/icon.png',
rename: 'scrcpy.png',
install_dir: join_paths(datadir, 'icons/hicolor/256x256/apps'))
install_data('data/zsh-completion/_scrcpy',
install_dir: join_paths(datadir, 'zsh/site-functions'))
install_data('data/bash-completion/scrcpy',
install_dir: join_paths(datadir, 'bash-completion/completions'))

install: true,
install_dir: 'share/scrcpy')

from scrcpy.

jaybeers avatar jaybeers commented on May 25, 2024

Ah OK...yeah, that's the info I was looking for.

I made it as far as https://github.com/Genymobile/scrcpy/blob/master/doc/linux.md; too bad I didn't go one more link 'cause "build.md" is linked on that page. 😄

Excellent; so, it looks like what I'm after is probably to add something to the meson command line so it installs into my ${HOME}/.local prefix.

from scrcpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.