Genymobile / Genymobile/scrcpy

Isolated build environment

Open
#3,136 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
150k
Forks
13.7k
Avg merge
4d 13h
Merged PRs (30d)
2

Description

- [x] I have checked that a similar [feature request](https://github.com/Genymobile/scrcpy/issues?q=is%3Aopen+is%3Aissue+label%3A%22feature+request%22) does not already exist.

**Is your feature request related to a problem? Please describe.**

In order to compile the project on my machine it's required to install a couple of build dependencies that I don't want to pollute my system.

**Describe the solution you'd like**

I've created a build environment based on docker/podman to do the compilation task isolated in a docker container. This would also allow you to provide a failsafe build environment to all users.

**Describe alternatives you've considered**

Do what is described in the readme. My system would end up with dependencies that won't be required anymore, except for that one task from time to time. In the long term I gonna lose track of the dev dependencies.

**My solution**

`Dockerfile-ubuntu-20.04`:

FROM ubuntu:focal-20220302

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -qq
RUN apt-get install -qy \
ffmpeg libsdl2-2.0-0 adb wget \
gcc git pkg-config meson ninja-build libsdl2-dev \
libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev \
libusb-1.0-0 libusb-1.0-0-dev

WORKDIR /src

CMD ["/src/install_release.sh"]

`fetch+compile.sh`:

#!/usr/bin/env sh
set -o nounset ## set -u : exit the script if you try to use an uninitialised variable
set -o errexit ## set -e : exit the script if any statement returns a non-true return value

git clone --quiet https://github.com/Genymobile/scrcpy . || git pull

docker build -f "Dockerfile-ubuntu-20.04" -t "scrcpy/scrcpy-build-env" .
docker run --rm -v "$PWD:/src" "scrcpy/scrcpy-build-env" || true

echo "-----"
echo "alias scrcpy='./run scrcpy/build-auto'"

## Issues

Currently, your `install_release.sh` combines two processes within a single file: compile and install. Since install requires the sudo command my script would fail (thus the workaround `… || true`). It would be great to have these aspects split into separate files upstream.

---

What do you think?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.