You are not logged in.

#1 2016-07-04 02:33:56

cafe
Member
Registered: 2014-03-20
Posts: 156

[Solved] Makepkg - redirect dirs

Hello,

I'm trying to make a PKGBUILD for a library called SystemC-AMS, but the original sources generate a folder structure as follows

+install_dir
 |-- include
 |-- lib-linux64

I want to map those into standard linux folders such as

+/usr
 |-- include
 |-- lib

What's the recommended way to do this with a PKGBUILD file?

By the way, here's how it look like now :

pkgname=systemc-ams
pkgver=2.0_alpha1
pkgrel=1
pkgdesc="SystemC-AMS is an extension library for SystemC with analog capabilities"
url="http://www.accellera.org/downloads/standards/systemc"
arch=('x86_64' 'i686')
license=('custom:SystemC-AMS Open Source License')
depends=('systemc')
optdepends=()
makedepends=()
conflicts=('systemc-ams')
provides=('systemc-ams')
source=("systemc-ams-2.0_alpha1.tar.gz")
md5sums=('3aa7ac2f0d4939761436eb92add10830')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  mkdir objdir
  cd objdir
  ../configure --prefix=/usr --with-systemc=/usr
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}/objdir"
  make install
  cd ..
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

Why do I need "conflict" and "provides" to be the same? I've seen this in some packages and I'm here just repeating what I've seen. Is this really necessary?

EDIT : Marked as solved.

Last edited by cafe (2016-07-06 22:02:52)

Offline

#2 2016-07-04 03:53:19

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

Re: [Solved] Makepkg - redirect dirs

Conflicts and provides are usually used in e.g. -git packages, if the package is an alternative for another package and cannot coexist but supplies the same software.

It is not applicable here...

...

As for the interesting folder structure, does the configure script offer a --libdir or some such?


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

Offline

#3 2016-07-04 23:56:03

cafe
Member
Registered: 2014-03-20
Posts: 156

Re: [Solved] Makepkg - redirect dirs

Thank you for your answer,

Eschwartz wrote:

Conflicts and provides are usually used in e.g. -git packages, if the package is an alternative for another package and cannot coexist but supplies the same software.

As I suspected. I've now removed the "conflicts" configuration.

Eschwartz wrote:

As for the interesting folder structure, does the configure script offer a --libdir or some such?

Thank you again. You've pointed me to the right direction. I've tested

  • --prefix=

  • --libdir=

  • --includedir=

  • --oldincludedir=

  • --program-prefix=

  • --exec-prefix=

But none of them solved my issue. Looking further into the generated Makefile, it looks like the lib destination folder is hard-coded (or almost)

...
$(mkinstalldirs) $(prefix)/lib-$(TARGET_ARCH)
...

With this in mind, I guess I have two options : Either I'll have to manually rename the folder before packaging the compiled library, or I could patch the configuration file, but I guess that will take more time because I'll have to reverse engineer the whole thing and I'm not very excited about it.

Do you know where in the PKGBUILD file I could rename this folder before compression?

Offline

#4 2016-07-05 00:08:27

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

Re: [Solved] Makepkg - redirect dirs

You can rename it in the package function after `make install`.  Though I don't know why you think you'd need to "reverse engineer" anything to patch the makefile - the following in the buld function right before `make` would likely do it:

sed -i 's/lib-$(TARGET_ARCH)/lib/' Makefile

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

Offline

#5 2016-07-05 01:32:38

cafe
Member
Registered: 2014-03-20
Posts: 156

Re: [Solved] Makepkg - redirect dirs

Right... it would in that particular Makefile.
Unfortunately, that is just one of the many Makefiles created by configure. And I don't fell like reading a 5712 lines configure file.
Thank you for the suggestion though. Renaming the folder seems like a more reasonable solution to me at this moment (end of the semester, lots of things to do)

Cheers

Offline

#6 2016-07-05 07:45:09

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

Re: [Solved] Makepkg - redirect dirs

cafe wrote:

Right... it would in that particular Makefile.
Unfortunately, that is just one of the many Makefiles created by configure.

Why not something like?

find -name Makefile | xargs sed -i 's/lib-$(TARGET_ARCH)/lib/'

Offline

#7 2016-07-06 10:28:24

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [Solved] Makepkg - redirect dirs

Write a propper patch to <insert whatever they are using for makefile generation here> to support some variable for the lib path and submit it upstream. While upstream is busy twiddeling their thumb patch(1) it yourself in the PKGBUILD.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#8 2016-07-06 22:02:04

cafe
Member
Registered: 2014-03-20
Posts: 156

Re: [Solved] Makepkg - redirect dirs

Great ideas,

I´ll use @Trilby´s idea expanded to all Makefiles, like @a821 said, meanwhile I´ll submit the patch upstream.
Marking this thread as solved.

Thank you all,

Offline

Board footer

Powered by FluxBB