You are not logged in.

#26 2020-08-17 17:41:10

theodore
Member
Registered: 2008-09-09
Posts: 138

Re: PKGBUILD for the radiance renderer package

just for completion this is my final PKGBUILD

# Maintainer: Your Name <youremail@domain.com>
pkgname=radiance-renderer
_pkgname=radiance-HEAD
pkgver=HEAD
pkgrel=1
pkgdesc="A Validated Lighting Simulation Tool"
arch=('x86_64')
url="https://radiance-online.org/"
license=('OSS')
depends=('qt5-base' 'qt5-imageformats' 'glu')
makedepends=('cmake')
optdepends=('libtiff: For libtiff support')
provides=('ies2rad' 'obj2mesh' 'rpict' 'rvu' 'ranimate' 'rad' 'trad' 'ximage' 'falsecolor' 'pcond')
source=("https://radiance-online.org/software/snapshots/${_pkgname}.tgz"
#         "https://github.com/LBNL-ETA/Radiance/archive/${pkgver}.tar.gz"
        "https://radiance-online.org/download-install/radiance-source-code/latest-release/radR52supp.tar.gz"
        "$pkgname.sh"
        "$pkgname.conf")
md5sums=('61d66eb5f549d2ddac518428477cdf06'
#          '08ab2b1db4ae9416dca2fcf066f0990b'
         '78fd9d55c663436d6d63f53c3acb3a3c'
         '678e873c2d2de09790a1d8f5aa79ff6f'
         'd3839618170f7495ede6a895a83b58ca')

DLAGENTS=('https::/usr/bin/curl -k -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u') # Temp fix to ignore expired certificate

prepare() {

   # comment fixbundle line in InstallRules/dependencies.cmake.in since it fails compilation
   sed -i '14 s/^/# /' ray/InstallRules/dependencies.cmake.in 

}

build() {


    cmake -B build -S ray -DCMAKE_INSTALL_PREFIX=/opt/$pkgname
        
    make -C build
}

package() {

    make -C build DESTDIR="$pkgdir" install
    
    # copy the auxiliary lib files
    msg2 'Installing lib files'
    cp -R "$srcdir/ray/lib" "$pkgdir/opt/$pkgname"
    
    # install profile and ld.so.config files
	install -Dm755 "$srcdir/$pkgname.sh" "$pkgdir/etc/profile.d/$pkgname.sh"
	install -Dm644 "$srcdir/$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"

    # install license file
    msg2 'Installing license agreement file'
    install -Dm644 ray/License.txt \
        "$pkgdir/usr/share/licenses/$pkgname/Licence.txt"
        
    # move man files in the correct path
    mv "$pkgdir/opt/$pkgname/man" "$pkgdir/usr/share"
}

and the supportive config files:

radiance-renderer.sh

export RAYPATH=/opt/radiance-renderer/lib
export PATH=$PATH:/opt/radiance-renderer/bin

radiance-renderer.conf

/opt/radiance-renderer/lib

Offline

#27 2020-08-17 18:02:45

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,622

Re: PKGBUILD for the radiance renderer package

Do you need to add stuff to the ld.so.conf search path and to $PATH? Do the binaries not work if they locate the libraries relative to the current directory e.g. with rpath? Do you need every single binary available on the $PATH, or just some of them that are expected to be available on the CLI?

pkgver=HEAD isn't very good, how do people know when there's updates? If you don't rename the files with the real version (see man PKGBUILD for "change the name of the downloaded file"), how do people successfully download updates if there is an old, cached version downloaded already?


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

Offline

#28 2020-08-17 21:34:06

loqs
Member
Registered: 2014-03-06
Posts: 11,633

Re: PKGBUILD for the radiance renderer package

eschwartz you mean something such as:
RPATH

    LDFLAGS="$LDFLAGS -Wl,-rpath,"'$ORIGIN/../lib'

RUNPATH

    LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags,-rpath,"'$ORIGIN/../lib'

Offline

#29 2020-08-18 00:45:40

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,622

Re: PKGBUILD for the radiance renderer package

Indeed. I think cmake might add rpath for you automatically, if the install paths aren't broken by the upstream project settings. If not, well, I would hope upstream would add their own rpaths to make their default installation case work out of the box.

Sure, it could be manually added in by specifying the right $LDFLAGS too.


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

Offline

#30 2020-08-18 07:58:29

theodore
Member
Registered: 2008-09-09
Posts: 138

Re: PKGBUILD for the radiance renderer package

eschwartz wrote:

Do you need to add stuff to the ld.so.conf search path and to $PATH? Do the binaries not work if they locate the libraries relative to the current directory e.g. with rpath? Do you need every single binary available on the $PATH, or just some of them that are expected to be available on the CLI?

pkgver=HEAD isn't very good, how do people know when there's updates? If you don't rename the files with the real version (see man PKGBUILD for "change the name of the downloaded file"), how do people successfully download updates if there is an old, cached version downloaded already?

Adding the path to ld.so.conf might be overkill at the moment since it doesn't seem to be any library file in there that is used but rather other kind of files but since I've seen it upstream to some other aur packages I thought it might be a good practice (in case also in the future that there are some actual libs in there). The $PATH entries are necessary, since I need to have access to all the binaries and the guys from the package they informed me that the RAYPATH environment variable needs to specified.

Regarding the pkgver=HEAD you are right that it is a bad practice, I am trying to check now how to use the pkgver() to updated it automatically, I've seen some aur packages that they do that as well.

Offline

#31 2020-08-18 09:38:56

theodore
Member
Registered: 2008-09-09
Posts: 138

Re: PKGBUILD for the radiance renderer package

This a slightly updated version, which fetches the release tag from the remote repository using git. It should be fine now.

# Maintainer: Your Name <youremail@domain.com>
pkgname=radiance-renderer
_pkgname=radiance-HEAD
pkgver=HEAD
pkgrel=1
pkgdesc="A Validated Lighting Simulation Tool"
arch=('x86_64')
url="https://radiance-online.org/"
license=('OSS')
depends=('qt5-base' 'qt5-imageformats' 'glu')
makedepends=('cmake' 'git')
optdepends=('libtiff: For libtiff support')
provides=('ies2rad' 'obj2mesh' 'rpict' 'rvu' 'ranimate' 'rad' 'trad' 'ximage' 'falsecolor' 'pcond')
source=("https://radiance-online.org/software/snapshots/${_pkgname}.tgz"
#         "https://github.com/LBNL-ETA/Radiance/archive/${pkgver}.tar.gz"
        "https://radiance-online.org/download-install/radiance-source-code/latest-release/radR52supp.tar.gz"
#         "$pkgname.conf"
        "$pkgname.sh")
md5sums=('61d66eb5f549d2ddac518428477cdf06'
#          '08ab2b1db4ae9416dca2fcf066f0990b'
         '78fd9d55c663436d6d63f53c3acb3a3c'
#          'd3839618170f7495ede6a895a83b58ca'
         '678e873c2d2de09790a1d8f5aa79ff6f')

DLAGENTS=('https::/usr/bin/curl -k -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u') # Temp fix to ignore expired certificate

pkgver() {
   # get latest release tag from remote
   git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/LBNL-ETA/Radiance '*.*.*' | tail --lines=1 | cut --delimiter='/' --fields=3
   
}

prepare() {

   # comment fixbundle line in InstallRules/dependencies.cmake.in since it fails compilation
   sed -i '14 s/^/# /' ray/InstallRules/dependencies.cmake.in 

}

build() {


    cmake -B build -S ray -DCMAKE_INSTALL_PREFIX=/opt/$pkgname
        
    make -C build
}

package() {

    make -C build DESTDIR="$pkgdir" install
    
    # copy the auxiliary lib files
    msg2 'Installing lib files'
    cp -R "$srcdir/ray/lib" "$pkgdir/opt/$pkgname"
    
    # install profile and ld.so.config files
    install -Dm755 "$srcdir/$pkgname.sh" "$pkgdir/etc/profile.d/$pkgname.sh"
#    install -Dm644 "$srcdir/$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"

    # install license file
    msg2 'Installing license agreement file'
    install -Dm644 ray/License.txt \
        "$pkgdir/usr/share/licenses/$pkgname/Licence.txt"
        
    # move man files in the correct path
    mv "$pkgdir/opt/$pkgname/man" "$pkgdir/usr/share"
} 

Offline

#32 2020-08-18 15:58:19

loqs
Member
Registered: 2014-03-06
Posts: 11,633

Re: PKGBUILD for the radiance renderer package

ls /opt/radiance-renderer/lib
ambpos.cal     clamp.cal        errfile.fmt       glaze1.cal         LaFortune1.cal    norm.cal        rayinit.cal    sf.cal              symbols.met     triz.dat           WalterBTDF.cal
Ashikhmin.cal  clockface.hex    ferwerda.cal      glaze2.cal         LaFortune.cal     normcomp.cal    reinhard.cal   skybright.cal       symbols.mta     tumblin.cal        WGMDaniso.cal
bezier2.cal    clouds.cal       filt.cal          graypatch.cal      lamp.tab          patch3w.cal     reinhard.csh   source.cal          testimg.cal     uniq_rgb.cal       WGMDiso.cal
blackbody.cal  cmat.fmt         fisheye_corr.cal  helvet.fnt         landscape.cal     peerless.cal    reinhartb.cal  spharm.cal          testsuncal.csh  vchars.met         WINDOW6BSDFt.xml
blinds.cal     colorcal.csh     fitSH.cal         hermite.cal        line.plt          perezlum.cal    reinhart.cal   sphsamp.cal         tilt.cal        vchars.mta         window.cal
boxw.plt       color.fmt        fog.cal           hsv_rgb.cal        lumdist.cal       perezlum_c.cal  reinsrc.cal    spline.cal          tmesh.cal       veil.cal           xyz_rgb.cal
bsdf2rad.cal   conv1.cal        fovsample.cal     illum.cal          macbeth.cal       picdiff.cal     rev.cal        standard.plt        trans2.cal      view360stereo.cal  xyz_srgb.cal
cartesian.plt  conv2.cal        function.plt      illumcal.csh       mat3.cal          polar.plt       rgb.cal        stdrefl.cal         trans.cal       view.fmt
cct.cal        cri.cal          gauss.cal         illum.fmt          metals.cal        polynomial.cal  rgb_ycc.cal    sun2.cal            tregenza.cal    vl.cal
cielab.cal     cubic.cal        gaussian.cal      klems_ang.cal      minimalBSDFt.xml  printwarp.cal   root.cal       sun.cal             tregsamp.dat    vonKries.cal
cieluv.cal     curve.plt        genSH.cal         klems_full.cal     noise2.cal        quadratic.cal   rskysrc.cal    suncal.fmt          tregsrc.cal     vwparab.cal
cieresp.cal    denom.cal        gensky+s.fmt      klems_half.cal     noise3.cal        rambpos.cal     scatter.plt    superellipsoid.cal  trix.dat        vwplanis.cal
circle.cal     disk2square.cal  gensky-s.fmt      klems_quarter.cal  noise.cal         ray             screen.cal     surf.cal            triy.dat        WalterBSDF.cal

There are no dynamic libraries in /opt/radiance-renderer/lib that the binaries could link to.

cd /opt/radiance-renderer/bin
find plugins
plugins/
plugins/imageformats
plugins/imageformats/libqtiff.so
plugins/imageformats/libqico.so
plugins/imageformats/libqgif.so
plugins/imageformats/libqjpeg.so
plugins/platforms
plugins/platforms/libqxcb.so

These are just copied from the arch packages.

    rm -rf "${pkgdir}"/opt/$pkgname/bin/{qt.conf,plugins}

Last edited by loqs (2020-08-18 16:17:53)

Offline

#33 2020-08-19 09:02:36

theodore
Member
Registered: 2008-09-09
Posts: 138

Re: PKGBUILD for the radiance renderer package

loqs wrote:
ls /opt/radiance-renderer/lib
ambpos.cal     clamp.cal        errfile.fmt       glaze1.cal         LaFortune1.cal    norm.cal        rayinit.cal    sf.cal              symbols.met     triz.dat           WalterBTDF.cal
Ashikhmin.cal  clockface.hex    ferwerda.cal      glaze2.cal         LaFortune.cal     normcomp.cal    reinhard.cal   skybright.cal       symbols.mta     tumblin.cal        WGMDaniso.cal
bezier2.cal    clouds.cal       filt.cal          graypatch.cal      lamp.tab          patch3w.cal     reinhard.csh   source.cal          testimg.cal     uniq_rgb.cal       WGMDiso.cal
blackbody.cal  cmat.fmt         fisheye_corr.cal  helvet.fnt         landscape.cal     peerless.cal    reinhartb.cal  spharm.cal          testsuncal.csh  vchars.met         WINDOW6BSDFt.xml
blinds.cal     colorcal.csh     fitSH.cal         hermite.cal        line.plt          perezlum.cal    reinhart.cal   sphsamp.cal         tilt.cal        vchars.mta         window.cal
boxw.plt       color.fmt        fog.cal           hsv_rgb.cal        lumdist.cal       perezlum_c.cal  reinsrc.cal    spline.cal          tmesh.cal       veil.cal           xyz_rgb.cal
bsdf2rad.cal   conv1.cal        fovsample.cal     illum.cal          macbeth.cal       picdiff.cal     rev.cal        standard.plt        trans2.cal      view360stereo.cal  xyz_srgb.cal
cartesian.plt  conv2.cal        function.plt      illumcal.csh       mat3.cal          polar.plt       rgb.cal        stdrefl.cal         trans.cal       view.fmt
cct.cal        cri.cal          gauss.cal         illum.fmt          metals.cal        polynomial.cal  rgb_ycc.cal    sun2.cal            tregenza.cal    vl.cal
cielab.cal     cubic.cal        gaussian.cal      klems_ang.cal      minimalBSDFt.xml  printwarp.cal   root.cal       sun.cal             tregsamp.dat    vonKries.cal
cieluv.cal     curve.plt        genSH.cal         klems_full.cal     noise2.cal        quadratic.cal   rskysrc.cal    suncal.fmt          tregsrc.cal     vwparab.cal
cieresp.cal    denom.cal        gensky+s.fmt      klems_half.cal     noise3.cal        rambpos.cal     scatter.plt    superellipsoid.cal  trix.dat        vwplanis.cal
circle.cal     disk2square.cal  gensky-s.fmt      klems_quarter.cal  noise.cal         ray             screen.cal     surf.cal            triy.dat        WalterBSDF.cal

There are no dynamic libraries in /opt/radiance-renderer/lib that the binaries could link to.

cd /opt/radiance-renderer/bin
find plugins
plugins/
plugins/imageformats
plugins/imageformats/libqtiff.so
plugins/imageformats/libqico.so
plugins/imageformats/libqgif.so
plugins/imageformats/libqjpeg.so
plugins/platforms
plugins/platforms/libqxcb.so

These are just copied from the arch packages.

    rm -rf "${pkgdir}"/opt/$pkgname/bin/{qt.conf,plugins}

Yup, you are right on both.

Moreover, there is another issue which needs manual intervention. In order the trad script to work apparently the following needs be done https://discourse.radiance-online.org/t … 2?u=ttsesm (mainly step 2, step 1 is addressed from the installed tk package which adds an optional dependency though).

Offline

Board footer

Powered by FluxBB