You are not logged in.

#1 2022-07-13 18:44:53

redshoe
Member
Registered: 2015-12-16
Posts: 250

[solved] Some libraries not being generated using PKGBUILD

I am creating a package for udunits2 library using PKGBUILD. When I compile the library from the source I get the following libraries

libudunits2.a
libudunits2.la
libudunits2.so
libudunits2.so.0
libudunits2.so.0.1.0

But when I create a package with the very same configuration using PKGBUILD, I only get

libudunits2.so
libudunits2.so.0
libudunits2.so.0.1.0

Configure outputs of two cases are identical so I'd expect to have the identical outcome when they are built. I am attaching the configure script and PKGBUILD.

configure script

#!/bin/bash

CC=clang FC=flang CFLAGS='-O3 -march=znver2' FCFLAGS='-O3 -march=znver2' ./configure --prefix=/usr

PKGBUILD

pkgname=udunits
pkgver=2.2.28
pkgrel=1
pkgdesc="aocc compiled udunits"
url="https://www.unidata.ucar.edu/downloads/udunits"
arch=("x86_64")
license=("custom")
depends=("zlib")
provides=("udunits2")
source=("https://artifacts.unidata.ucar.edu/repository/downloads-udunits/${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=("590baec83161a3fd62c00efa66f6113cec8a7c461e3f61a5182167e0cc5d579e")

build() {
  cd ${pkgname}-${pkgver}
  CC=clang FC=flang CFLAGS="-O3 -march=znver2" FCFLAGS="-O3 -march=znver2" ./configure --prefix=/usr 
  make -j4
}

check() {
  cd ${pkgname}-${pkgver}
  make check 
}

package() {
  make DESTDIR="${pkgdir}" install -C ${pkgname}-${pkgver}
}

Am I doing something wrong?

Thanks.

Last edited by redshoe (2022-07-14 04:50:40)

Offline

#2 2022-07-13 21:19:40

mpan
Member
Registered: 2012-08-01
Posts: 1,582
Website

Re: [solved] Some libraries not being generated using PKGBUILD

See the `OPTIONS` entry in your makepkg.conf and the status of the staticlibs option. If your package explicitly requires static libs to not be discarded, `options` array in PKGBUILD should be set acccordingly.

If not that, keep in mind makepkg also defines LDFLAGS, which hipothetically could affect the configure script. LDFLAGS is also defined in makepkg.conf.


Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!

Online

#3 2022-07-14 04:50:22

redshoe
Member
Registered: 2015-12-16
Posts: 250

Re: [solved] Some libraries not being generated using PKGBUILD

mpan wrote:

See the `OPTIONS` entry in your makepkg.conf and the status of the staticlibs option. If your package explicitly requires static libs to not be discarded, `options` array in PKGBUILD should be set acccordingly.

If not that, keep in mind makepkg also defines LDFLAGS, which hipothetically could affect the configure script. LDFLAGS is also defined in makepkg.conf.

Thank you.

Editing the OPTION in the makepkg.conf did the trick!

Offline

#4 2022-07-14 11:58:17

mpan
Member
Registered: 2012-08-01
Posts: 1,582
Website

Re: [solved] Some libraries not being generated using PKGBUILD

redshoe wrote:

Editing the OPTION in the makepkg.conf did the trick!

mpan wrote:

If your package explicitly requires static libs to not be discarded, `options` array in PKGBUILD should be set acccordingly.

!!!


Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!

Online

#5 2022-07-14 14:39:01

redshoe
Member
Registered: 2015-12-16
Posts: 250

Re: [solved] Some libraries not being generated using PKGBUILD

mpan wrote:
redshoe wrote:

Editing the OPTION in the makepkg.conf did the trick!

mpan wrote:

If your package explicitly requires static libs to not be discarded, `options` array in PKGBUILD should be set acccordingly.

!!!

Uh oh.. lol.

Offline

#6 2022-07-14 19:36:20

mpan
Member
Registered: 2012-08-01
Posts: 1,582
Website

Re: [solved] Some libraries not being generated using PKGBUILD

makepkg.conf is there to set user’s preferred defaults. Most packages will (and IMO should) work with any options set there. But if a package really requires specific behavior for whatever reason, it should be explicitly declared in the PKGBUILD for just that single package.


Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!

Online

#7 2022-07-14 19:49:18

redshoe
Member
Registered: 2015-12-16
Posts: 250

Re: [solved] Some libraries not being generated using PKGBUILD

mpan wrote:

makepkg.conf is there to set user’s preferred defaults. Most packages will (and IMO should) work with any options set there. But if a package really requires specific behavior for whatever reason, it should be explicitly declared in the PKGBUILD for just that single package.

Thanks. I changed the makepkg.conf to how it was and added the `options` array into my PKGBUILD.

Offline

Board footer

Powered by FluxBB