Skip to content

Commit

Permalink
Dependency updates, build adjustments and fixes
Browse files Browse the repository at this point in the history
Option enforce_build_order was removed now that a proper Meson fix is available.
Instead, the workaround is used unconditionally on broken Meson versions (notably, this includes our current Flatpak runtime).
Contributors are expected to use recent Meson in order to avoid degraded IDE experience.
Packagers must remove the option (regardless of Meson version in use).
  • Loading branch information
v1993 committed Aug 27, 2024
1 parent 83c9971 commit d3b24f7
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/PKGBUILD.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source=('https://github.com/v1993/nxdumpclient/archive/${PKGBUILD_REF}.tar.gz')
sha256sums=('AUTOFILL')

build() {
arch-meson -Denforce_build_order=true -Dlibportal=disabled "$srcdir/${pkgname}-${pkgver}" build
arch-meson -Dlibportal=disabled "$srcdir/${pkgname}-${pkgver}" build
meson compile -C build
}

Expand Down
2 changes: 1 addition & 1 deletion MSYS2.md → README-MSYS2.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ ${MINGW_PACKAGE_PREFIX}-vala

## Set environment variable `PYTHONUTF8=1`

Otherwise, `blueprint-compiler` will fail with `UnicodeDecodeError`.
Otherwise, `blueprint-compiler` will fail with `UnicodeDecodeError`.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Not much to say, really - it just works! You can enable autostart in settings an

Short version: AUR (stable) package if you're on Arch-based distro, flatpak from Flathub otherwise. Installing flatpaks from CI is normally heavily discouraged since those won't be automatically updated - please install from Flathub if possible instead.

Long version: Manual building or using unofficial packages may be viable options in non-Arch environments, but Manjaro/GNOME's Flatpak SDK (whichever is less up-to-date at the moment) is what ultimately determines what is the highest library version features from which I'll consider using. While I'm willing to support more distros natively, I won't be going out of my way to do so (a few tweaks to build system are fine, having to manually implement a feature present in newer version of a library/tool is not).
Long version: Manual building or using unofficial packages may be viable options in non-Arch environments, but Arch's/GNOME Flatpak SDK's (whichever is less up-to-date at the moment) is what ultimately determines what is the highest library version features from which I'll consider using. While I'm willing to support more distros natively, I won't be going out of my way to do so (a few tweaks to build system are fine, having to manually implement a feature present in newer version of a library/tool is not).

### Where are the dumps stored?

Expand All @@ -47,18 +47,18 @@ Installing special udev rules is required for user access to device. You should

Because of how udev events are communicated on Linux. You can manually revoke it if you so desire, but that will break support for device hotplug - i.e. you'll have to always connect your switch before starting the program.

## Building
## Building manually

Please note that a fairly recent distro is required - see dependencies section below.

```bash
git clone https://github.com/v1993/nxdumpclient.git
cd nxdumpclient
meson setup --buildtype=debugoptimized -Db_lto=true -Denforce_build_order=true --prefix=/usr build
meson setup --buildtype=debugoptimized -Db_lto=true --prefix=/usr build
meson compile -C build
meson install -C build
```

Please note that a fairly recent distro is required - see dependencies section below.

An alternative to direct installation is to use flatpak manifest stored at `flatpak/org.v1993.NXDumpClient.yml` (please note that building with flatpak requires initializing git submodules; they are not used otherwise). Use of `flatpak-builder` is out-of-scope for this document - download pre-built package from Flathub if you just want to use the flatpak version.

### Updating
Expand Down
5 changes: 2 additions & 3 deletions flatpak/org.v1993.NXDumpClient.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ modules:
sources:
- type: git
url: https://gitlab.gnome.org/jwestman/blueprint-compiler.git
tag: v0.12.0
commit: 66b43c36cf1017c878762007373964a096b3d2a5
tag: v0.14.0
commit: 8e10fcf8692108b9d4ab78f41086c5d7773ef864
x-checker-data:
type: git
tag-pattern: ^v([\d.]+)$
Expand Down Expand Up @@ -100,7 +100,6 @@ modules:
config-opts:
- -Dudev_rules=prompt
- -Dlibportal=enabled
- -Denforce_build_order=true
sources:
- type: dir
path: ..
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project('nxdumpclient', ['c', 'vala'],
version: '1.1.2',
meson_version: '>= 0.64.0',
default_options: [ 'warning_level=2', 'werror=false', ],
default_options: [ 'warning_level=1', 'werror=false', ],
)

i18n = import('i18n')
Expand Down
7 changes: 0 additions & 7 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,3 @@ option(
'[prompt] Instruct user how to manually install udevs rule at first launch; suitable for non-system installations\n' +
'[ignore] Do not worry about udev rules\n'
)

option(
'enforce_build_order',
type: 'boolean',
value: false,
description: 'Mitigate https://github.com/mesonbuild/meson/issues/12417 in affected meson versions at cost of degraded IDE support'
)
21 changes: 10 additions & 11 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,19 @@ nxdc_sources += gnome.compile_resources('nxdumpclient-resources',
source_dir: [ nxdc_blueprints_build_dir, '..' / 'data' ]
)

has_gresource_fixes = meson.project_version() >= '1.4.0' # https://github.com/mesonbuild/meson/pull/12418
if meson.version() >= '1.4.0'
nxdc_sources += nxdc_sources_native
else
# TODO: remove the workaround and bump minimum Meson version when gnome's flatpak
# runtime updates; runtime 46 is at Meson 1.3.2
warning(
'Using workarounds for building with Meson < 1.4.0; this will confuse your IDE.',
'This is only a problem for developers; users can disregard this warning.',
'See https://github.com/mesonbuild/meson/pull/12418 for details.'
)

if not has_gresource_fixes
extra_vala_args += [ '--gresourcesdir', nxdc_blueprints_build_dir ]
endif

# This is ridiculous; we have to do this to avoid the situation where
# Vala files are built prior to their corresponding .ui files

if get_option('enforce_build_order') and not has_gresource_fixes
fs = import('fs')
foreach file: nxdc_sources_native
nxdc_sources += custom_target(
Expand All @@ -98,10 +101,6 @@ if get_option('enforce_build_order') and not has_gresource_fixes
depends: nxdc_blueprint_tgt
)
endforeach
message('Enforcing build order, IDE syntax highlighting will break')
else
nxdc_sources += nxdc_sources_native
message('Current meson version has a bug; pass -Denforce_build_order=true in case this is not a development build')
endif

conf_data = configuration_data()
Expand Down
8 changes: 4 additions & 4 deletions subprojects/blueprint-compiler.wrap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[wrap-file]
directory = blueprint-compiler-v0.12.0
source_url = https://gitlab.gnome.org/jwestman/blueprint-compiler/-/archive/v0.12.0/blueprint-compiler-v0.12.0.tar.gz
source_filename = blueprint-compiler-v0.12.0.tar.gz
source_hash = 6dbb4ea851cec164030abded5949ea77ff92032e23527e1c0597d7efe0c36a81
directory = blueprint-compiler-v0.14.0
source_url = https://gitlab.gnome.org/jwestman/blueprint-compiler/-/archive/v0.14.0/blueprint-compiler-v0.14.0.tar.gz
source_filename = blueprint-compiler-v0.14.0.tar.gz
source_hash = 05faf3810cb76d4e2d2382c6a7e6c8096af27e144e2260635c97f6a173d67234

[provide]
program_names = blueprint-compiler

0 comments on commit d3b24f7

Please sign in to comment.