ful1e5 / Bibata_Cursor

Open source, compact, and material designed cursor set.
https://www.bibata.live
GNU General Public License v3.0
2.01k stars 71 forks source link

Build fails with Clickgen 1.1.8 [AUR] #93

Closed yochananmarqos closed 3 years ago

yochananmarqos commented 3 years ago

Description of the problem

Running python build.py --x11 with Clickgen 1.1.8 fails. It succeeds with 1.1.7.

Logs or Screenshots

Traceback (most recent call last):
  File "/build/bibata-cursor-theme/src/Bibata_Cursor-1.0.3/build.py", line 12, in <module>
    from builder.cursor import CursorBuilder
  File "/build/bibata-cursor-theme/src/Bibata_Cursor-1.0.3/builder/cursor.py", line 4, in <module>
    from clickgen import build_cursor_theme, build_win_cursor_theme, build_x11_cursor_theme
ImportError: cannot import name 'build_cursor_theme' from 'clickgen' (/usr/lib/python3.9/site-packages/clickgen/__init__.py)

Your Environment

Software Name/Version
Operating System Manjaro GNOME
ful1e5 commented 3 years ago

Some modules of clickgen v1.1.8 are restructured, That's why it raises the error. clickgen v1.1.8 supports individually cursor build instead of batch (Performace tweak).

Currently, I am working on Bibata with clickgen v1.1.8. That will take some time to released upstream. Can you able to lock the Bibata Arch package on clickgen v1.1.7?

yochananmarqos commented 3 years ago

Can you able to lock the Bibata Arch package on clickgen v1.1.7?

Done.

Folks can also install bibata-cursor-theme-bin in the meantime.

ful1e5 commented 3 years ago

@yochananmarqos

v1.1.0 PKGBUILD

- pkgver=1.0.3
+ pkgver=1.1.0
# ...
- makedepends=('python-clickgen=1.1.7')
+ makedepends=('python-clickgen')
# ...
build() {
- cd Bibata_Cursor-$pkgver
+ cd Bibata_Cursor-$pkgver/builder
- python build.py --x11
+ make build_unix  # Thats build cursor without `python3 -m virtualenv`
}

We also pass X_SIZES parameter to the make command for the size customization. check-in builder/Makefile L40-L50

yochananmarqos commented 3 years ago

Thanks, updated.

ful1e5 commented 3 years ago

@yochananmarqos Today I tried to install bibata from AUR, Which generating the error regarding the virtualenv commands.
It will be solved by executing the raw command in the build() function. And this also gives us options to customize the sizes.

I hold this issue open for about a week, So other folks share their AUR related issue here.

PKGBUILD

# Maintainer: Shatur95 <genaloner@gmail.com>
# Co-Maintainer: Mark Wagie <mark dot wagie at tutanota dot com>
# Contributor: ful1e5 <kaizmandhu at gmail dot com>

pkgname=bibata-cursor-theme
pkgver=1.1.0
pkgrel=2
pkgdesc="Material Based Cursor Theme"
arch=('any')
url="https://github.com/ful1e5/Bibata_Cursor"
license=('GPL3')
depends=('libxcursor' 'libpng')
makedepends=('python-clickgen')
options=('!strip')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
        "$pkgname-bitmaps-$pkgver.zip::$url/releases/download/v$pkgver/bitmaps.zip")
noextract=("$pkgname-bitmaps-$pkgver.zip")
sha256sums=('7b93fd3a06b7ec71731b611ee28ecaf04e48024453e3e774aed6612a97100ab1'
            '38f2a1e25d446dd81ef4693bf8401734d3200ad8237bbaa2f22c4036713a03ea')

#Customize size
sizes="22 24 28 32 40 48 56 64 72 80 88 96"

prepare() {
  cd Bibata_Cursor-$pkgver
  mkdir -p bitmaps
  bsdtar -xf "$srcdir/$pkgname-bitmaps-$pkgver.zip" -C bitmaps

  rm -rf themes
}

build() {
  cd Bibata_Cursor-$pkgver/builder
  # Build the Bibata-Modern
  python build.py unix -p "../bitmaps/Bibata-Modern-Amber" --xsizes $sizes
  python build.py unix -p "../bitmaps/Bibata-Modern-Classic" --xsizes $sizes
  python build.py unix -p "../bitmaps/Bibata-Modern-Ice" --xsizes $sizes

  # Build the Bibata-Original
  python build.py unix -p "../bitmaps/Bibata-Original-Amber" --xsizes $sizes
  python build.py unix -p "../bitmaps/Bibata-Original-Classic" --xsizes $sizes
  python build.py unix -p "../bitmaps/Bibata-Original-Ice" --xsizes $sizes
}

package() {
  cd Bibata_Cursor-$pkgver
  install -d "$pkgdir"/usr/share/icons
  cp -r themes/Bibata-* "$pkgdir"/usr/share/icons
}
yochananmarqos commented 3 years ago

That doesn't work, it tries to do all the sizes at once:

usage: bibata_builder [-h] [-p PNG] [-o OUT] [-xs INT [INT ...]] [-ws INT] [-wcs INT]
                      [{windows,unix,all}]
bibata_builder: error: argument -xs/--xsizes: invalid int value: '22 24 28 32 40 48 56 64 72 80 88 96'

It would be better to do a for loop or something. I did this for now:

build() {
  cd Bibata_Cursor-$pkgver/builder
  _themes='Amber Classic Ice'

  for t in $_themes; do
    python build.py unix -p "../bitmaps/Bibata-Modern-$t"
    python build.py unix -p "../bitmaps/Bibata-Original-$t"
  done
}
yochananmarqos commented 3 years ago

Got it:

build() {
  cd Bibata_Cursor-$pkgver/builder
  _themes='Amber Classic Ice'
  _sizes='22 24 28 32 40 48 56 64 72 80 88 96'

  set -- ${_sizes}
  for t in ${_themes}; do
    python build.py unix -p "../bitmaps/Bibata-Modern-$t" --xsizes ${_sizes[@]}
    python build.py unix -p "../bitmaps/Bibata-Original-$t" --xsizes ${_sizes[@]}
  done
}