You are not logged in.

#1 2019-01-02 12:02:28

Vitrum-cnkj34kr8
Member
Registered: 2018-06-19
Posts: 3

[SOLVED] Package contains reference to $pkgdir

I am trying to combine 3 packages in one.

Originally, keyman was separated into 3 packages, which should be installed in correct order:

  1. kmflcomp

  2. libkmfl

  3. ibus-kmfl

So, libkmfl uses headers from kmflcomp, and ibus-kmfl links against kmflcomp.

The software develops and now it consists of 5 parts I would like to join into 1 packages and compile them at once. See below a simplified extract of the new combined PKGBUILD  (not full but can be compiled succesfully). All works fine, but I worry about the warning:

==> WARNING: Package contains reference to $pkgdir
usr/lib/libkmfl.so.0.0.0
usr/lib/ibus/ibus-engine-kmfl
usr/share/ibus/component/kmfl.xml
usr/bin/kmflcomp

How serious is this notice and what do you recommend me: keep them separeted or fix (somehow) linking process?

# Maintainer 2016-2018: Yadav Gowda <yadav . gowda __at__ gmail . com>
# Maintainer: Vitrum <wqdxosty1yhj@bk.ru>

pkgname=keyman
pkgver=12.0.1
pkgrel=1
pkgdesc="IBus engine supporting over 1,000 layouts (former KMFL)"
arch=('i686' 'x86_64')
url="https://keyman.com/"
license=('GPL')
depends=('ibus')
makedepends=('help2man')
replaces=('kmflcomp' 'libkmfl' 'ibus-kmfl')
source=("$pkgname-$pkgver.tar.gz::https://github.com/keymanapp/keyman/archive/linux-release-alpha-$pkgver.tar.gz")
md5sums=('fe60988b3a7081c016e77d097f7612a5')

build() {
    _basedir="$srcdir/keyman-linux-release-alpha-$pkgver/linux"

    # extract headers
    mkdir -p "$srcdir/include/kmfl"
    cp "$_basedir/kmflcomp/include/"*.h "$srcdir/include/kmfl"
    cp "$_basedir/libkmfl/include/"*.h  "$srcdir/include/kmfl"

    # keyman base binaries
    for proj in kmflcomp libkmfl ibus-kmfl; do
        cd "$_basedir/$proj"
        autoreconf --install --force
        ./configure \
            CPPFLAGS="-I$srcdir/include" \
            LDFLAGS="-L$_basedir/kmflcomp/src -L$_basedir/libkmfl/src" \
            --prefix=$pkgdir/usr \
            --libexecdir=$pkgdir/usr/lib/ibus \
            --datadir=$pkgdir/usr/share
        make
    done
}

package() {
    _basedir="$srcdir/keyman-linux-release-alpha-$pkgver/linux"

    # keyman base binaries
    for proj in kmflcomp libkmfl ibus-kmfl; do
        cd "$_basedir/$proj"
        make install
    done
}

Last edited by Vitrum-cnkj34kr8 (2019-01-02 18:57:37)

Offline

#2 2019-01-02 14:22:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 20,767
Website

Re: [SOLVED] Package contains reference to $pkgdir

I'm not sure about the actual warning, but your build function is all wrong.  Do not reference $pkgdir in the build function - that is *not* the proper prefix or datadir.  With luck, that variable will simply be undefined and expand to nothing, in which case it would be harmless - but it just should not be there.

EDIT: nope, I just tested, pkgdir is defined in the build function which makes it far from harmelss, and it also likely explains the warning you are getting.  Get rid of all those uses of $pkgdir in the build function.

Last edited by Trilby (2019-01-02 14:23:48)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2019-01-02 18:44:28

Vitrum-cnkj34kr8
Member
Registered: 2018-06-19
Posts: 3

Re: [SOLVED] Package contains reference to $pkgdir

Problem was solved by replacing `$pkgdir/usr` to `/usr` and so on.

Last edited by Vitrum-cnkj34kr8 (2019-01-02 19:00:04)

Offline

#4 2019-01-02 18:53:00

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 2,249

Re: [SOLVED] Package contains reference to $pkgdir

Vitrum-cnkj34kr8 wrote:

Problem was solved.

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Please also read the Code of Conduct, specifically the "Life is a two way street" section -- how did you solve your problem?

https://wiki.archlinux.org/index.php/Co … way_street

Offline

#5 2019-01-02 19:02:23

Vitrum-cnkj34kr8
Member
Registered: 2018-06-19
Posts: 3

Re: [SOLVED] Package contains reference to $pkgdir

@2ManyDogs
Thank you for the kind remind.

Last edited by Vitrum-cnkj34kr8 (2019-01-02 19:10:17)

Offline

#6 2019-01-02 20:23:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 20,767
Website

Re: [SOLVED] Package contains reference to $pkgdir

Oh .. wait, you *didn't* use $pkgdir for the DESTDIR in the package function.  That's where it should be used.  so you may have solved one problem, but that PKGBUILD will definitely not work - it will make an empty package.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2019-01-03 14:02:56

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 6,509

Re: [SOLVED] Package contains reference to $pkgdir

2 comments

    # extract headers
    mkdir -p "$srcdir/include/kmfl"
    cp "$_basedir/kmflcomp/include/"*.h "$srcdir/include/kmfl"
    cp "$_basedir/libkmfl/include/"*.h  "$srcdir/include/kmfl"

If these are really needed to make sure ./configure finds those files, you should split the headers off to a separate package.

autoreconf --install --force

autoreconf changes sourcefiles and should be run before build() in a prepare() function .


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Online

Board footer

Powered by FluxBB