You are not logged in.
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
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
Thank you for your answer,
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.
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
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
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
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
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
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