Page 1 sur 1

[PKGBUILD] blender 2.6 beta (résolu)

Publié : dim. 23 janv. 2011, 21:42
par anorexia
Bonjour à tous,

Je commence à m’intéresser à archlinux, et j’essaie de faire un PKGBUILD pour blender 2.6.
Voici ce que j'ai "fait"

Code : Tout sélectionner

# $Id: PKGBUILD 101917 2010-12-02 16:14:10Z ibiru $
# Contributor: John Sowiak <john@archlinux.org>
# Maintainer: tobias <tobias@archlinux.org>

# TODO:
# - consider switching to scons when it is better supported

# Apparently, the blender guys refuse to release source tarballs for
# intermediate releases that deal mainly with binaries but incorporate tiny
# minor changes from cvs. Since I'm sick and tired of the urges of users that
# look for release numbers only we make a messy PKGBUILD that can checkout cvs
# tags if necessary.
#cvs=true
cvs=false

pkgname=blender
pkgver=2.56
pkgrel=1
pkgdesc="A fully integrated 3D graphics creation suite"
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.blender.org"
depends=('libjpeg' 'libpng' 'openexr' 'sdl' 'python2' 'desktop-file-utils' \
         'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal')
makedepends=('freeglut' 'libtiff' 'librsvg' 'yasm' 'csv')
options=('!makeflags')
install=blender.install
source=($pkgname.desktop $pkgname.svg)
if [ ! $cvs -o $cvs = false ]; then
  makedepends=('freeglut' 'libtiff' 'librsvg' 'yasm')
  source=(${source[@]} http://download.blender.org/source/$pkgname-$pkgver-beta.tar.gz)
  md5sums=('b5b9720b9430b1f5e2aa0b2df533fed8'
         '0e53299444ff5570639c8f59372bc98c'
         '6d853bbd7bf17f3390addbc2c7455cd3')
 fi

build() {
  if [ $cvs = true ]; then
    cd "$srcdir/"
    #cvs -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender login
    cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender checkout $pkgname
    _cvsrel=$pkgname-$(echo $pkgver | sed 's/\./-/')-release
    cvs -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender update -r $_cvsrel
    find $pkgname/{bin,release/scripts} -name 'CVS' -exec rm -rf {} \; 2> /dev/null
    cd $pkgname
  else
    mv /home/neo2500/abs/blender/src/blender-2.56-beta-source/intern/audaspace/Python/AUD_PyAPI.cpp $srcdir/AUD_PyAPI.cpp.old
    mv /home/neo2500/abs/blender/src/blender-2.56-beta-source/intern/audaspace/Python/AUD_PyAPI.h $srcdir/AUD_PyAPI.h.old
    
    patch -p0 < $srcdir/patch1.diff
    patch -p0 < $srcdir/patch2.diff
    mv $srcdir/AUD_PyAPI.cpp.old /home/neo2500/abs/blender/src/blender-2.56-beta-source/intern/audaspace/Python/AUD_PyAPI.cpp
    mv $srcdir/AUD_PyAPI.h.old /home/neo2500/abs/blender/src/blender-2.56-beta-source/intern/audaspace/Python/AUD_PyAPI.h
    cd "$srcdir/$pkgname-$pkgver-beta-source"
  fi

 rm -f user-def.mk

 ##########################################################################
 # tweak the makefiles to prepare build for ArchLinux
   # disable static binaries and enable blenderplayer binary
  sed -i "s|^.*\(BINTARGETS += blenderstatic\)|    #\1|g" source/Makefile
  sed -i "s|^#\(.*BINTARGETS += blenderplayer\)|\1|g" source/Makefile
  # link freetype and openal dynamically
  sed -i 's|LOPTS)|LOPTS) -lfreetype -lopenal|g' source/Makefile
  sed -i 's|COMLIB.*libfreetype\.a|#\0|g' source/Makefile
  sed -i 's|NAN_SND_LIBS.*libopenal\.a|#\0|g' source/Makefile
   # make ode (alternative physics engine)
   # does not work for Arch64
   #[ "$CARCH" = "i686" ] && sed -i 's|^\(DIRS.*\)$|\1 ode|' extern/Makefile
   # make the nan_makefiles happy
  export NAN_PYTHON_VERSION=2.7
  export INTERNATIONAL=true
  export WITH_FREETYPE2=true
  export NAN_FREETYPE=/usr
  export WITH_ICONV=true

  export NAN_NO_PLUGIN=true

  export NAN_OPENAL=/usr
  export NAN_FMOD=/usr
  export NAN_JPEG=/usr
  export NAN_PNG=/usr
  export WITH_OPENEXR=true
  export NAN_OPENEXR=/usr
  export NAN_ODE=/usr
  export NAN_OPENEXR_LIBS=$(pkg-config --libs-only-l OpenEXR)

  export NAN_SDL=/usr
  export NAN_ZLIB=/usr
  export NAN_MESA=/usr

  export NAN_USE_BULLET=true
  export NAN_USE_FFMPEG_CONFIG=true
  export WITH_BF_VERSE=true
  export WITH_VERSE=true
  export WITH_BF_OPENMP=true
  # there is an issue with a file
  export NAN_DEBUG=-O
 ###########################################################################
 # build
  LDFLAGS="-Wl,--hash-style=gnu"
 scons BF_INSTALLDIR=$pkgdir

 ###########################################################################
}

package() {






  cd /home/neo2500/abs/blender/src/install/linux2


# common part

 #mkdir -p "$pkgdir/usr/share/$pkgname/"

 # install binaries
 #install -Dm755 blender "$pkgdir/usr/bin/blender"
 # install -Dm755 blenderplayer "$pkgdir/usr/bin/blenderplayer"

 # install internationalization support
 #cd ../../../bin/.blender
 #install -D -m644 .Blanguages \
 #  "$pkgdir/usr/share/$pkgname/.Blanguages"
 #install -D -m644 .bfont.ttf \
 #  "$pkgdir/usr/share/$pkgname/.bfont.ttf"

 #cp -R locale "$pkgdir/usr/share/"

 # install scripts
 #cd /home/neo2500/abs/blender/src/install/linux2

 #cp -R 2.56/scripts "$pkgdir/usr/share/$pkgname/scripts"
 #cp -R 2.56/plugins "$pkgdir/usr/share/$pkgname/plungins"
 #cp -R 2.56/python "$pkgdir/usr/share/$pkgname/python"


#sed -i 's|#!/usr/bin/python|#!/usr/bin/python2|' "$pkgdir/usr/share/blender/scripts/bpymodules/blend2renderinfo.py"

 # install all additional stuff
 # install a freedesktop.org compliant menu entry
 install -Dm644 "$srcdir/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
 # install some freedesktop.org compatibility
 install -D -m644 "$srcdir/$pkgname.svg" "$pkgdir/usr/share/pixmaps/$pkgname.svg"
 # finally we render a png as fallback for not svg aware menu applications
 # Attention: always make sure you check the dimensions of the source-svg,
 # you can read the dimensions via inkscape's export function
 rsvg -w 64 -h 64 -f png "$pkgdir/usr/share/pixmaps/$pkgname.svg" "$pkgdir/usr/share/pixmaps/$pkgname.png"
}
En fait j'ai fait un copier/coller d'un pkgbuild, puis j'ai modifié à ma sauce. La compilation fonctionne bien , mais je n'arrive pas à empaqueter le logiciel correctement... La il s'installe à la racine...
Donc comment faire pour empaqueter correctement ce logiciel ?

Re: [PKGBUILD] blender 2.6 beta (non résolu)

Publié : dim. 23 janv. 2011, 21:53
par FoolEcho
Sur Aur, il y a blender-svn qui fait ça déjà, non ? (voire même la version blender2.4-svn )

(... mais que ça ne t'empêche pas de t'exercer au PKGBUILD :D )

Re: [PKGBUILD] blender 2.6 beta (non résolu)

Publié : dim. 23 janv. 2011, 22:01
par anorexia
En fait oui c'est plus pour m'exercer^^ (j'ai déjà réussi à faire un paquet pour vala).

Déjà j'ai du patcher certains fichiers car il y avais des erreurs dans les sources...(au moins j'ai apprit à me servir de diff :lol: )

Mais c'est vraiment la dernière phase, celle de l'empaquetage qui me pose problème à chaque fois...

EDIT: En plus sur aur ils n’utilisent pas scons pour compiler, mais make ou cmake... donc je peut même pas prendre exemple.

Re: [PKGBUILD] blender 2.6 beta (non résolu)

Publié : lun. 24 janv. 2011, 14:18
par FoolEcho
anorexia a écrit :En fait oui c'est plus pour m'exercer^^ (j'ai déjà réussi à faire un paquet pour vala).
Et tu fais bien... à tout point de vue :mrgreen: ... j'ai juste parcouru le PKGBUILD: alors déjà faut éviter les chemins en dur, tu t'en doutes bien mais autant le faire tout de suite sinon ça traîne (les patchs s'incorporent dans les sources)... ensuite, supprimer ce qu'il y a à supprimer (j'vois pas l'intérêt de garder la partie cvs puisque tu ne l'utilises pas... au passage, "$cvs" devrait être appelé "$_cvs", mais ça vient peut-être de l'auteur original ).
A mon sens, il est préférable de partir d'un PKGBUILD vierge... tout en s'appuyant sur l'original. ;-)
Après, je ne connais pas scons (qu'il te faut rajouter dans les dépendances ! )... et je vais éviter la blague pourrie.

Pour l'empaquetage, tu récupères les répertoires/fichiers qui t'intéressent que tu places dans $pkgdir... en respectant la disposition du système de fichiers: https://wiki.archlinux.org/index.php/Ar ... _Standards . Mais si tu veux plus d'aide, il faut déjà que la partie build soit propre ou que tu sois plus précis sur ce qui ne va pas (j'ai pas compris quand tu dis que tout s'installe à la racine. :? ).

Re: [PKGBUILD] blender 2.6 beta (non résolu)

Publié : lun. 24 janv. 2011, 20:34
par anorexia
Pour être plus claire, je fait mon paquage avec makepkg -s;
Quand j'installe mon pkg, il s'installe à la racine (par ex le binaire de blender est dans /);

Si non oui je sais qu'il faut éviter les chemins en dur...Mais j'avoue que j'avais un peu la flemme.... :lol:

EDIT : Pour être plus précis je me demande ou installer les fichiers contenus dans le répertoire 2.56? J'ai essayé dans /usr/share/blender mais l'interface de blender ne s'affiche pas complétement
Image

Uploaded with ImageShack.us

EDIT2: Bon je pense avoir trouver, il faut pas installer le logiciel dans /usr/bin. J'ai tout installé dans /opt/blender, (en fait je fait un copier/coller du répertoire)

Code : Tout sélectionner

# $Id: PKGBUILD 101917 2010-12-02 16:14:10Z ibiru $
# Contributor: John Sowiak <john@archlinux.org>
# Maintainer: tobias <tobias@archlinux.org>

# TODO:
# - consider switching to scons when it is better supported

cvs=false

pkgname=blender
pkgver=2.56
pkgrel=1
pkgdesc="A fully integrated 3D graphics creation suite"
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.blender.org"
depends=('libjpeg' 'libpng' 'openexr' 'sdl' 'python2' 'desktop-file-utils' \
         'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal')
makedepends=('freeglut' 'libtiff' 'librsvg' 'yasm' 'csv' 'scons')
options=('!makeflags')
install=blender.install
source=($pkgname.desktop $pkgname.svg)
if [ ! $cvs -o $cvs = false ]; then
  makedepends=('freeglut' 'libtiff' 'librsvg' 'yasm')
  source=(${source[@]} http://download.blender.org/source/$pkgname-$pkgver-beta.tar.gz)
  md5sums=('b5b9720b9430b1f5e2aa0b2df533fed8'
         '0e53299444ff5570639c8f59372bc98c'
         '6d853bbd7bf17f3390addbc2c7455cd3')
 fi

build() {
    mv /home/neo2500/abs/blender/src/blender-2.56-beta-source/intern/audaspace/Python/AUD_PyAPI.cpp $srcdir/AUD_PyAPI.cpp.old
    mv /home/neo2500/abs/blender/src/blender-2.56-beta-source/intern/audaspace/Python/AUD_PyAPI.h $srcdir/AUD_PyAPI.h.old
    
    patch -p0 < $srcdir/patch1.diff
    patch -p0 < $srcdir/patch2.diff
    mv $srcdir/AUD_PyAPI.cpp.old /home/neo2500/abs/blender/src/blender-2.56-beta-source/intern/audaspace/Python/AUD_PyAPI.cpp
    mv $srcdir/AUD_PyAPI.h.old /home/neo2500/abs/blender/src/blender-2.56-beta-source/intern/audaspace/Python/AUD_PyAPI.h
    cd "$srcdir/$pkgname-$pkgver-beta-source"

 rm -f user-def.mk

 ##########################################################################
 # tweak the makefiles to prepare build for ArchLinux
   # disable static binaries and enable blenderplayer binary
  sed -i "s|^.*\(BINTARGETS += blenderstatic\)|    #\1|g" source/Makefile
  sed -i "s|^#\(.*BINTARGETS += blenderplayer\)|\1|g" source/Makefile
  # link freetype and openal dynamically
  sed -i 's|LOPTS)|LOPTS) -lfreetype -lopenal|g' source/Makefile
  sed -i 's|COMLIB.*libfreetype\.a|#\0|g' source/Makefile
  sed -i 's|NAN_SND_LIBS.*libopenal\.a|#\0|g' source/Makefile
   # make ode (alternative physics engine)
   # does not work for Arch64
   #[ "$CARCH" = "i686" ] && sed -i 's|^\(DIRS.*\)$|\1 ode|' extern/Makefile
   # make the nan_makefiles happy
  export NAN_PYTHON_VERSION=2.7
  export INTERNATIONAL=true
  export WITH_FREETYPE2=true
  export NAN_FREETYPE=/usr
  export WITH_ICONV=true

  export NAN_NO_PLUGIN=true

  export NAN_OPENAL=/usr
  export NAN_FMOD=/usr
  export NAN_JPEG=/usr
  export NAN_PNG=/usr
  export WITH_OPENEXR=true
  export NAN_OPENEXR=/usr
  export NAN_ODE=/usr
  export NAN_OPENEXR_LIBS=$(pkg-config --libs-only-l OpenEXR)

  export NAN_SDL=/usr
  export NAN_ZLIB=/usr
  export NAN_MESA=/usr

  export NAN_USE_BULLET=true
  export NAN_USE_FFMPEG_CONFIG=true
  export WITH_BF_VERSE=true
  export WITH_VERSE=true
  export WITH_BF_OPENMP=true
  # there is an issue with a file
  export NAN_DEBUG=-O
 ###########################################################################
 # build
  LDFLAGS="-Wl,--hash-style=gnu"
 scons 

 ###########################################################################
}

package() {






  cd /home/neo2500/abs/blender/src/install/linux2


# common part

 mkdir -p "$pkgdir/opt/$pkgname/"

 # install binaries
 #install -Dm755 blender "$pkgdir/opt/blender"
 # install -Dm755 blenderplayer "$pkgdir/usr/bin/blenderplayer"

 cp -R * "$pkgdir/opt/blender/"
 chmod 755 "$pkgdir/opt/blender/blender"
 # install internationalization support
 #cd ../../../bin/.blender
 #install -D -m644 .Blanguages \
 #  "$pkgdir/usr/share/$pkgname/.Blanguages"
 #install -D -m644 .bfont.ttf \
 #  "$pkgdir/usr/share/$pkgname/.bfont.ttf"

 #cp -R locale "$pkgdir/usr/share/"

 # install scripts
 #cd /home/neo2500/abs/blender/src/install/linux2

 #cp -R 2.56/scripts "$pkgdir/usr/share/$pkgname/scripts"
 #cp -R 2.56/plugins "$pkgdir/usr/share/$pkgname/plungins"
 #cp -R 2.56/python "$pkgdir/usr/share/$pkgname/python"


#sed -i 's|#!/usr/bin/python|#!/usr/bin/python2|' "$pkgdir/usr/share/blender/scripts/bpymodules/blend2renderinfo.py"

 # install all additional stuff
 # install a freedesktop.org compliant menu entry
 install -Dm644 "$srcdir/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
 # install some freedesktop.org compatibility
 install -D -m644 "$srcdir/$pkgname.svg" "$pkgdir/usr/share/pixmaps/$pkgname.svg"
 # finally we render a png as fallback for not svg aware menu applications
 # Attention: always make sure you check the dimensions of the source-svg,
 # you can read the dimensions via inkscape's export function
 rsvg -w 64 -h 64 -f png "$pkgdir/usr/share/pixmaps/$pkgname.svg" "$pkgdir/usr/share/pixmaps/$pkgname.png"
}

Re: [PKGBUILD] blender 2.6 beta (non résolu)

Publié : mar. 25 janv. 2011, 10:16
par FoolEcho
Quand c'est possible, c'est plus propre de répartir les différents répertoires (binaires dans /usr/bin, bibliothèques dans /usr/lib/ , etc.).

/opt n'étant pas une mauvaise option (la plus simple, forcément). :-)