material-decoration icon indicating copy to clipboard operation
material-decoration copied to clipboard

AUR Package

Open lucazade opened this issue 5 years ago • 9 comments

I would be nice to have an AUR package for ArchLinux and Manjaro

lucazade avatar Jun 13 '20 07:06 lucazade

I've modified an existing AUR package, but never created one before. So this will be a learning experience.

https://wiki.archlinux.org/index.php/AUR_submission_guidelines#Creating_package_repositories

For the package name, I'll probably use material-decoration-git or kwin-decoration-material-git. Searching for decoration finds:

  • https://aur.archlinux.org/packages/fluent-decoration-git/ (fork of zzag's Material Decoration)
  • https://aur.archlinux.org/packages/kwin-decoration-sierra-breeze-enhanced-git/
  • https://aur.archlinux.org/packages/sierrabreeze-jomada-kwin-decoration-git/
  • https://aur.archlinux.org/packages/sierrabreeze-kwin-decoration-git/

fluent-decoration-git changed the namespace from com.github.zzag.material to com.github.sunnjek.fluent. I should probably do that too, and maybe rename the project to differentiate from @zzag's (archived) project. That'll break the existing install base though.

Zren avatar Jun 18 '20 16:06 Zren

I should probably do that too, and maybe rename the project to differentiate from @zzag's (archived) project.

Yeah, it's a good idea. I wonder if it's possible to move the ownership of a repo to somebody else so the fork becomes "a new upstream."

Feel free to change the plugin id and keep the existing name.

zzag avatar Jun 18 '20 16:06 zzag

  • [x] Confirm Id doesn't matter for cmake install
  • [x] Confirm behavior when library in kwinrc is invalid.
    • It falls back to Breeze. kwinrc remains unchanged.
  • [x] Change Id
  • [x] Write upgrade process in ReadMe

I was reluctant to change the id without changing the name as existing users may end up with 2 installed versions of it, requiring notifying everyone to do this:

git checkout v0
cd build
sudo make uninstall
git checkout master
# build + install...

However since the .so file is overwriten, that not a problem.


It doesn't look like the Id matters for the installation, as it's installed to:

/usr/lib/qt/plugins/org.kde.kdecoration2/materialdecoration.so

Other's don't use the Id in the filename either.

$ ls /usr/lib/qt/plugins/org.kde.kdecoration2
breezedecoration.so  breezeenhanced.so  kwin5_aurorae.so  materialdecoration.so  sierrabreezeenhanced.so

So changing the Id will overwrite the existing *.so file. So the user will not end up with 2 installed version of the kdecoration (I need to confirm this after supper).

The main issue with existing users is the need to switch to Breeze first, then reinstall Material, then select Material again. As they currently have:

# ~/.config/kwinrc
[org.kde.kdecoration2]
library=com.github.zzag.material
theme=Material

I'm not sure if Plastic or Breeze is used if kwinrc has an invalid library.

Zren avatar Jun 18 '20 19:06 Zren

I'm not sure if Plastic or Breeze is used if kwinrc has an invalid library.

It depends on whether Breeze is available at compile-time. If it is, kwin will fallback to breeze; otherwise it will fallback to plastik.

zzag avatar Jun 19 '20 10:06 zzag

thanks for the ongoing work.. any update on this? :)

lucazade avatar Jul 11 '20 07:07 lucazade

https://aur.archlinux.org/packages/material-kwin-decoration-git/ Tell me if there's any issue.

I used gnome-shell-git as a base for creating a pretty pkgver. Used a few other tricks from fluent-decoration-git too.

  • https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=material-kwin-decoration-git
  • https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=gnome-shell-git
  • https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=fluent-decoration-git

Zren avatar Jul 14 '20 15:07 Zren

You don't need to specify -DCMAKE_BUILD_TYPE and -DCMAKE_INSTALL_PREFIX, makepkg will pick up the right ones.

You could also get rid of prepare() by specifying the build directory in the cmake command, e.g. cmake -B builddir -S sourcedir -Dfoobar, see https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=plasma5-wallpapers-dynamic

zzag avatar Jul 14 '20 17:07 zzag

Needed to add extra-cmake-modules (mentioned in a comment on AUR). I've removed prepare() to use cmake -B "build" and make -C "build". I'll keep cmake --build and cmake --install in mind, as this is the first I've heard of them.

Zren avatar Jul 22 '20 17:07 Zren

Thanks for the package.. works great! I just add the prepare section in order to fix some params in src (please make them configurable!)

prepare() {
  cd "${srcdir}/${_pkgname}"
  git submodule init
  git submodule update

  sed -i 's/s_titleBarOpacityActive = 0.75/s_titleBarOpacityActive = 1.0/g' ${srcdir}/material-kwin-decoration/src/Decoration.cc
  sed -i 's/s_titleBarOpacityInactive = 0.85/s_titleBarOpacityInactive = 1.0/g' ${srcdir}/material-kwin-decoration/src/Decoration.cc
  sed -i 's/"blur": true/"blur": false/g' ${srcdir}/material-kwin-decoration/src/material.json
}

lucazade avatar Jul 25 '20 07:07 lucazade