You are not logged in.
I got a spidriver (usb-spi adaptor) the other day and noticed there wasn't a package for it in the AUR, so I figured I would make one that builds the utility and also a shared library file for anyone who wants to integrate like I'm doing.
I followed the instructions on this page https://wiki.archlinux.org/index.php/creating_packages but when I run makepkg, all I get is this error about provides containing invalid characters. It doesn't really tell me anything else useful.
I tried deleting provides variable, leaving it empty, using double quotes instead of single, nothing works.
Here is the PKGBUILD
# Maintainer: Aidan MP <admin@bitshift.net.au>
pkgname="spidriver"
pkgver=1.0
pkgrel=1
pkgdesc="Utility and shared library for spidriver usb-spi adaptor"
arch=('any')
url="https://spidriver.com/"
license=('BSD-3-clause')
makedepends=(git)
provides=('spicl and spidriver.so')
source=('https://github.com/jamesbowman/spidriver.git')
md5sums=('SKIP')
validpgpkeys=()
build() {
cd "$pkgname"
make -f linux/Makefile
cd c/common
gcc -o spidriver.so spidriver.c -I./spidriver.h
gcc -c -Wall -Werror -fpic spidriver.c
gcc -shared -o spidriver.so spidriver.o
}
check() {
cd "$pkgname"
make -k check
}
package() {
cd "$pkgname"
sudo cp ./build/spicl /usr/bin
sudo cp c/common/spidriver.so /usr/lib
}Last edited by medicineman25 (2020-01-05 08:58:15)
Offline
provides=('spicl and spidriver.so')provides entries can not contain spaces. Did you intend there to be two entries spicl and spidriver.so?
Offline
Other concerns with the PKGBUILD includethat the pkgname for this should end in '-git' and and license file must be installed too.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
"BSD-3-clause" is also invalid and arch=('any') is wrong. Your make call doesn't exist, which is why you're doing it manually when you shouldn't be. There's no makefile where you're calling make check. Using sudo in package() means you aren't even creating a package.
Last edited by Scimmia (2020-01-04 15:23:10)
Offline
provides=('spicl and spidriver.so')provides entries can not contain spaces. Did you intend there to be two entries spicl and spidriver.so?
I did, also I tried without spaces, with underlines, dashes, one word... nothing worked.
Other concerns with the PKGBUILD includethat the pkgname for this should end in '-git' and and license file must be installed too.
Agreed. How does the license file get 'installed'?
"BSD-3-clause" is also invalid and arch=('any') is wrong. Your make call doesn't exist, which is why you're doing it manually when you shouldn't be. There's no makefile where you're calling make check. Using sudo in package() means you aren't even creating a package.
Aha... I seem to be doing many things wrong. I figured 'any' would be ok as this is platform independent code, it should work on any architecture provided the board has a usb port. I've seen 'any' used before which is why I used it here.
Offline
loqs wrote:provides=('spicl and spidriver.so')provides entries can not contain spaces. Did you intend there to be two entries spicl and spidriver.so?
I did, also I tried without spaces, with underlines, dashes, one word... nothing worked.
It's a bash array. See https://mywiki.wooledge.org/BashGuide/Arrays
Also, "nothing worked" is not helpful: https://bbs.archlinux.org/viewtopic.php?id=57855
Offline
I did, also I tried without spaces, with underlines, dashes, one word
What on earth does this mean? Did you just smash all that content together? There is no way you received the same error message if this was the case. Please provide actual code used and error messages.
As for all the other points raised, we could dig into each of them (and a few more problems that stand out in your PKGBUILD), but frankly we'd just be reciting the wiki page to you. Sit down and actually read the PKGBUILD page on the wiki.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
loqs wrote:provides=('spicl and spidriver.so')provides entries can not contain spaces. Did you intend there to be two entries spicl and spidriver.so?
I did, also I tried without spaces, with underlines, dashes, one word... nothing worked.
This is... really not ambiguous. The error message stated that provides is invalid with spaces in it. You *cannot* get the same error if you remove the spaces or replace them with underlines/dashes.
So you are either mistaken and the PKGBUILD still uses spaces as of the last time you tried, or you are lying about what makepkg said.
Other concerns with the PKGBUILD includethat the pkgname for this should end in '-git' and and license file must be installed too.
Agreed. How does the license file get 'installed'?
Well, the source repository you cloned has a file literally named ./LICENSE
Beyond that, see the instructions at https://wiki.archlinux.org/index.php/PKGBUILD#license
"BSD-3-clause" is also invalid and arch=('any') is wrong. Your make call doesn't exist, which is why you're doing it manually when you shouldn't be. There's no makefile where you're calling make check. Using sudo in package() means you aren't even creating a package.
Aha... I seem to be doing many things wrong. I figured 'any' would be ok as this is platform independent code, it should work on any architecture provided the board has a usb port. I've seen 'any' used before which is why I used it here.
https://wiki.archlinux.org/index.php/PKGBUILD#arch
As the wiki clearly states...
Using "any" means that the package is created once on your machine, and that final spicl and spidriver.so then works on any system of any architecture. (This is plainly wrong! ELF binaries only work on one architecture, unless emulation is involved. bash or python scripts work on any architecture, because they get run in e.g. the python VM.)
Using arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64') would mean that the source code can be used on any system of any architecture in that list, but in order to use it, you'll have to actually compile it for your architecture, and the resulting compiled binary only works on one that one architecture.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
medicineman25 wrote:
loqs wrote:
provides=('spicl and spidriver.so')
provides entries can not contain spaces. Did you intend there to be two entries spicl and spidriver.so?
I did, also I tried without spaces, with underlines, dashes, one word... nothing worked.
It's a bash array. See https://mywiki.wooledge.org/BashGuide/Arrays
Also, "nothing worked" is not helpful: https://bbs.archlinux.org/viewtopic.php?id=57855
Noted. Bash array, got it.
medicineman25 wrote:
I did, also I tried without spaces, with underlines, dashes, one word
What on earth does this mean? Did you just smash all that content together? There is no way you received the same error message if this was the case. Please provide actual code used and error messages.
As for all the other points raised, we could dig into each of them (and a few more problems that stand out in your PKGBUILD), but frankly we'd just be reciting the wiki page to you. Sit down and actually read the PKGBUILD page on the wiki.
Yep. There's a lot of info there, just trying to work through it one bit at a time. I will read the linked pages.
medicineman25 wrote:
loqs wrote:
provides=('spicl and spidriver.so')
provides entries can not contain spaces. Did you intend there to be two entries spicl and spidriver.so?
I did, also I tried without spaces, with underlines, dashes, one word... nothing worked.
This is... really not ambiguous. The error message stated that provides is invalid with spaces in it. You *cannot* get the same error if you remove the spaces or replace them with underlines/dashes.
So you are either mistaken and the PKGBUILD still uses spaces as of the last time you tried, or you are lying about what makepkg said.
Actually it's worse: I totally fucked the pooch. I renamed PKGBUILD.proto to PKGBUILD before closing the file in vim, when exiting I must have accidentally saved another copy as PKGBUILD.proto and so all the changes I was making in that file were not begin reflected in the build because makepkg was still looking at PKGBUILD.
I'm so sorry to waste your time guys, really wasn't intentional. Giant schoolboy error. I'll be more careful in future and I'll take more time when reading the docs.
Thanks for jumping on and offering your advice, you guys are what makes Arch awesome. Much love.
Offline
Actually it's worse: I totally fucked the pooch. I renamed PKGBUILD.proto to PKGBUILD before closing the file in vim, when exiting I must have accidentally saved another copy as PKGBUILD.proto and so all the changes I was making in that file were not begin reflected in the build because makepkg was still looking at PKGBUILD.
I'm so sorry to waste your time guys, really wasn't intentional. Giant schoolboy error. I'll be more careful in future and I'll take more time when reading the docs.
Thanks for jumping on and offering your advice, you guys are what makes Arch awesome. Much love.
No problem, I'm very happy to see that the cause was my first theory ("you made a mistake"). Also, good to see you figured out the problem.
Thanks for being willing to listen, and do feel free to ask more questions (probably in a new thread) if you still need more help after you've gone over the wiki.
Also, lastly, now that your problem is solved, please edit your first post in the thread, and add "[SOLVED]" to the thread title.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline