You are not logged in.

#1 2016-08-05 23:16:31

gatherix
Member
Registered: 2016-08-05
Posts: 2

[SOLVED] usbscale

https://github.com/erjiang/usbscale

"Usbscale is a program that reads weight data from a USB scale. Compilation is very simple and should work on any system with libusb-1.0 and gcc."

Previously used this on Debian to use my freebie Stamps.com scale.

There are a couple scripts out there but this is the only one I've found to be working. As far as I can tell, Arch already holds all the dependencies?

Would appreciate some help on making a PKGBUILD for this. New to Arch; learning the details of ABS and making PKGBUILD's is on the list, but busy focusing on other things at the moment and need this functionality in the meantime (system is working, loving it so far).

Thanks!

Last edited by gatherix (2016-08-09 16:41:49)

Offline

#2 2016-08-06 06:40:18

alive4ever
Member
Registered: 2016-07-10
Posts: 65

Re: [SOLVED] usbscale

Can you compile it yourself?

If you can compile it, then you can create PKGBUILD for it.
Just copy /usr/share/pacman/PKGBUILD.proto somewhere, rename it to PKGBUILD and edit.

Once you have working PKGBUILD, you can subscribe to aur-general mailing list and ask for recommendation about your new PKGBUILD.

Offline

#3 2016-08-07 16:02:50

NextHendrix
Member
Registered: 2016-06-14
Posts: 3

Re: [SOLVED] usbscale

No problem

pkgname=usbscale-git
pkgver=1
pkgrel=1
pkgdesc="Pipes usb scale weight to stdout"
arch=('any')
license=('GPL')
depends=('libusb')
makedepends=('git gcc')
provides=('usbscale')
source=('git+https://github.com/erjiang/usbscale')
md5sums=("SKIP")
build() {
  cd "$srcdir/usbscale"
  make
}
package() {
  cd "$srcdir/usbscale"
  mkdir -p "$pkgdir/usr/bin"
  cp usbscale $pkgdir/usr/bin/usbscale
}

Don't forget your manners, makepkg -sir

Offline

#4 2016-08-07 16:13:03

atomicbeef
Member
Registered: 2015-09-30
Posts: 98

Re: [SOLVED] usbscale

That PKGBUILD looks okay, but there are a few changes I would make. According to the wiki,

arch=('any')

should only be used if the package can be run anywhere once compiled (which is not the case with C programs). You also don't need to add GCC to makedepends since it's part of base-devel, and you can replace the last two lines of package() with

install -Dm755 usbscale "$pkgdir"/usr/bin/usbscale

to make the PKGBUILD a bit shorter.

Offline

#5 2016-08-07 16:21:11

NextHendrix
Member
Registered: 2016-06-14
Posts: 3

Re: [SOLVED] usbscale

Nice one thanks for the pointers.  Im not going to put it on the AUR because it seems a bit niche but hopefully OP will find it useful

pkgname=usbscale-git
pkgver=1
pkgrel=1
pkgdesc="Pipes usb scale weight to stdout"
arch=('i686 x86_64')
license=('GPL')
depends=('libusb')
makedepends=('git')
provides=('usbscale')
source=('git+https://github.com/erjiang/usbscale')
md5sums=("SKIP")
build() {
  cd "$srcdir/usbscale"
  make
}
package() {
  cd "$srcdir/usbscale"
  install -Dm755 usbscale "$pkgdir"/usr/bin/usbscale
}

Don't forget your manners, makepkg -sir

Offline

#6 2016-08-09 02:17:44

gatherix
Member
Registered: 2016-08-05
Posts: 2

Re: [SOLVED] usbscale

Thanks guys. I used NextHendrix's PKGBUILD, though I changed

arch=('i686 x86_64')

to

arch=('i686' 'x86_64')

to fix an illegal characters error. Otherwise working perfectly. Thanks for the help, nice to have an example to work from now.

Offline

Board footer

Powered by FluxBB