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

Treat all variables match _.* as optional #23

Open
txtsd opened this issue Nov 5, 2024 · 4 comments
Open

Treat all variables match _.* as optional #23

txtsd opened this issue Nov 5, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@txtsd
Copy link

txtsd commented Nov 5, 2024

2024-11-05-16:10:39:44:327516431-960x1052_grim

Any idea how to fix this?

@txtsd
Copy link
Author

txtsd commented Nov 7, 2024

I found out this happens because of line 4. The variable needs to be quoted, but that is not necessary as far as bash is concerned. Can you make it so that it doesn't have to be quoted?

@txtsd txtsd changed the title Entire PKGBUILD marked as error. shfmt does nothing. Entire PKGBUILD marked as error. Nov 7, 2024
@txtsd txtsd changed the title Entire PKGBUILD marked as error. Entire PKGBUILD marked as error Nov 7, 2024
@Freed-Wu
Copy link
Collaborator

Freed-Wu commented Nov 7, 2024

You mean _pkgname result in this bug? So we should ignore all variables which name match _.*.
I cannot copy text from screenshot to test. Perhaps you can copy the entire code.

@Freed-Wu Freed-Wu added the enhancement New feature or request label Nov 7, 2024
@Freed-Wu Freed-Wu changed the title Entire PKGBUILD marked as error Treat all variables match _.* as optional Nov 7, 2024
@txtsd
Copy link
Author

txtsd commented Nov 7, 2024

Here it is:

# Maintainer: txtsd <[email protected]>

pkgname=android_translation_layer
_pkgname=${pkgname//-/_}
pkgver=r651.e541d87f
pkgrel=2
_commit=e541d87fc255160ca0559015db0cc57042246fff
pkgdesc='A translation layer for running Android apps on a Linux system'
url='https://gitlab.com/android_translation_layer/android_translation_layer'
arch=(x86_64 aarch64 armv7h)
license=('GPL-3.0-or-later')
# libopensles-standalone is not strictly required but some Android applications depend on it
depends=(
  alsa-lib
  art_standalone
  bionic_translation
  cairo
  ffmpeg
  gcc-libs
  gdk-pixbuf2
  glib2
  glibc
  graphene
  gtk4
  harfbuzz
  libdrm
  libglvnd
  libgudev
  libopensles-standalone
  libportal
  libsoup3
  pango
  skia-sharp-atl
  sqlite
  vulkan-icd-loader
  wayland
  webkitgtk-6.0
)
makedepends=(
  glib2-devel
  java-runtime-common
  jdk8-openjdk
  meson
  openxr
  vulkan-headers
  wayland-protocols
)
source=("${pkgname}-${_commit}.tar.gz::${url}/-/archive/${_commit}/${pkgname}-${_commit}.tar.gz")
sha256sums=('e16cf668e9b2d9c1149f16dcaa785faedfc7dc4a81e2cf62d1f0c35afbba67fa')

prepare() {
  meson subprojects download --sourcedir="${pkgname}-${_commit}"
}

build() {
  arch-meson "${pkgname}-${_commit}" build
  meson compile -C build
}

check() {
  meson test --no-rebuild --print-errorlogs -C build
}

package() {
  depends+=(java-runtime)
  meson install --no-rebuild -C build --destdir "${pkgdir}"
}

@txtsd
Copy link
Author

txtsd commented Nov 7, 2024

Yes, it is recommended for user defined variables to start with an underscore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants