You are not logged in.

#1 2016-05-23 14:45:41

rican-linux
Member
Registered: 2014-11-16
Posts: 63

PKGBUILD will not install some files

I am working on a PKGBUILD file that will install minitube from git. This is my first attempt at making a PKGBUILD and I seem to be stuck and would like some input. So far I can download, compile, and install the binary fine. However the PKGBUILD file is not installing the minitube.desktop nor the icons to their proper location. Below is my package (). If I am missing something please let me know. Thanks!

package() {
  cd "$srcdir/$pkgname-$pkgver"
  msg2 "Installing..."
  install -Dm755 "build/target/minitube" "${pkgdir}/usr/bin/minitube"
  install -Dm644 "minitube.desktop" "${pkgdir}/usr/share/applications/minitube.desktop"
  
  #Icons install
  cd "$srcdir/$pkgname-$pkgver/data/"
  for i in 16x16 22x22 24x24 32x32 48x48 64x64 128x128 256x256; do
    install -Dm644 "${pkgdir}/usr/share/icons/hicolor/$i/apps/minitube.png"
  done
}

Offline

#2 2016-05-23 14:47:55

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: PKGBUILD will not install some files

The desktop file looks fine. The icons, though, you're missing an argument.

Offline

#3 2016-05-24 05:55:58

rican-linux
Member
Registered: 2014-11-16
Posts: 63

Re: PKGBUILD will not install some files

what argument am I missing?

Offline

#4 2016-05-24 10:05:30

a821
Member
Registered: 2012-10-31
Posts: 381

Re: PKGBUILD will not install some files

You are missing either the SOURCE or DESTINATION in the install call...

Offline

#5 2016-05-25 14:11:40

rican-linux
Member
Registered: 2014-11-16
Posts: 63

Re: PKGBUILD will not install some files

I have updated the package(). However the files are still not installing. So to verify my syntax I executed each install command in the terminal and they all worked as expected. So I am at a loss as to why they work in terminal and not in the PKGBUILD file when makepkg is running. Below is my updated function

package() {
  cd "$srcdir/$pkgname-$pkgver"
  msg2 "Installing..."
  install -D -m755 build/target/minitube "$pkgdir/usr/bin/minitube"
  install -D -m644 minitube.desktop "$pkgdir/usr/share/applications/minitube.desktop"
  install -D -m644 sounds/snapshot.wav "$pkgdir/usr/share/$pkgname/snapshot.wav"
  install -D -m644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
  
  #Icons install
  cd "$srcdir/$pkgname-$pkgver/data/"
  for i in 16x16 22x22 32x32 48x48 64x64 128x128 256x256; do
    install -D -m644 $i/minitube.png "${pkgdir}/usr/share/icons/hicolor/$i/apps/minitube.png"
  done
}

Offline

#6 2016-05-25 14:41:00

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: PKGBUILD will not install some files

Log?

Offline

#7 2016-05-25 15:36:35

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,784
Website

Re: PKGBUILD will not install some files

Please also post the full PKGBUILD.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#8 2016-05-25 21:36:56

rican-linux
Member
Registered: 2014-11-16
Posts: 63

Re: PKGBUILD will not install some files

I think I fixed my issue. It looks like I need to delete my source files and rebuild the package. I have been just editing my PKGBUILD and then uninstalling the binary with pacman -R and reinstalling with makepkg -i. After the package was rebuilt everything installed as expected. I am still going to post my full PKGBUILD in case anyone has any suggestions for me.

# Maintainer:
# Contributor: 
# Contributor: 
# Per the developer: Google is now requiring an API key in order to access YouTube Data web services.
# Create a "Browser Key" at https://console.developers.google.com
#
# The key must be specified at compile time as shown below.
# Alternatively Minitube can read an API key from the GOOGLE_API_KEY environment variable.
pkgname='minitube-git'
pkgver='2.5.2'
pkgrel='1'
pkgdesc='A youtube client that does not need flash'
conflicts=('minitube' 'minitube-aur')
arch=('i686' 'x86_64')
url='http://flavio.tordini.org/minitube'
license=('gpl3')
install=${pkgname}.install
depends=('phonon-qt5' 
         'qt5-script' 
         'hicolor-icon-theme'
         'libva-vdpau-driver')
makedepends=('git')
source=("$pkgname-$pkgver"::'git://github.com/flaviotordini/minitube.git')
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$pkgname-$pkgver"
  git describe --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  msg2 "Building..."
  qmake-qt5 "DEFINES += APP_GOOGLE_API_KEY=MyAPIKey"
  make
}

check() {
  cd "$srcdir/$pkgname-$pkgver"
  msg2 "Checking..."
  make -k check
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  msg2 "Installing..."
  install -D -m755 build/target/minitube "$pkgdir/usr/bin/minitube"
  install -D -m644 minitube.desktop "$pkgdir/usr/share/applications/minitube.desktop"
  install -D -m644 sounds/snapshot.wav "$pkgdir/usr/share/$pkgname/snapshot.wav"
  install -D -m644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
  
  #Icons install
  cd "$srcdir/$pkgname-$pkgver/data/"
  for i in 16x16 22x22 32x32 48x48 64x64 128x128 256x256; do
    install -D -m644 $i/minitube.png "${pkgdir}/usr/share/icons/hicolor/$i/apps/minitube.png"
  done
}

Offline

#9 2016-05-25 22:09:37

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: PKGBUILD will not install some files

Right, well, you should've seen the message:

==> WARNING: A package has already been built, installing existing package...

Instead of the usual status messages which you see when actually building a package.

...

A couple notes on your PKGBUILD:

1) Do not use $pkgame-$pkgver as the download directory for the source repo. You will will have to redownload every time the pkgver gets updated, wich defeats the purpose of using a git checkout. Just use the $pkgname or leave it alone.

2) There is no need to use the msg2 prints you stuck in there. makepkg already tells you which stage of the package creation you are on.

3) When installing the icons, you are already in "$srcdir/$pkgname-$pkgver", so you could just cd to "data".

4) If you are going to allow build-time specification of an API key, store it in a variable at the top of the PGBUILD. e.g.

# Per the developer: Google is now requiring an API key in order to access YouTube Data web services.
# Create a "Browser Key" at https://console.developers.google.com
# Alternatively Minitube can read an API key from the GOOGLE_API_KEY environment variable.
my_google_api_key=

5) The license available in /usr/share/licenses/common/ is "GPL3" not "gpl3".By convention it should be capitalized.

6) You didn't specify the install file you are using, but it is probably one of the boilerplate ones that are now obsoleted by the hooks system. If so,  you can remove it.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#10 2016-05-26 01:17:25

rican-linux
Member
Registered: 2014-11-16
Posts: 63

Re: PKGBUILD will not install some files

Thank you for the suggestions. I greatly appreciate it.

Offline

Board footer

Powered by FluxBB