You are not logged in.
Hi all.
I've managed to write a PKGBUILD for livewallpaper. It has all plugins working, a patch for the photoslide plugin, and compiles schemas properly.
If anyone's interested, please give me some feedback on it. Cheers.
Known issue:
The icons need to be installed to /usr/local/share/icons or it cant find them and placeholders get used. I'll try and find a way to correct this.
# Maintainer: Your Name <silkworm2.5 at g mail dot com>
pkgname=livewallpaper
pkgver=0.5.0
pkgrel=1
pkgdesc="OpenGL animated wallpaper with plugins and indicator"
arch=('any')
url="https://code.launchpad.net/~fyrmir/livewallpaper/trunk"
license=('GPL')
depends=('glib2' 'gdk-pixbuf2' 'libpeas' 'glew' 'upower')
makedepends=('xcftools' 'appstream-glib' 'cmake' 'gtk-doc' 'gobject-introspection' 'libxxf86misc')
checkdepends=()
optdepends=()
provides=(livewallpaper-indicator livewallpaper-config)
conflicts=()
replaces=()
options=()
install=
source=('livewallpaper::bzr+lp:livewallpaper')
sha256sums=('SKIP')
#prepare=(){
# }
build() {
mkdir -p ./livewallpaper/build
cd ./livewallpaper/build
sed 's/fromstring/frombyte/' <../plugins/photoslide/photoslide.py <../plugins/photoslide/photoslide.py
sed 's/tostring/tobyte/' <../plugins/photoslide/photoslide.py <../plugins/photoslide/photoslide.py
export LDFLAGS=-lX11
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
make
}
package() {
cd livewallpaper/build
make DESTDIR="${pkgdir}" install
mkdir -p "${pkgdir}"/usr/local/share/icons
cp -r "${pkgdir}"/usr/share/icons/ "${pkgdir}"/usr/local/share/
}EDIT: Just realised the sed lines aren't working, working on that now.
Last edited by Silkworm205 (2015-11-13 14:35:58)
I think I know enough to know I don't know enough.
Offline
Well, you should add bzr to the makedepends array, and you should change the name of the package to livewallpaper-bzr (in accordance to the VCS package guidelines). You must also add vala and intltool.
The package also provides some ELFs so you should not use the 'any' architecture. If the software works on both x86_64 and i686 then just use arch=('i686' 'x86_64')
As for the sed invocations... is this what you are trying to do?
sed 's/fromstring/frombyte/' -i ../plugins/photoslide/photoslide.py
sed 's/tostring/tobyte/' -i ../plugins/photoslide/photoslide.pyFinally, the files above seems to be python, does this software depend on python somehow?
Offline
Thanks for the pointers. It does depend on python, I looked at the cmake files dependencies and never thought of bzr and python itself.
The sed line is supposed to replace the words fromstring and tostring to frombyte and tobyte respectively. I've found the lines are now working but the plugin itself no longer is. I had it working earlier, so I'll have to rack my brain and find out what I changed.
Thanks for the sed lines. I'd already changed them, but it's good to know they're on the right track now.
# Maintainer: <silkworm2.5 at g mail dot com>
pkgname=livewallpaper-bzr
pkgver=0.5.0
pkgrel=1
pkgdesc="OpenGL animated wallpaper with plugins and indicator"
arch=('i686' 'x86_64')
url="https://code.launchpad.net/~fyrmir/livewallpaper/trunk"
license=('GPL')
depends=('glib2' 'gdk-pixbuf2' 'libpeas' 'glew' 'upower' 'intltool' 'vala' 'python')
makedepends=('xcftools' 'appstream-glib' 'cmake' 'gtk-doc' 'gobject-introspection' 'libxxf86misc' 'bzr')
checkdepends=()
optdepends=()
provides=(livewallpaper-indicator livewallpaper-config)
conflicts=()
replaces=()
options=()
install=
source=('livewallpaper::bzr+lp:livewallpaper')
sha256sums=('SKIP')
#prepare=(){
# }
build() {
mkdir -p ./livewallpaper/build
cd ./livewallpaper/build
sed -i 's/fromstring(/frombyte(/' ../plugins/photoslide/photoslide.py
sed -i 's/tostring(/tobyte(/' ../plugins/photoslide/photoslide.py
export LDFLAGS=-lX11
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
make
}
package() {
cd livewallpaper/build
make DESTDIR="${pkgdir}" install
mkdir -p "${pkgdir}"/usr/local/share/icons
cp -r "${pkgdir}"/usr/share/icons/ "${pkgdir}"/usr/local/share/
}Thanks for the feedback, I've integrated it above.
Last edited by Silkworm205 (2015-11-13 16:45:15)
I think I know enough to know I don't know enough.
Offline
There's already 'livewallpaper' package in the AUR? https://aur.archlinux.org/packages/livewallpaper/
With that said if you wish to create -bzr version that would build latest trunk revision then go ahead.
- fill in 'provides' and 'conflicts' fields with 'livewallpaper'
- add pkgver
pkgver() {
cd "$pkgname"
echo "r$(bzr revno)"
}- copy *.install file from that AUR package I linked above...
- also, check that pkgbuild file for a bit trimmed down version of depends & makedepends... and other tips ;-)
Good luck.
Offline
Thanks for pointing that out Metak. I never checked since I tried (and failed) to maintain livewallpaper before the AUR changeover. I was considering dropping this since it's already there, (no point rebuilding the wheel) but it's an older version and has an odd error when I try to build it. "package 'appindicator3-0.1' not found"
I'll continue with this one and see if I can get the photoslide plugin to work. If not then hey, at least I can get the rest to work. I don't know what package provides what Salamandars is missing.
I've integrated your code and will next look into using the .INSTALL file you mentioned Metak. Thanks for your feedback, both of you.
EDIT: I got photoslide to work. I went and used sed to change a sting to byte instead of bytes. It all works now for me. Could anyone else verify it builds/works for them too please?
PKGBUILD
# Maintainer: <silkworm2.5 at g mail dot com>
pkgname=livewallpaper-bzr
pkgver() {
cd "$pkgname"
echo "r$(bzr revno)"
}
pkgrel=1
pkgdesc="OpenGL animated wallpaper with plugins and indicator"
arch=('i686' 'x86_64')
url="https://code.launchpad.net/~fyrmir/livewallpaper/trunk"
license=('GPL')
depends=('glib2' 'gdk-pixbuf2' 'libpeas' 'glew' 'upower' 'intltool' 'vala' 'python')
makedepends=('xcftools' 'appstream-glib' 'cmake' 'gtk-doc' 'gobject-introspection' 'libxxf86misc' 'bzr')
checkdepends=()
optdepends=()
provides=('livewallpaper-indicator' 'livewallpaper-config')
conflicts=('livewallpaper')
replaces=()
options=()
install=
source=('livewallpaper::bzr+lp:livewallpaper')
sha256sums=('SKIP')
install=schemas.install
build() {
mkdir -p ./livewallpaper/build
cd ./livewallpaper/build
sed -i 's/fromstring(/frombytes(/' ../plugins/photoslide/photoslide.py
sed -i 's/tostring(/tobytes(/' ../plugins/photoslide/photoslide.py
export LDFLAGS=-lX11
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
make
}
package() {
cd livewallpaper/build
make DESTDIR="${pkgdir}" install
mkdir -p "${pkgdir}"/usr/local/share/icons
cp -r "${pkgdir}"/usr/share/icons/ "${pkgdir}"/usr/local/share/
mkdir -p "${pkgdir}"/usr/share/glib-2.0/schemas/
cp "${srcdir}"/livewallpaper/build/data/net.launchpad.livewallpaper.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/nexus/net.launchpad.livewallpaper.plugins.nexus.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.nexus.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/noise/net.launchpad.livewallpaper.plugins.noise.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.noise.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/galaxy/net.launchpad.livewallpaper.plugins.galaxy.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.galaxy.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/circles/net.launchpad.livewallpaper.plugins.circles.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.circles.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/gradclock/net.launchpad.livewallpaper.plugins.gradclock.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.gradclock.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/photoslide/net.launchpad.livewallpaper.plugins.photoslide.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.galaxy.photoslide.xml
}schemas.install
post_install() {
glib-compile-schemas /usr/share/glib-2.0/schemas
}Last edited by Silkworm205 (2015-11-14 00:02:09)
I think I know enough to know I don't know enough.
Offline
The pkgver function does not work: the cd command fails because there is no directory named "$pkgname". Try using
pkgver() {
cd "${srcdir}/livewallpaper"
echo "r$(bzr revno)"
}Except the above mentioned issue, It builds fine here.
Offline
pkgname=livewallpaper-bzr
pkgver=0.5.0.r322
pkgrel=1
pkgdesc="OpenGL powered animated wallpapers with configuration utility, autostart, and application indicator."
arch=('i686' 'x86_64')
url="https://launchpad.net/livewallpaper"
license=('GPL3')
depends=('desktop-file-utils' 'glew' 'libpeas' 'python2-opengl' 'python2-pillow' 'upower')
makedepends=('appstream-glib' 'gobject-introspection' 'gtk-doc' 'intltool' 'vala' 'xcftools')
provides=('livewallpaper' 'livewallpaper-indicator' 'livewallpaper-config')
conflicts=('livewallpaper')
install='livewallpaper.install'
source=('livewallpaper::bzr+lp:livewallpaper')
sha256sums=('SKIP')
pkgver() {
cd livewallpaper
echo "0.5.0.r$(bzr revno)"
}
build() {
mkdir -p livewallpaper/build
cd livewallpaper/build
sed -i "s/set(LIVEWALLPAPER_REQUIRES\
/&\n\tx11/" ../CMakeLists.txt
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_OPTIMIZATION=ON
make
}
package() {
cd livewallpaper/build
make DESTDIR="$pkgdir/" install
}post_install() {
glib-compile-schemas /usr/share/glib-2.0/schemas
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
}
post_upgrade() {
post_install
}
post_remove() {
post_install
}Offline
@metak
Hard-coding a version number for a VCS package is rarely a good idea. If you want it there, you should try to pull it out of either bzr or the code.
That sed command should really be done in the prepare function, and should be cleaned up.
@Silkworm205
Packages can't put things in /usr/local/
You still need a pkgver variable, along with the pkgver function.
Last edited by Scimmia (2015-11-14 15:13:23)
Offline
@Scimmia
I just gave him an example based on the pkgbuild in the AUR, and you're right revision number would suffice.
He can clean it further if he wishes to do so, and his things are put in /usr/local because of that DCMAKE_INSTALL_PREFIX, right?
In my case it puts it where it should be.
Offline
@Scimmia
I knew that /usr/local was taboo but I couldn't get it to access its icons without putting them there. That's sorted now.
@Metak
I manually relocated the items to /usr/local after building. the DCMAKE_INSTALL_PREFIX was going to /usr/ alone, but your line in post.install to update the icon cache cleared up the icon issue! So bang goes /usr/local. Thanks so much for that.
Could you explain what your sed line does please? All I see it do is add x11 to the dependencies field of the CMakeLists.txt
It now builds with a proper version number, steers clear of /usr/local, has working icons, and most importantly, works. Here's the files.
There's some interexting behaviour on the pkgver code. It alters the PKGBUILD to contain the correct version number, overwriting anything else. I didn't realise it could do that.
PKGBUILD
# Maintainer: <silkworm2.5 at g mail dot com>
pkgname=livewallpaper-bzr
pkgver=0.5.0.r322
pkgrel=1
pkgdesc="OpenGL animated wallpaper with plugins and indicator"
arch=('i686' 'x86_64')
url="https://code.launchpad.net/~fyrmir/livewallpaper/trunk"
license=('GPL')
depends=('glib2' 'gdk-pixbuf2' 'libpeas' 'glew' 'upower' 'intltool' 'vala' 'python')
makedepends=('xcftools' 'appstream-glib' 'cmake' 'gtk-doc' 'gobject-introspection' 'libxxf86misc' 'bzr')
checkdepends=()
optdepends=()
provides=('livewallpaper-indicator' 'livewallpaper-config')
conflicts=('livewallpaper')
replaces=()
options=()
install=
source=('livewallpaper::bzr+lp:livewallpaper')
sha256sums=('SKIP')
install=schemas.install
pkgver() {
cd livewallpaper
echo "0.5.0.r$(bzr revno)"
}
prepare() {
mkdir -p "${srcdir}"/livewallpaper/build
cd "${srcdir}"/livewallpaper/build
sed -i 's/fromstring(/frombytes(/' "${srcdir}"/livewallpaper/plugins/photoslide/photoslide.py
sed -i 's/tostring(/tobytes(/' "${srcdir}"/livewallpaper/plugins/photoslide/photoslide.py
}
build() {
cd "${srcdir}"/livewallpaper/build
export LDFLAGS=-lX11
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DENABLE_OPTIMIZATION=ON ..
make
}
package() {
cd livewallpaper/build
make DESTDIR="${pkgdir}" install
mkdir -p "${pkgdir}"/usr/share/glib-2.0/schemas/
cp "${srcdir}"/livewallpaper/build/data/net.launchpad.livewallpaper.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/nexus/net.launchpad.livewallpaper.plugins.nexus.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.nexus.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/noise/net.launchpad.livewallpaper.plugins.noise.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.noise.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/galaxy/net.launchpad.livewallpaper.plugins.galaxy.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.galaxy.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/circles/net.launchpad.livewallpaper.plugins.circles.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.circles.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/gradclock/net.launchpad.livewallpaper.plugins.gradclock.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.gradclock.gschema.xml
cp "${srcdir}"/livewallpaper/build/plugins/photoslide/net.launchpad.livewallpaper.plugins.photoslide.gschema.xml "${pkgdir}"/usr/share/glib-2.0/schemas/net.launchpad.livewallpaper.plugins.galaxy.photoslide.xml
}schemas.install
post_install() {
glib-compile-schemas /usr/share/glib-2.0/schemas
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
}Thanks both of you for your feedback. I really appreciate it.
I think I know enough to know I don't know enough.
Offline
I don't know what is wrong on your end, but for me everything installs/runs fine and there's no need to manually create schemas dir and copy them over.
You can remove that sed line since you have export LDFLAGS in yours, it's from the aur package that I've modified.
And, also you shouldn't name *.install file 'schemas.install'. Use package name 'livewallpaper.install' and don't remove post_upgrade post_remove.
'desktop-file-utils' dependency is because the package installs *.desktop file in /usr/share/applications and should run update-desktop-database, so your 'livewallpaper.install' file should look like this:
post_install() {
update-desktop-database -q
glib-compile-schemas /usr/share/glib-2.0/schemas
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
}
post_upgrade() {
post_install
}
post_remove() {
post_install
}Offline
Looking back, I now realise the schema copying was me "fixing" an issue from when it installed to /usr/local. I never checked after installing to /usr that that was solved. Thanks for pointing that out,
Here's the newer new version.
PKGBUILD
# Maintainer: <silkworm2.5 at g mail dot com>
pkgname=livewallpaper-bzr
pkgver=0.5.0.r322
pkgrel=1
pkgdesc="OpenGL animated wallpaper with plugins and indicator"
arch=('i686' 'x86_64')
url="https://code.launchpad.net/~fyrmir/livewallpaper/trunk"
license=('GPL')
depends=('glib2' 'gdk-pixbuf2' 'libpeas' 'glew' 'upower' 'intltool' 'vala' 'python')
makedepends=('xcftools' 'appstream-glib' 'cmake' 'gtk-doc' 'gobject-introspection' 'libxxf86misc' 'bzr')
checkdepends=()
optdepends=()
provides=('livewallpaper-indicator' 'livewallpaper-config')
conflicts=('livewallpaper')
replaces=()
options=()
source=('livewallpaper::bzr+lp:livewallpaper')
sha256sums=('SKIP')
install=livewallpaper.install
pkgver() {
cd livewallpaper
echo "0.5.0.r$(bzr revno)"
}
prepare() {
mkdir -p "${srcdir}"/livewallpaper/build
cd "${srcdir}"/livewallpaper/build
sed -i 's/fromstring(/frombytes(/' "${srcdir}"/livewallpaper/plugins/photoslide/photoslide.py
sed -i 's/tostring(/tobytes(/' "${srcdir}"/livewallpaper/plugins/photoslide/photoslide.py
}
build() {
cd "${srcdir}"/livewallpaper/build
export LDFLAGS=-lX11
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DENABLE_OPTIMIZATION=ON ..
make
}
package() {
cd livewallpaper/build
make DESTDIR="${pkgdir}" install
}livewallpaper.install
post_install() {
update-desktop-database -q
glib-compile-schemas /usr/share/glib-2.0/schemas
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
}
post_upgrade() {
post_install
}
post_remove() {
post_install
}I think I know enough to know I don't know enough.
Offline