Skip to content

qtscrcpy: init at 2.2.1#340257

Merged
Aleksanaa merged 1 commit intoNixOS:masterfrom
Daru-san:package/qt-scrcpy
Nov 14, 2024
Merged

qtscrcpy: init at 2.2.1#340257
Aleksanaa merged 1 commit intoNixOS:masterfrom
Daru-san:package/qt-scrcpy

Conversation

@Daru-san
Copy link
Contributor

@Daru-san Daru-san commented Sep 7, 2024

Description of changes

Adds qt-scrcpy, a qt frontend for scrcpy.
Homepage : https://github.com/barry-ran/QtScrcpy

Build unsuccessful at the moment, help would be great 😄

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@Daru-san
Copy link
Contributor Author

Daru-san commented Sep 7, 2024

Currently stuck getting this error:

┃        > /build/source/QtScrcpy/util/mousetap/xmousetap.cpp: In function 'void find_grab_window_recursive(xcb_connection_t*, xcb_window_t, QRect, int16_t, int16_t, xcb_window_t*, uint32_t*)':
┃        > /build/source/QtScrcpy/util/mousetap/xmousetap.cpp:34:57: error: comparison of integer expressions of different signedness: 'int' and 'uint32_t' {aka 'unsigned int'} [-Werror=sign-compare]
┃        >    34 |             if (!*grab_window || gg->width * gg->height <= *grab_window_size) {
┃        >       |                                  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
┃        > At global scope:
┃        > cc1plus: note: unrecognized command-line option '-Wno-nested-anon-types' may have been intended to silence earlier diagnostics
┃        > cc1plus: all warnings being treated as errors
┃        > make[2]: *** [QtScrcpy/CMakeFiles/QtScrcpy.dir/build.make:248: QtScrcpy/CMakeFiles/QtScrcpy.dir/util/mousetap/xmousetap.cpp.o] Error 1
┃        > make[2]: *** Waiting for unfinished jobs....
┃        > make[1]: *** [CMakeFiles/Makefile2:121: QtScrcpy/CMakeFiles/QtScrcpy.dir/all] Error 2
┃        > make: *** [Makefile:91: all] Error 2
┃        For full logs, run 'nix log /nix/store/q5h1dib9s3pqx1473fl02a9yvfp0av9w-qt-scrcpy-2.2.1.drv'.

@Daru-san
Copy link
Contributor Author

Daru-san commented Sep 7, 2024

I found a way to get around it using

{  
  env.NIX_CFLAGS_COMPILE = toString [
    "-Wno-error=sign-compare"
  ];
}

@Daru-san
Copy link
Contributor Author

Daru-san commented Sep 7, 2024

But now I am stumped by this:

make: *** No rule to make target 'install'.  Stop.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Sep 7, 2024
@Daru-san
Copy link
Contributor Author

Daru-san commented Sep 7, 2024

Build successful 😄

@Daru-san Daru-san marked this pull request as ready for review September 7, 2024 06:17
Copy link
Member

@Aleksanaa Aleksanaa left a comment

Choose a reason for hiding this comment

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

The attribute name and pname should be qtscrcpy

@Daru-san Daru-san changed the title qt-scrcpy: init at 2.2.1 qtscrcpy: init at 2.2.1 Sep 8, 2024
@Daru-san
Copy link
Contributor Author

Daru-san commented Sep 9, 2024

There is an issue preventing the build from happening, it affects my system and github CI. Apparently the submodule QtScrcpyCore, from the repo https://github.com/barry-ran/QtScrcpyCore cannot be cloned, giving this error

┃        > Cloning into '/nix/store/dkb5z7p60vy3l52lv42i5jiib374skyb-source/QtScrcpy/QtScrcpyCore'...
┃        > error: cannot run ssh: No such file or directory
┃        > fatal: unable to fork
┃        > fatal: clone of 'git@github.com:barry-ran/QtScrcpyCore.git' into submodule path '/nix/store/dkb5z7p60vy3l52lv42i5jiib374skyb-source/QtScrcpy/QtScrcpyCore' fail…
┃        > Failed to clone 'QtScrcpy/QtScrcpyCore'. Retry scheduled
┃        > Cloning into '/nix/store/dkb5z7p60vy3l52lv42i5jiib374skyb-source/QtScrcpy/QtScrcpyCore'...
┃        > error: cannot run ssh: No such file or directory
┃        > fatal: unable to fork
┃        > fatal: clone of 'git@github.com:barry-ran/QtScrcpyCore.git' into submodule path '/nix/store/dkb5z7p60vy3l52lv42i5jiib374skyb-source/QtScrcpy/QtScrcpyCore' fail…
┃        > Failed to clone 'QtScrcpy/QtScrcpyCore' a second time, aborting
┃        For full logs, run 'nix log /nix/store/nfa9swir54ydyv38f3c2yrvfgb1zki8w-source.drv'.

@Aleksanaa
Copy link
Member

Aleksanaa commented Sep 10, 2024

There is an issue preventing the build from happening, it affects my system and github CI. Apparently the submodule QtScrcpyCore, from the repo barry-ran/QtScrcpyCore cannot be cloned, giving this error

See #195117. The best option here would be manually copying that repo to store, since we don't have a lot of submodules. I'll try to fix fetchgit.

edit: #195117 (comment) would be fine.

@Daru-san
Copy link
Contributor Author

There is an issue preventing the build from happening, it affects my system and github CI. Apparently the submodule QtScrcpyCore, from the repo barry-ran/QtScrcpyCore cannot be cloned, giving this error

See #195117. The best option here would be manually copying that repo to store, since we don't have a lot of submodules. I'll try to fix fetchgit.

edit: #195117 (comment) would be fine.

Cool, the solution in the provided issue works perfectly. My question is just if this would be a temporary fix to keep until the issue has been resolved properly

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 18, 2024
@Aleksanaa
Copy link
Member

There's vendor blob hidden in https://github.com/barry-ran/QtScrcpyCore/tree/5f0359053fb67f2226fcc87919aee0de17d2079b/src/third_party/ffmpeg/lib, which makes it unable to build on other architectures (and we should avoid unneeded blobs), see ofBorg https://logs.ofborg.org/?key=nixos/nixpkgs.340257&attempt_id=fe9242e4-8d56-41ff-8b7f-b817305c2b7f. There should be some options lying somewhere in cmake files. Do you think you can handle it? I can help you if you can't.

@Aleksanaa
Copy link
Member

I'm working on it. (Anyway I feel that this behavior is actually a bit malicious. Maybe it is really doing some bad things secretly)

@Daru-san
Copy link
Contributor Author

Oh I definitely did not realize that, I don't really get what it may be doing, I need to do more research into that, package compilation as a whole. But I would love to understand what it's doing, if you could explain.

@Aleksanaa
Copy link
Member

I don't really get what it may be doing, I need to do more research into that

tldr. it's not only vendoring ffmpeg blobs, but also scrcpy-server and adb in git submodules. This is very suspicious, because adb is a privileged operation for android, and scrcpy-server will be installed on the android system. Some users may not notice these pre-built binaries hidden in this open source project.

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 22, 2024
@myclevorname
Copy link
Contributor

Should we close the PR?

@Aleksanaa
Copy link
Member

Not necessarily, we can also try to replace the blob

@Daru-san
Copy link
Contributor Author

Daru-san commented Sep 22, 2024

I know this question may not be helpful, but how would you go about replacing the blob?

I assume you would somehow patch the source or maybe fork the repo and manually replace them.

@Aleksanaa
Copy link
Member

Resolved

@ofborg ofborg bot requested a review from Aleksanaa November 12, 2024 01:23
@Daru-san
Copy link
Contributor Author

@Aleksanaa Thanks a whole lot for that, build is successful 😄

@Daru-san
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 340257


x86_64-linux

✅ 1 package built:
  • qtscrcpy

@Aleksanaa
Copy link
Member

Still have to fix it a bit on macOS

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. and removed 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Nov 14, 2024
@Aleksanaa Aleksanaa merged commit dafe71c into NixOS:master Nov 14, 2024
@emilazy
Copy link
Member

emilazy commented Nov 18, 2024

Does this package only support FFmpeg 4? We are trying to get rid of it and this is the only user other than ROCm and the binary packages for Spotify and REAPER.

@Aleksanaa
Copy link
Member

The upstream vendored this version, so I replaced it with the same package. I can try to see if it still compiles after replacing it with a higher version

@Aleksanaa Aleksanaa mentioned this pull request Nov 20, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments