;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2026 Hilton Chain (define-module (rosenthal packages android) #:use-module (guix gexp) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system meson) #:use-module (gnu packages android) #:use-module (gnu packages libusb) #:use-module (gnu packages pkg-config) #:use-module (gnu packages sdl) #:use-module (gnu packages video)) (define-public scrcpy (package (name "scrcpy") (version "5.0.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/Genymobile/scrcpy") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "062fnhm5pj39cxygs276zqw780blfw6rf850r442iw587a63fsyf")))) (build-system meson-build-system) (arguments (list #:configure-flags #~(list (string-append "-Dprebuilt_server=" #+(this-package-native-input (string-append "scrcpy-server-v" (package-version this-package))))) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'fix-references (lambda* (#:key inputs #:allow-other-keys) (substitute* "app/src/adb/adb.c" (("strdup\\(\"adb\"\\)") (format #f "strdup(~s)" (search-input-file inputs "bin/adb"))))))))) (native-inputs (list pkg-config (let ((version (package-version this-package))) (origin (method url-fetch) (uri (string-append "https://github.com/Genymobile/scrcpy/releases/download/v" version "/scrcpy-server-v" version)) (sha256 (base32 "0dn57gjn5dizpzbrgf31g969ka9bi0h12d6zx4gj3m8ik3vvckkn")))))) (inputs (list adb ffmpeg libusb sdl3)) (home-page "https://github.com/Genymobile/scrcpy") (synopsis "Display and control your Android device") (description "This application mirrors Android devices (video and audio) connected via USB or TCP/IP and allows control using the computer's keyboard and mouse. It does not require root access or an app installed on the device.") (license license:asl2.0)))