You are not logged in.

#1 2015-04-07 17:54:36

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 135
Website

How do you replicate `make install` in the package() section

I've got myself confused in how to package something that uses cmake.

Here's what I have so far.

pkgname=gonepass
pakgver=git
pkgrel=1
pkgdesc="A GTK+ 1Password viewer"
arch=('x86_64' 'i686')
licence="Apache 2.0"
url="https://github.com/jbreams/gonepass"

depends=('gtk3'
         'openssl'
         'jansson'
         'pkg-config'
         'cmake')

source=("git+https://github.com/jbreams/gonepass")
sha256sums=('SKIP')

pkgver() {
    cd gonepass
    git log -n 1 --pretty=format:"%H"
}

build() {
    cd ${pkgname%-*}
    mkdir build
    cd build
    cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/bin ..
    make
}

package() {
    make install
}

What should I be doing in `package()`.

P.S. I also need to work out how to do the package versioning properly but one issue at a time smile

Offline

#2 2015-04-07 18:32:49

afikl
Member
Registered: 2013-02-10
Posts: 8

Re: How do you replicate `make install` in the package() section

There's quite some information on the wiki about how to update the version for git packages, so that's probably a good starting point at least.

As for the package() function, you'll probably just want to go into the srcdir and install to your pkgdir like this, for example. If you want, you could install namcap afterwards and check the resulting package.

Hope that helps!

Offline

#3 2015-04-07 18:41:10

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: How do you replicate `make install` in the package() section

Yes, package() shouldn't need anything special just because cmake is involved, so you can copy from the wiki as well: https://wiki.archlinux.org/index.php/Cr … kage.28.29

Of course, special treatment may be needed for some files (or if the developers supply a weird CMakeLists.txt). More stuff the wiki could help with: license (note the spelling) should be an array, you probably want cmake as a makedepends and pkg-config is in base-devel, so that makedepends doesn't need to be explicit. And a typo: pakgver.

Last edited by Raynman (2015-04-07 18:41:40)

Offline

#4 2015-04-07 19:57:12

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 135
Website

Re: How do you replicate `make install` in the package() section

Thanks for the help guys. The problem I have now is that my package() looks like this:

package() {
  cd $srcdir/$pkgname
  make DESTDIR="$pkgdir" install
}

and results in this error from `makepkg`:

==> Starting package()...
make: *** No rule to make target 'install'.  Stop.
==> ERROR: A failure occurred in package().
    Aborting...

Any ideas?

EDIT: I've edited my PKGBUILD so both `build()` and `package()` use consistently either `cd $pkgname` or `cd $srcdir/$pkgname` and they both resulted in the same error

Last edited by jonnybarnes (2015-04-07 20:10:19)

Offline

#5 2015-04-07 20:17:27

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,650
Website

Re: How do you replicate `make install` in the package() section

Read the makefile. Are there any synonyms for install? Or anything that looks like it copies things from one place to a DESTDIR, or other such location?

I'm curious as to why you're setting CMAKE_INSTALL_PREFIX to /usr/bin. Typically, a prefix would be /usr, or /usr/local, or in exotic cases, /opt.

EDIT: Also, if you're planning on submitting this to the AUR, you should change the pkgname to include "-git", since it builds from a non-static git source.

EDIT EDIT: I notice that you've already submitted it the the AUR with the proper name.

Last edited by WorMzy (2015-04-07 20:21:23)


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.

Offline

#6 2015-04-07 20:27:40

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 135
Website

Re: How do you replicate `make install` in the package() section

Crap, how did I not see that, I swear I searched for it! (I'm not the actual package author btw)

*goes and installs from his PKGBUILD*

Offline

#7 2015-04-08 15:37:43

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 135
Website

Re: How do you replicate `make install` in the package() section

So the authors PKGBUILD already on the AUR doesn't work. In an attempt to get mine working I've edited it to this:

pkgname=gonepass-git
pkgver=r22.0931c63
pkgrel=1
pkgdesc='A GTK+ 1Password viewer'
arch=('x86_64')
licence=('Apache2')
url='https://github.com/jbreams/gonepass'

depends=('gtk3'
         'openssl'
         'jansson')
makedepends=('cmake')

source=("git+https://github.com/jbreams/gonepass")
sha256sums=('SKIP')

pkgver() {
    cd gonepass
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd gonepass
    if [ ! -d build ]; then
        mkdir build
    fi
    cd build
    cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
    make
}

package() {
    cd gonepass/build
    make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR=${pkgdir} install
}

but still get this "error" on running `makepkg`:

==> Starting package()...
[100%] Built target gonepass
Install the project...
-- Install configuration: ""
-- Installing: /home/jonny/builds/gonepass/pkg/gonepass-git/usr/share/glib-2.0/schemas/gonepassapp.gschema.xml
-- Compiling GSettings schemas
Failed to create file '/usr/share/glib-2.0/schemas/gschemas.compiled.0N2WWX': Permission denied
-- Installing: /home/jonny/builds/gonepass/pkg/gonepass-git/usr/bin/gonepass

Anyone know how to stop it trying to compile the gsetting scemas?

EDIT: fixed this by changing to simple make DESTDIR="$pkgdir" install, and adding -DGSETTINGS_COMPILE=OFF to the cmake command.

Last edited by jonnybarnes (2015-04-08 15:53:54)

Offline

Board footer

Powered by FluxBB