You are not logged in.

#1 2017-03-16 22:34:09

Registered: 2017-03-16
Posts: 9

[Solved] Packaging a Theme

I am new to Arch and spent the last 3 hours reading the WIKI about creating packages and PKGBUILD and I was trying to install my package. Here is the situation:
I have made a theme for GTK 3. It is essentially a folder with the theme files. In order for gnome to apply the theme, it has to be in /usr/share/themes.
For that I packaged the my theme (a folder) to a tar.gz file and put it in ~/abs/mytheme (like described in the wiki). In that same directory I created a PKGBUILD file with the following content:

pkgdesc="This is a sample desc."
#This is the tar file containing the folder which belongs in /usr/share/themes
#I will add this later

package() {
   cd $srcdir
   mkdir -p $pkgdir/share/themes && cp -r MyTheme $pkgdir/share/themes

As you can see I don't run build, since I don't have any source code. Thus the install process is simply copying the MyTheme folder in /usr/share themes.
And here are the 2 problems:
1) It creates a .pkg.tar file and not like in the wiki described a .pkg.tar.xz
2) When running sudo pacman -S mytheme-1.0-1-any.pkg.tar I get the error message:

warning: 'mytheme-1.0-1-any.pkg.tar' is a file, did you mean -U/--upgrade instead of -S/--sync?

I hope you can help me, since all the tutorials about packaging involve building source code (which my theme does not contain)

Last edited by b_stefan (2017-03-16 23:38:41)


#2 2017-03-16 23:02:02

Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 2,535

Re: [Solved] Packaging a Theme

1) Have you edited the compression options in your makepkg.conf?

2) The error is self explanitory, pacmans -S switch is for installing packages from the repositories - you need the -U switch to install from a local file.

It's also best practice to use the install command instead of cp when writing PKGBUILDs.

Edit - You also have the wrong paths in your package function, it should be $pkgdir/usr/share/themes

Last edited by Slithery (2017-03-16 23:06:12)

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles


#3 2017-03-16 23:22:36

Registered: 2017-03-16
Posts: 9

Re: [Solved] Packaging a Theme

Thank you so much for the answer. I can't believe I made such a trivial mistake hmm The installation works flawlessly now.
As for the compressing options, I didn't change anything.
As for the install command: By using it, will I be able to uninstall my package, because pacman -r doesn't work (which I already suspected).
EDIT: I figguerd out how to uninstall my package and thus my last point is clear now smile
EDIT2: I managed to change my format to .pkg.tar.xz by modifying the makepkg.conf. By that, all my questions are answered now.

Last edited by b_stefan (2017-03-16 23:37:09)


Board footer

Powered by FluxBB