You are not logged in.

#1 2023-07-04 17:31:21

PerilousBooklet
Member
Registered: 2022-12-22
Posts: 3

[SOLVED] PKGBUILD Review: godot-voxel

Hi, I wanted to ask if someone familiar with AUR packaging could take a look at the PKGBUILD of godot-voxel (https://aur.archlinux.org/packages/godot-voxel).
The problem that I'm currently trying to solve is the following: the build process fails and outputs the following message:

==> Starting build()...
scons: Reading SConscript files ...
Auto-detected 12 CPU cores available for build parallelism. Using 11 cores by default. You can override it with the -j argument.
Building for platform "linuxbsd", architecture "x86_64", target "editor".
KeyError: 'tools':
  File "/home/raffaele/dev/aur/godot-voxel/src/godot/SConstruct", line 925:
    SConscript("modules/SCsub")
  File "/usr/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 660:
    return method(*args, **kw)
  File "/usr/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/raffaele/dev/aur/godot-voxel/src/godot/modules/SCsub", line 34:
    SConscript(base_path + "/SCsub")
  File "/usr/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 660:
    return method(*args, **kw)
  File "/usr/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/raffaele/dev/aur/godot-voxel/src/godot/modules/voxel/SCsub", line 52:
    if env["tools"]:
  File "/usr/lib/python3.11/site-packages/SCons/Environment.py", line 387:
    return self._dict[key]
==> ERROR: A failure occurred in build().
    Aborting...

Last edited by PerilousBooklet (2023-07-21 19:12:20)


Nothing is impossible to understand if you explain it well enough.

Offline

#2 2023-07-04 17:47:08

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: [SOLVED] PKGBUILD Review: godot-voxel

Markdown is not supported by the forum software. Please use [ code ] tags instead.

https://wiki.archlinux.org/title/Genera … s_and_code
https://bbs.archlinux.org/help.php#bbcode

Moving to AUR issues.

Offline

#3 2023-07-04 19:18:22

loqs
Member
Registered: 2014-03-06
Posts: 18,425

Re: [SOLVED] PKGBUILD Review: godot-voxel

https://aur.archlinux.org/cgit/aur.git/ … 16c19c2272 broke the build the matching branch in godot_voxel seems to be godot4.0 not godot4 then the build failed due to a duplicate definition fixed by cherry-picking https://github.com/Zylann/godot_voxel/c … a6452dc5ca
diff of changes included below (this only allowed the package to build I did not address any other issues)

$ git diff
diff --git a/PKGBUILD b/PKGBUILD
index 6a5e6fd..b348ef0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,10 +11,10 @@ pkgdesc="The Godot game engine with Zylann's voxel tools module"
 url="https://voxel-tools.readthedocs.io/en/latest/"
 license=('MIT')
 arch=('x86_64')
-makedepends=('scons' 'gcc')
+makedepends=('scons' 'git')
 depends=('pkgconf' 'libxcursor' 'libxinerama' 'libxi' 'libxrandr' 'mesa' 'glu' 'libglvnd' 'alsa-lib' 'pulseaudio')
 source=("godot::git+https://github.com/godotengine/godot.git#branch=4.0"
-        "godot_voxel::git+https://github.com/Zylann/godot_voxel.git#branch=godot4"
+        "godot_voxel::git+https://github.com/Zylann/godot_voxel.git#branch=godot4.0"
         "godot-voxel.desktop" )
 sha256sums=('SKIP'
             'SKIP'
@@ -23,6 +23,8 @@ sha256sums=('SKIP'
 prepare() {
   cd "${srcdir}" 
   ln -s "$srcdir/godot_voxel" "$srcdir/godot/modules/voxel"
+  cd godot_voxel
+  git cherry-pick -n 13567b4fb8f20ca0b5dcf71e76c9c7a6452dc5ca
 }
 
 build() { 

Offline

#4 2023-07-04 20:01:35

yochananmarqos
Member
Registered: 2020-02-05
Posts: 214

Re: [SOLVED] PKGBUILD Review: godot-voxel

Since this a variant of godot, it needs to provide and conflict with godot. I don't know why you commented out installing the license and man page, they should be both installed.

This is a VCS package (see guidelines), so it should have been submitted as godot-voxel-git. Either that or you can specify a static commit for both repos.


PKGBUILD critique:

  • The URL should be the base https://voxel-tools.readthedocs.io/ without the language specified

  • git is missing from makedepends

  • gcc does not need to be specified in makedepends as it's part of base-devel

  • pkgconf is not a runtime dependency

  • The source folder does not need to be specified at all; especially when the repo name is identical

  • Do not skip checksums for the desktop file

  • No need to cd into the srcdir as it's where makepkg already starts

  • Utilize the pkgname variable

  • SVGs should be installed to /usr/share/icons/hicolor/scalable/apps/

PKGBUILD diff

Note that I rearranged things to match the template and alphabetized the dependencies because that's how my brain works.

I was able to build in a clean chroot just fine with my PKGBUILD.

EDIT: I had this page sitting open for awhile was I was working on it, so I didn't see @loqs' reply until after I submitted it. Either way, I had no issue building it. ¯\_(ツ)_/¯

Last edited by yochananmarqos (2023-07-04 20:08:06)

Offline

#5 2023-07-04 20:35:54

loqs
Member
Registered: 2014-03-06
Posts: 18,425

Re: [SOLVED] PKGBUILD Review: godot-voxel

@yochananmarqos I tried applying https://dpaste.com/3UZ7YLHSW.txt but it failed with

3UZ7YLHSW.txt
error: corrupt patch at line 71

I manually applied the changes to produce

# Maintainer: PerilousBooklet <raffaele.orabona at protonmail dot com>
# Contributor: dalz <aur @t alsd d0t eu>
# Contributor: Jorge Araya Navarro <jorgejavieran@yahoo.com.mx>
# Contributor: Cristian Porras <porrascristian@gmail.com>
# Contributor: Matthew Bentley <matthew@mtbentley.us>
 
pkgname=godot-voxel-git
pkgver=4.0.3.stable.r139.gc8e0bd50c5
pkgrel=1
pkgdesc="The Godot game engine with Zylann's voxel tools module"
arch=('x86_64')
url="https://voxel-tools.readthedocs.io/"
license=('MIT')
depends=('alsa-lib' 'glu' 'libglvnd' 'libxcursor' 'libxi' 'libxinerama'
         'libxrandr' 'mesa' 'pulseaudio')
makedepends=('git' 'scons')
provides=("${pkgname%-git}" 'godot')
conflicts=("${pkgname%-git}" 'godot')
source=('git+https://github.com/godotengine/godot.git#branch=4.0'
        'git+https://github.com/Zylann/godot_voxel.git#branch=godot4'
        "${pkgname%-git}.desktop")
sha256sums=('SKIP'
            'SKIP'
            'c244469ba0c93568915ae12364dd6376e66b9f7db1d5471c10c077a92fdf1964')

pkgver() {
  cd "${srcdir}/godot"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  ln -s godot_voxel godot/modules/voxel
}

build() { 
  cd "${srcdir}/godot"
  scons platform=linuxbsd colored=yes
}

package() {
  install -Dm644 "${srcdir}/${pkgname}.desktop" \
    "${pkgdir}/usr/share/applications/${pkgname}.desktop"
  install -Dm644 icon.svg "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg"
  install -Dm755 bin/godot.linuxbsd.editor.x86_64 "${pkgdir}/usr/bin/${pkgname}"
  install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/godot/LICENSE
  install -Dm644 misc/dist/linux/godot.6 "${pkgdir}"/usr/share/man/man6/godot.6
}

The reason that builds without any other changes I believe is because the following produces a broken symlink

  ln -s godot_voxel godot/modules/voxel

If you want to avoid $srcdir here I think you want

  ln -s ../../godot_voxel godot/modules/voxel

Which should then break the build.

Offline

#6 2023-07-04 20:45:57

yochananmarqos
Member
Registered: 2020-02-05
Posts: 214

Re: [SOLVED] PKGBUILD Review: godot-voxel

loqs wrote:

@yochananmarqos I tried applying https://dpaste.com/3UZ7YLHSW.txt but it failed with

3UZ7YLHSW.txt
error: corrupt patch at line 71

Oh, I think an extra line might have snuck in somehow?

loqs wrote:

the following produces a broken symlink

  ln -s godot_voxel godot/modules/voxel

Er? How's that?

Either way, ln -sf would be best so it will work with an existing clone.

loqs wrote:

I think you want

  ln -s ../../godot_voxel godot/modules/voxel

No, I don't want. We're already in the srcdir, we can't back up any further.

Offline

#7 2023-07-04 21:04:46

PerilousBooklet
Member
Registered: 2022-12-22
Posts: 3

Re: [SOLVED] PKGBUILD Review: godot-voxel

I followed @loqs's advice regarding the correct branch name and "git cherry-pick" actions and now the PKGBUILD is working as expected.

Regarding @yochananmarqos's advice, I am still in the process of learning all the things needed to implement the fixes that you explained.
As a side note, I intend for this package to be an addition and not a replacement for godot, much like the godot3 package.
I still have to request a merge to change the package's name from godot-voxel to godot-voxel-4.

Also thanks to @2ManyDogs for swiftly correcting me about the formatting basics of this forum.

Thanks to all of you, I learned many things today.


Nothing is impossible to understand if you explain it well enough.

Offline

#8 2023-07-04 21:05:59

PerilousBooklet
Member
Registered: 2022-12-22
Posts: 3

Re: [SOLVED] PKGBUILD Review: godot-voxel

I'm updating the PKGBUILD with the current version for the time being, until I apply all the fixes suggested by @yochananmarqos.


Nothing is impossible to understand if you explain it well enough.

Offline

#9 2023-07-04 21:06:19

loqs
Member
Registered: 2014-03-06
Posts: 18,425

Re: [SOLVED] PKGBUILD Review: godot-voxel

yochananmarqos wrote:
loqs wrote:

I think you want

  ln -s ../../godot_voxel godot/modules/voxel

No, I don't want. We're already in the srcdir, we can't back up any further.

godot/modules/voxel would be pointing two directories up from $srcdir/godot/modules to godot_voxel in $srcdir.

Last edited by loqs (2023-07-04 21:12:42)

Offline

Board footer

Powered by FluxBB