Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrcpy: init at v1.2 #44249

Merged
merged 3 commits into from Aug 1, 2018
Merged

scrcpy: init at v1.2 #44249

merged 3 commits into from Aug 1, 2018

Conversation

lukeadams
Copy link
Contributor

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Jul 31, 2018

@GrahamcOfBorg build scrcpy

@Mic92
Copy link
Member

Mic92 commented Jul 31, 2018

this is a different attempt to package it, but the build currently fails: #44101

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: scrcpy

Partial log (click to expand)

Cannot nix-instantiate `scrcpy' because:
error: while evaluating the attribute 'postInstall' of the derivation 'scrcpy-1.2' at /var/lib/gc-of-borg/nix-test-rs-4/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-4/pkgs/stdenv/generic/make-derivation.nix:175:11:
while evaluating the attribute 'buildCommand' of the derivation 'android-sdk-25.2.5' at /var/lib/gc-of-borg/nix-test-rs-4/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-4/pkgs/stdenv/generic/make-derivation.nix:175:11:
while evaluating the attribute 'src' of the derivation 'android-platform-tools-r26.0.2' at /var/lib/gc-of-borg/nix-test-rs-4/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-4/pkgs/stdenv/generic/make-derivation.nix:175:11:
System aarch64-linux not supported!

@Mic92
Copy link
Member

Mic92 commented Jul 31, 2018

@DeltaEvo are you also interested in adding yourself as a maintainer to the package? More maintainers are welcome.

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: scrcpy

Partial log (click to expand)

[30/30] Linking target app/test_strutil.
installing
install flags: install
[0/1] Installing files.
Installing app/scrcpy to /nix/store/b4xilb5ns8aqr452mh1icfcn310ngaw3-scrcpy-1.2/bin/scrcpy
post-installation fixup
strip is /nix/store/qfxcr8c4fg7lkybrny9n2sb77bmippdx-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/b4xilb5ns8aqr452mh1icfcn310ngaw3-scrcpy-1.2/bin
patching script interpreter paths in /nix/store/b4xilb5ns8aqr452mh1icfcn310ngaw3-scrcpy-1.2
/nix/store/b4xilb5ns8aqr452mh1icfcn310ngaw3-scrcpy-1.2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: scrcpy

Partial log (click to expand)

[0/1] Installing files.
Installing app/scrcpy to /nix/store/zqm4rhx5z625cp1cg7xrcx4rahpm0n2h-scrcpy-1.2/bin/scrcpy
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/zqm4rhx5z625cp1cg7xrcx4rahpm0n2h-scrcpy-1.2
shrinking /nix/store/zqm4rhx5z625cp1cg7xrcx4rahpm0n2h-scrcpy-1.2/bin/.scrcpy-wrapped
strip is /nix/store/1hi76hr87bd1y1q1qjk0lv8nmcjip1c8-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/zqm4rhx5z625cp1cg7xrcx4rahpm0n2h-scrcpy-1.2/bin
patching script interpreter paths in /nix/store/zqm4rhx5z625cp1cg7xrcx4rahpm0n2h-scrcpy-1.2
checking for references to /build in /nix/store/zqm4rhx5z625cp1cg7xrcx4rahpm0n2h-scrcpy-1.2...
/nix/store/zqm4rhx5z625cp1cg7xrcx4rahpm0n2h-scrcpy-1.2

, pkgconfig

, androidsdk
, ffmpeg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ffmpeg is not needed i think, only libav is used

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is libav not just a ffmpeg fork?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# Manually install the server jar to prevent Meson from "fixing" it
preConfigure = ''
echo -n > server/meson.build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't use -Dprebuilt_server option ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I manually install it to work around the weird elf error from Meson. I don't really have experience with meson and couldn't find a way to exclude the file from the depfixer.py invocation.

depfixer has a fix_jar function, but due to a bug (???) it calls fix_rpath instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen the same issue. The prebuild server should be fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very strange, I didn't have this issue when i was creating the package because I was at an old version of nixpkgs, I think this is the new version of meson mesonbuild/meson@c70a051 Perhaps this commit

Copy link
Member

@DeltaEvo DeltaEvo Jul 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aw yes it's this commit, meson try to rewrite the jar to rewrite the Manifest inside

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm so the version in nixpkgs (0.46.1) doesn't have fix_jar. Updating meson to 0.47.1 may fix it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aw we we are not at 0.47.1 🤔, even if we update I think we still will have issues because with 0.47.1 it will try to rewrite the jarfile, and fail like fix_rpath because the file is not writtable

mkdir -p "$out/share/scrcpy"
ln -s "${prebuilt_server}" "$out/share/scrcpy/scrcpy-server.jar"

wrapProgram "$out/bin/scrcpy" --prefix PATH : "${androidsdk}/bin"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android sdk was not needed at runtime for me 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adb was used if I remember correctly.

Copy link
Contributor Author

@lukeadams lukeadams Jul 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/Genymobile/scrcpy#requirements
It adb pushes the server jar to the device at runtime
There may be a smaller nixpkgs package which just has adb though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's in the platform tools, so androidenv.platformTools

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct. androidenv.platformTools should be enough

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome! changed

@DeltaEvo
Copy link
Member

@Mic92 I'm not against it

@lukeadams
Copy link
Contributor Author

@DeltaEvo I'll add you! Sorry I didn't see your pr else I would have submitted a patch.

@lukeadams
Copy link
Contributor Author

  • changed adb package to androidenv.platformTools
  • added deltaevo as maintainer

@Mic92 Mic92 merged commit 02ba14d into NixOS:master Aug 1, 2018
@xeji xeji mentioned this pull request Aug 1, 2018
9 tasks
@lukeadams lukeadams deleted the scrcpy branch May 26, 2021 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants