You are not logged in.

#1 2018-02-02 22:22:18

clintval
Member
Registered: 2017-12-18
Posts: 9

[SOLVED] Feedback requested with PKGBUILD and non-standard install ...

I have a package on the AUR which does not build at the moment since a dependency `libodb` and `libodb-sqlite` moved shared objects to a place that the Makefile cannot find them.

Things I have tried:

1. Specifying a non-default location to ODB objects with `-DODB_PATH=/usr/lib/odb/` as suggested in the upstream install instructions:

https://github.com/EBIvariation/vcf-validator#compile

2. Exporting env. variable `LD_LIBRARY_PATH` before making the binaries to include that location.

Neither option worked. Any advice?

PKGBUILD: https://aur.archlinux.org/packages/vcf-validator

EDIT: I know I need to fix other things too like making the source file uniquely named and not required `provides/conflicts`. I will clean the entire PKGBUILD up on next pkgrel, just waiting to get past this one problem.

Last edited by clintval (2018-03-19 21:10:56)

Offline

#2 2018-02-02 23:43:09

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: [SOLVED] Feedback requested with PKGBUILD and non-standard install ...

diff --git a/PKGBUILD b/PKGBUILD
index fa81d33..c1dad04 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,21 +13,19 @@ conflicts=('vcf-validator')
 source=(https://github.com/EBIvariation/"${pkgname}"/archive/v"${pkgver}".tar.gz)
 md5sums=('870899c6ba0ba83b4e0926b54681fce2')
 
-build() {
-  cd "${srcdir}"/"${pkgname}"-"${pkgver}"
-
-  # These files are needed here!
-  # How can I modify make or cmake scripts to respect that?
-
-  #ln -s /usr/lib/odb/libodb-sqlite.so /usr/lib/libodb-sqlite.so
-  #ln -s /usr/lib/odb/libodb.so /usr/lib/libodb.so
+prepare() {
+  mkdir build
+  sed -i '/include_directories (lib)/ a link_directories ("/usr/lib/odb/")' "$pkgname-$pkgver"/CMakeLists.txt
+}
 
-  cmake -G "Unix Makefiles"
+build() {
+  cd build
+  cmake ../$pkgname-$pkgver -DBUILD_SHARED_LIBS=ON
   make
 }
 
 package() {
-  cd "${srcdir}"/"${pkgname}"-"${pkgver}"
+  cd build
 
   mkdir -p "${pkgdir}"/usr/bin
   mkdir -p "${pkgdir}"/usr/share/licenes
@@ -38,6 +36,7 @@ package() {
     cp bin/"${script}" "${pkgdir}"/usr/bin/"${script}"
   done
 
+  cd "${srcdir}"/"${pkgname}"-"${pkgver}"
   install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"_v"${pkgver}"/LICENSE
   install -D -m644 LICENSE_ODB "${pkgdir}"/usr/share/licenses/"${pkgname}"_v"${pkgver}"/LICENSE_ODB
   install -D -m644 README.md "${pkgdir}"/usr/share/doc/"${pkgname}"_v"${pkgver}"/README.md

This is a workaround CMake should really be locating the libraries using its own search routines.

Offline

#3 2018-02-05 07:59:00

clintval
Member
Registered: 2017-12-18
Posts: 9

Re: [SOLVED] Feedback requested with PKGBUILD and non-standard install ...

Thank you! I will try this out this week.

Offline

#4 2018-03-19 21:09:39

clintval
Member
Registered: 2017-12-18
Posts: 9

Re: [SOLVED] Feedback requested with PKGBUILD and non-standard install ...

Hey @loqs thank you so much! This patch definitely works.

FYI I hope this doesn't count as necro-bumping since it has been awhile since I got a chance to try this.

Offline

Board footer

Powered by FluxBB