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

Set icon and server env paths for meson devenv #5658

Closed
wants to merge 1 commit into from

Conversation

ColinKinloch
Copy link

This allows users to compile and run the project without root.

meson setup x
meson compile -C x
meson devenv -C x
scrcpy

This allows users to compile and run the project without root.

```
meson setup x
meson compile -C x
meson devenv -C x
scrcpy
```
@rom1v
Copy link
Collaborator

rom1v commented Dec 12, 2024

Great, I didn't know about meson devenv!

I also discovered that since 0.49, you can use the / operator for paths instead of join_paths():

diff --git app/meson.build app/meson.build
index c74ee1021..abef527f5 100644
--- app/meson.build
+++ app/meson.build
@@ -282,6 +282,6 @@ endif
 
 if meson.version().version_compare('>= 0.58.0')
        devenv = environment()
-       devenv.set('SCRCPY_ICON_PATH', join_paths(meson.current_source_dir(), 'data/icon.png'))
+       devenv.set('SCRCPY_ICON_PATH', meson.current_source_dir() / 'data/icon.png'))
        meson.add_devenv(devenv)
 endif
diff --git server/meson.build server/meson.build
index 2e5fa9d2a..8a53656cf 100644
--- server/meson.build
+++ server/meson.build
@@ -26,6 +26,6 @@ endif
 
 if meson.version().version_compare('>= 0.58.0')
        devenv = environment()
-       devenv.set('SCRCPY_SERVER_PATH', join_paths(meson.current_build_dir(), 'scrcpy-server'))
+       devenv.set('SCRCPY_SERVER_PATH', meson.current_build_dir() / 'scrcpy-server'))
        meson.add_devenv(devenv)
 endif

@ColinKinloch
Copy link
Author

Should I bumb the required meson version or is the version_compare enough to use that?

meson_version: '>= 0.48',

@rom1v
Copy link
Collaborator

rom1v commented Dec 12, 2024

Oh, I thought it was ok without bumping because it is in a block checking version >= 0.5.8.

But in fact, it will probably still fail due to a syntax error on 0.48.

So it's probably better to keep it like it is.

@ColinKinloch
Copy link
Author

The oldest Ubuntu LTS version seems to use 0.53.2 https://packages.ubuntu.com/focal/meson
I'm not sure what the 0.48 minimum is based on.
LTSs make the world a worse place 😫.

@rom1v
Copy link
Collaborator

rom1v commented Dec 12, 2024

I'm not sure what the 0.48 minimum is based on.

It was bumped by eb8f7a1.

@ColinKinloch
Copy link
Author

The commit is from 2020 when Stretch went out of support.
Buster has 0.56.2 and went out of support in 2022.
Maybe it's time 🤷

rom1v added a commit to rom1v/scrcpy that referenced this pull request Dec 12, 2024
rom1v pushed a commit to rom1v/scrcpy that referenced this pull request Dec 12, 2024
This allows users to compile and run the project in a dev environment.

    meson setup x
    meson compile -C x
    meson devenv -C x
    scrcpy

This is an alternative to `./run x`.

PR Genymobile#5658 <Genymobile#5658>

Signed-off-by: Romain Vimont <[email protected]>
rom1v added a commit to rom1v/scrcpy that referenced this pull request Dec 12, 2024
rom1v pushed a commit to rom1v/scrcpy that referenced this pull request Dec 12, 2024
This allows users to compile and run the project in a dev environment.

    meson setup x
    meson compile -C x
    meson devenv -C x
    scrcpy

This is an alternative to `./run x`.

PR Genymobile#5658 <Genymobile#5658>

Signed-off-by: Romain Vimont <[email protected]>
rom1v pushed a commit that referenced this pull request Dec 12, 2024
This allows users to compile and run the project in a dev environment.

    meson setup x
    meson compile -C x
    meson devenv -C x
    scrcpy

This is an alternative to `./run x`.

PR #5658 <#5658>

Signed-off-by: Romain Vimont <[email protected]>
rom1v added a commit to rom1v/scrcpy that referenced this pull request Dec 12, 2024
rom1v pushed a commit to rom1v/scrcpy that referenced this pull request Dec 12, 2024
This allows users to compile and run the project in a dev environment.

    meson setup x
    meson compile -C x
    meson devenv -C x
    scrcpy

This is an alternative to `./run x`.

PR Genymobile#5658 <Genymobile#5658>

Signed-off-by: Romain Vimont <[email protected]>
@rom1v
Copy link
Collaborator

rom1v commented Dec 12, 2024

Please review the branch pr5658.

@ColinKinloch
Copy link
Author

It looks fine and runs fine. However I didn't run an meson install.
There are a couple of unrelated commits on it though.

@rom1v
Copy link
Collaborator

rom1v commented Dec 12, 2024

Thank you. Merged into dev 🚀

@rom1v rom1v closed this Dec 12, 2024
@ColinKinloch ColinKinloch deleted the devenv_srv_icon branch December 12, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants