You are not logged in.

#1 2014-06-02 14:02:16

johannesWinter
Member
Registered: 2014-04-08
Posts: 13

Advice/Review for PKGBUILD

Hi,

I'm in the process of creating my first package build. It's for this application: http://www.danielgm.net/cc/

# Maintainer: Johannes Sauer <joh.sauer(at)gmail(dot)com>

pkgname=cloudcompare-git
pkgver=2.5.0.r438.g8456e58
pkgrel=1
pkgdesc="CloudCompare is a 3D point cloud (and triangular mesh) processing software"
arch=('i686' 'x86_64')
url="http://www.danielgm.net/cc/"
license=('GPL2')
depends=('qt4' 'glu' 'mesa') 
makedepends=('git' 'cmake')
optdepends=('pcl')
source=("git+https://github.com/cloudcompare/trunk")
md5sums=('SKIP') 

pkgver() {
  cd "$srcdir/trunk"
  git describe --long | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cd "$srcdir/trunk"
  
  [[ -d build ]] && rm -r build
  mkdir -p build && cd build
  
  cmake .. \
     -DCMAKE_BUILD_TYPE=Release \
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DBUILD_QPCL_PLUGIN_DOCUMENTATION=ON \
     -DINSTALL_QPCL_PLUGIN=ON \
     -DINSTALL_QSRA_PLUGIN=OFF \
     -DINSTALL_QPOISSON_RECON_PLUGIN=OFF \
     -DINSTALL_QHPR_PLUGIN=OFF \
     -DINSTALL_QRANSAC_SD_PLUGIN=OFF \
     -DINSTALL_QKINECT_PLUGIN=OFF \
     -DINSTALL_QBLUR_PLUGIN=OFF \
     -DINSTALL_QEDL_PLUGIN=OFF \
     -DINSTALL_QPCV_PLUGIN=OFF \
     -DINSTALL_QDUMMY_PLUGIN=OFF \
     -DINSTALL_QSSAO_PLUGIN=OFF 

	make
}

package() {
  cd "$srcdir/trunk/build"
  make DESTDIR="$pkgdir/" install
}

It's building and I'm able to run the program. But I still have trouble with the paths. Nacmap says:

cloudcompare-git W: File (usr/ccViewer/) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/CloudCompare) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/shaders/) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/license.txt) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/history.txt) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/plugins/) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/plugins/libQPCL_PLUGIN.so) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/shaders/ColorRamp/) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/shaders/bilateral.vert) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/shaders/bilateral.frag) exists in a non-standard directory.
cloudcompare-git W: File (usr/CloudCompare/shaders/ColorRamp/color_ramp.frag) exists in a non-standard directory.
cloudcompare-git W: File (usr/ccViewer/ccViewer) exists in a non-standard directory.
cloudcompare-git W: File (usr/ccViewer/shaders/) exists in a non-standard directory.
cloudcompare-git W: File (usr/ccViewer/license.txt) exists in a non-standard directory.
cloudcompare-git W: File (usr/ccViewer/shaders/ColorRamp/) exists in a non-standard directory.
cloudcompare-git W: File (usr/ccViewer/shaders/ColorRamp/color_ramp.frag) exists in a non-standard directory.
cloudcompare-git W: Referenced library 'libCC_CORE_LIB.so' is an uninstalled dependency
cloudcompare-git W: Referenced library 'libQCC_DB_LIB.so' is an uninstalled dependency
cloudcompare-git E: ELF file ('usr/CloudCompare/CloudCompare') outside of a valid path.
cloudcompare-git E: ELF file ('usr/CloudCompare/plugins/libQPCL_PLUGIN.so') outside of a valid path.
cloudcompare-git E: ELF file ('usr/ccViewer/ccViewer') outside of a valid path.
cloudcompare-git W: Dependency pcl detected but optional (libraries ['usr/lib/libpcl_segmentation.so.1.7', 'usr/lib/libpcl_filters.so.1.7', 'usr/lib/libpcl_recognition.so.1.7', 'usr/lib/libpcl_search.so.1.7', 'usr/lib/libpcl_common.so.1.7', 'usr/lib/libpcl_io.so.1.7', 'usr/lib/libpcl_features.so.1.7'] needed in files ['usr/CloudCompare/plugins/libQPCL_PLUGIN.so'])

I guess I have to copy the files separately  to the right directories? Where can I find a nice description of this?
I only use the PCL plugin, but I included the options for other plugins in case somebody wants to use them. But I don't know what there dependencies are.

Thanks in advance!

Offline

#2 2014-06-02 15:16:44

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

Re: Advice/Review for PKGBUILD

You'll likely have a much easier time (and better luck) patching the make file to use /usr/share/ for those rather than /usr/

I was going to experiment with this, but I can't even get past cmake, I get the following error:

CMake Error at plugins/qPCL/PclUtils/CMakeLists.txt:13 (find_package):
  By not providing "FindPCL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "PCL", but
  CMake did not find one.

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

Offline

#3 2014-06-02 16:26:06

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: Advice/Review for PKGBUILD

I just built it (turned the pcl plugin off), it looks like the entire thing has it's own dir structure. IMO, you'd be better off using -DCMAKE_INSTALL_PREFIX=/opt, then putting symlinks or short scripts in /usr/bin. A lot of programs won't work unless their resources are in the same dir as the executable, that may be the case here. You'd still need to move the /opt/lib dir to /usr/lib, though.

Also, please don't put "CloudCompare is" in the pkgdesc. https://wiki.archlinux.org/index.php/PKGBUILD#pkgdesc

Last edited by Scimmia (2014-06-02 16:26:51)

Offline

#4 2014-06-05 08:24:30

johannesWinter
Member
Registered: 2014-04-08
Posts: 13

Re: Advice/Review for PKGBUILD

Hi,

thanks for the help. I almost got a working PKGBUILD.

# Maintainer: Johannes Sauer <joh.sauer(at)gmail(dot)com>

pkgname=cloudcompare-git
pkgver=2.5.0.r450.g7cb1649
pkgrel=1
pkgdesc="A 3D point cloud (and triangular mesh) processing software"
arch=('i686' 'x86_64')
url="http://www.danielgm.net/cc/"
license=('GPL2')
depends=('qt4' 'glu' 'mesa') 
makedepends=('git' 'cmake')
optdepends=('pcl')
source=("git+https://github.com/cloudcompare/trunk")
md5sums=('SKIP') 


pkgver() {
  cd "$srcdir/trunk"
  git describe --long | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cd "$srcdir/trunk"
  
  [[ -d build ]] && rm -r build
  mkdir -p build && cd build
  
  cmake .. \
     -DCMAKE_BUILD_TYPE=Release \
     -DCMAKE_INSTALL_PREFIX=/opt \
     -DBUILD_QPCL_PLUGIN_DOCUMENTATION=ON \
  	  -DINSTALL_QPCL_PLUGIN=ON \
	  -DINSTALL_QSRA_PLUGIN=OFF \
	  -DINSTALL_QPOISSON_RECON_PLUGIN=OFF \
	  -DINSTALL_QHPR_PLUGIN=OFF \
	  -DINSTALL_QRANSAC_SD_PLUGIN=OFF \
	  -DINSTALL_QKINECT_PLUGIN=OFF \
	  -DINSTALL_QBLUR_PLUGIN=OFF \
	  -DINSTALL_QEDL_PLUGIN=OFF \
	  -DINSTALL_QPCV_PLUGIN=OFF \
	  -DINSTALL_QDUMMY_PLUGIN=OFF \
	  -DINSTALL_QSSAO_PLUGIN=OFF 

	make
}

package() {
  cd "$srcdir/trunk/build"
  make DESTDIR="$pkgdir/" install

  mkdir -p "${pkgdir}/usr/lib"
  mv "${pkgdir}/opt/lib/"* "${pkgdir}/usr/lib"

  mkdir -p "${pkgdir}/usr/bin"
  ln -s "${pkgdir}/opt/ccViewer/ccViewer" "${pkgdir}/usr/bin/ccviewer"
  ln -s "${pkgdir}/opt/CloudCompare/CloudCompare" "${pkgdir}/usr/bin/CloudCompare"

}

This was worked for me, but when I checked:

ls /usr/bin/CloudCompare -l
lrwxrwxrwx 1 root root 80 Jun  5 10:10 /usr/bin/CloudCompare -> /tmp/makepkg/cloudcompare-git/pkg/cloudcompare-git/opt/CloudCompare/CloudCompare*

It's only working because I still have the temporary files there. What do I have to do to get a correct symlink outside of the fakeroot?

Offline

#5 2014-06-05 08:30:35

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: Advice/Review for PKGBUILD

johannesWinter wrote:

It's only working because I still have the temporary files there. What do I have to do to get a correct symlink outside of the fakeroot?

You need relative symlinks:

ln -s ../../$execpath_from_root/$execname $pkgdir/usr/bin/$execname

Last edited by progandy (2014-06-05 08:31:04)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2014-06-05 09:52:22

johannesWinter
Member
Registered: 2014-04-08
Posts: 13

Re: Advice/Review for PKGBUILD

Alright, now it's working fine. PKGBUILD:

# Maintainer: Johannes Sauer <joh.sauer(at)gmail(dot)com>

pkgname=cloudcompare-git
pkgver=2.5.0.r450.g7cb1649
pkgrel=1
pkgdesc="A 3D point cloud (and triangular mesh) processing software"
arch=('i686' 'x86_64')
url="http://www.danielgm.net/cc/"
license=('GPL2')
depends=('qt4' 'glu' 'mesa')
makedepends=('git' 'cmake')
optdepends=('pcl')
source=("git+https://github.com/cloudcompare/trunk")
md5sums=('SKIP') 


pkgver() {
  cd "$srcdir/trunk"
  git describe --long | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cd "$srcdir/trunk"
  
  [[ -d build ]] && rm -r build
  mkdir -p build && cd build
  
  cmake .. \
     -DCMAKE_BUILD_TYPE=Release \
     -DCMAKE_INSTALL_PREFIX=/opt \
     -DBUILD_QPCL_PLUGIN_DOCUMENTATION=ON \
  	  -DINSTALL_QPCL_PLUGIN=ON \
	  -DINSTALL_QSRA_PLUGIN=OFF \
	  -DINSTALL_QPOISSON_RECON_PLUGIN=OFF \
	  -DINSTALL_QHPR_PLUGIN=OFF \
	  -DINSTALL_QRANSAC_SD_PLUGIN=OFF \
	  -DINSTALL_QKINECT_PLUGIN=OFF \
	  -DINSTALL_QBLUR_PLUGIN=OFF \
	  -DINSTALL_QEDL_PLUGIN=OFF \
	  -DINSTALL_QPCV_PLUGIN=OFF \
	  -DINSTALL_QDUMMY_PLUGIN=OFF \
	  -DINSTALL_QSSAO_PLUGIN=OFF 

	make
}

package() {
  cd "$srcdir/trunk/build"
  make DESTDIR="$pkgdir/" install

  mkdir -p "${pkgdir}/usr/lib"
  mv "${pkgdir}/opt/lib/"* "${pkgdir}/usr/lib"
  rm -r "${pkgdir}/opt/lib/" 

  mkdir -p "${pkgdir}/usr/bin"
  cd "$pkgdir/usr/bin"
  ln -s "../../opt/ccViewer/ccViewer"
  ln -s "../../opt/CloudCompare/CloudCompare"

}

namcap:

namcap cloudcompare-git-2.5.0.r450.g7cb1649-1-x86_64.pkg.tar.xz
cloudcompare-git E: ELF file ('opt/CloudCompare/CloudCompare') outside of a valid path.
cloudcompare-git E: ELF file ('opt/CloudCompare/plugins/libQPCL_PLUGIN.so') outside of a valid path.
cloudcompare-git E: ELF file ('opt/ccViewer/ccViewer') outside of a valid path.
cloudcompare-git W: Dependency pcl detected but optional (libraries ['usr/lib/libpcl_recognition.so.1.7', 'usr/lib/libpcl_io.so.1.7', 'usr/lib/libpcl_search.so.1.7', 'usr/lib/libpcl_common.so.1.7', 'usr/lib/libpcl_features.so.1.7', 'usr/lib/libpcl_filters.so.1.7', 'usr/lib/libpcl_segmentation.so.1.7'] needed in files ['opt/CloudCompare/plugins/libQPCL_PLUGIN.so'])

Now I can submit it?

Offline

#7 2014-06-05 12:32:41

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Advice/Review for PKGBUILD

-DINSTALL_QPCL_PLUGIN=ON \

I think pcl should both be makedepend AND an optdepend .
You can verify if pcl is needed at buildtime by removing it temporarily (might have to use -Rd or -Rdd , check pacman manpage)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2014-06-06 07:11:38

johannesWinter
Member
Registered: 2014-04-08
Posts: 13

Re: Advice/Review for PKGBUILD

That's right, pcl is needed for building too. I was unsure wether to put it in makedepend, since one can specify with

-DINSTALL_QPCL_PLUGIN=ON \

if it's needed or not.

Offline

#9 2014-10-23 17:55:20

apinhal
Member
Registered: 2014-10-23
Posts: 2

Re: Advice/Review for PKGBUILD

Hello

Is this PKGBUILD going to be available in AUR?


Thanks

Offline

#10 2014-10-24 11:22:17

johannesWinter
Member
Registered: 2014-04-08
Posts: 13

Re: Advice/Review for PKGBUILD

Hi,

I wasn't sure whether I should try putting it in AUR. I found it strange that I have to do those symlinks to make it work.

Best

Offline

#11 2014-10-24 16:39:40

Steef435
Member
Registered: 2013-08-29
Posts: 577
Website

Re: Advice/Review for PKGBUILD

$ find /var/abs/ | xargs grep "ln -s" -sl | wc -l
539

Symlinks are used in abs packages too, I don't think you should be worried by using a few of them.

Last edited by Steef435 (2014-10-24 16:40:32)

Offline

#12 2014-10-24 16:50:51

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: Advice/Review for PKGBUILD

The symlinks in /usr/bin are normal. That's the preferred way of handling software installed to /opt.

Offline

#13 2014-10-26 15:53:18

johannesWinter
Member
Registered: 2014-04-08
Posts: 13

Re: Advice/Review for PKGBUILD

Ok. I just rebuild the package and verified that the new version is working on my system. I put it in AUR then.

Last edited by johannesWinter (2014-10-26 15:53:34)

Offline

Board footer

Powered by FluxBB