From fb853a2c6571698b10f8c6147ba6109caa243c7f Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sun, 14 Jun 2026 11:03:56 +0300 Subject: [PATCH] Build with meson and disable libxpresent --- info.yml | 8 +++- recipe.sh | 18 ++++---- ...toggle-for-building-with-libxpresent.patch | 46 +++++++++++++++++++ 3 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 source-files/0001-Add-meson-toggle-for-building-with-libxpresent.patch diff --git a/info.yml b/info.yml index ad28f47..803a18d 100644 --- a/info.yml +++ b/info.yml @@ -1,7 +1,7 @@ name: xorg-xdpyinfo description: Display information utility for X version: 1.4.0 -revision: 2 +revision: 3 url: https://xorg.freedesktop.org/ license: custom maintainers: @@ -17,5 +17,11 @@ depends: - libxtst - libxxf86vm make_depends: + - meson - xorg-util-macros - xorgproto +downloads: + - url: https://www.x.org/pub/individual/app/xdpyinfo-${BPM_PKG_VERSION}.tar.xz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: dc1de6e6e091ed46c4837b0ae9811e8182f7be0d2af638cab3e530ff081a48b6 diff --git a/recipe.sh b/recipe.sh index da1e7db..cfbdb89 100644 --- a/recipe.sh +++ b/recipe.sh @@ -2,33 +2,31 @@ # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT -DOWNLOAD="https://www.x.org/pub/individual/app/xdpyinfo-${BPM_PKG_VERSION}.tar.xz" -FILENAME="${DOWNLOAD##*/}" - # The prepare function is executed in the root of the temp directory -# This function is used for downloading files and putting them into the correct location +# This function is used for putting downloaded files to the correct location or applying patches prepare() { - wget "$DOWNLOAD" - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + cd "$BPM_SOURCE" + patch -Np1 -i "$BPM_WORKDIR"/0001-Add-meson-toggle-for-building-with-libxpresent.patch } # The build function is executed in the source directory # This function is used to compile the source code build() { - ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static - make + meson setup build --prefix=/usr -Dxpresent=disabled + meson compile -C build } # The check function is executed in the source directory # This function is used to run tests to verify the package has been compiled correctly check() { - make check + meson test -C build } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { - make DESTDIR="$BPM_OUTPUT" install + meson install -C build --destdir="$BPM_OUTPUT" + # Install package license install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/xorg-xdpyinfo/COPYING } diff --git a/source-files/0001-Add-meson-toggle-for-building-with-libxpresent.patch b/source-files/0001-Add-meson-toggle-for-building-with-libxpresent.patch new file mode 100644 index 0000000..770ef34 --- /dev/null +++ b/source-files/0001-Add-meson-toggle-for-building-with-libxpresent.patch @@ -0,0 +1,46 @@ +From e14b56a695f51bcfd92a5234990d3eba8982f85c Mon Sep 17 00:00:00 2001 +From: EnumDev +Date: Sun, 14 Jun 2026 09:52:45 +0300 +Subject: [PATCH] Add meson toggle for building with libxpresent + +--- + meson.build | 7 +++++++ + meson.options | 7 +++++++ + 2 files changed, 14 insertions(+) + +diff --git a/meson.build b/meson.build +index 1b0d861..aa1a68f 100644 +--- a/meson.build ++++ b/meson.build +@@ -65,6 +65,13 @@ dep_libxpresent = dependency('xpresent', required: false, disabler: true) + dep_libxrandr = dependency('xrandr', required: false, version: '>= 1.2', + disabler: true) + ++if get_option('xpresent').allowed() ++ dep_libxpresent = dependency('xpresent', required: false, disabler: true) ++else ++ dep_libxpresent = disabler() ++endif ++summary('xpresent', dep_libxpresent.found()) ++ + if get_option('dga').allowed() + dep_libxxf86dga = dependency('xxf86dga', required: false, disabler: true) + else +diff --git a/meson.options b/meson.options +index 9ecc7dc..282b65c 100644 +--- a/meson.options ++++ b/meson.options +@@ -1,3 +1,10 @@ ++option( ++ 'xpresent', ++ type: 'feature', ++ value: 'enabled', ++ description: 'Enable xpresent support (default is enabled)' ++) ++ + option( + 'dga', + type: 'feature', +-- +2.54.0 +