DeLi(cate) Forum
PKGBUILD files - Printable Version

+- DeLi(cate) Forum (http://delicate-linux.net/forum)
+-- Forum: DeLi(cate) Linux [english only] (/forumdisplay.php?fid=3)
+--- Forum: Development (/forumdisplay.php?fid=6)
+--- Thread: PKGBUILD files (/showthread.php?tid=74)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33


RE: PKGBUILD files - nl2stk - 12-31-2011 01:31 PM

A clipboard manager, no 'beautycontest-winner', but it works.

Code:
# Maintainer: theo - nl2stk
# Thanks to: Jan de Groot

pkgname=xorg-xclipboard
pkgver=1.1.1
pkgrel=1
pkgdesc="X clipboard manager"
url="http://xorg.freedesktop.org/"
license=('custom')
depends=('libxaw' 'libxmu' 'libxt' 'libX11' 'xorg-util-macros')
source=(http://xorg.freedesktop.org/archive/individual/app/xclipboard-${pkgver}.tar.bz2)
md5sums=('b9102fe787eda2a1c9578079d8f55eed')

build() {
  cd "${srcdir}/xclipboard-${pkgver}"
  ./configure --prefix=/usr --host=$CHOST --build=$CHOST
  make || return 1
  make DESTDIR="${pkgdir}" install
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}



RE: PKGBUILD files - tavvva - 01-01-2012 12:31 AM

(12-14-2011 05:59 PM)nl2stk Wrote:  Libraries Smile
This one is libexif and can be used by GIMP for example.
...
Another one:
libpciaccess
...

libexif ...
1.) libtool stuff not removed
2.) static lib not disabled (we don't want static libs unless they're explicitly required)

libpciaccess ...
the same issues Wink

NOTE: You might see these in my older packages built prior to my decision to drop static libs and before I noticed, that our version of pacman doesn't support libtool cleaning, but I'm slowly trying to rebuild such packages ...


RE: PKGBUILD files - nl2stk - 01-01-2012 04:21 PM

(01-01-2012 12:31 AM)tavvva Wrote:  libexif ...
1.) libtool stuff not removed
2.) static lib not disabled (we don't want static libs unless they're explicitly required)

libpciaccess ...
the same issues Wink

NOTE: You might see these in my older packages built prior to my decision to drop static libs and before I noticed, that our version of pacman doesn't support libtool cleaning, but I'm slowly trying to rebuild such packages ...

Argh! Time to update my 'noobish' text-file called 'PKGBUILD help'. It's no joke, I try to collect that information and put it in one text-file which I can open from the menu with one click :]
I hope that it reduce my mistakes in the nearby future.
This is what I've got so far...

Code:
PKGBUILD help:

How to make packages in 'i386' modus.
Replace './configure' by:

./configure --prefix=/usr --host=$CHOST --build=$CHOST

In case that doesn't work, try this:

./configure --prefix=/usr --host=i386-pc-linux-gnu --build=i386-pc-linux-gnu

----------------------------------------------------

If there isn't a 'configure' and it's just 'make', put the following
sentence BEFORE the 'make' command.

sed -i "s/CC=gcc/CC=gcc -march=i386/g" Makefile

----------------------------------------------------

In case of .install files be sure that they ended this way.

op=$1
shift
$op $*

-----------------------------------------------------

Libtool needs to be cleaned, put this in the end of your build (if needed).

# Remove the libtool stuff
find ${pkgdir} -depth | grep "\.la" | while read libtool_file ;do
rm -f $libtool_file
done
}

------------------------------------------------------
When your compiling a console/ncurses based game add some things to the
PKGBUILD and create an extra file. This gives the game a nice menu-entry etc.

In the PKGBUILD add in the 'source' sentence an 'pkgname-xterm'
example: source=(http://www.bla.com/game.tar.gz game-xterm)

Add the extra md5sum in the PKGBUILD
example: md5sums=('fromthegamesource' 'fromthegame-xterm')

Ofcourse we need to install the game-xterm, put this in the end of your build.
example: install -m755 ../game-xterm $pkgdir/usr/bin/

Create an 'gamename-xterm' file
example:
#!/bin/bash
xterm -fg white -bg black -geometry 80x25 -e game

Ofcourse you need to replace 'game' by the name of the package.

----------------------------------------------------------------------------

Don't use static libs! Find out how to disable them, otherwise ask a pro or
simply don't build it and find a replacement.



RE: PKGBUILD files - tavvva - 01-01-2012 05:14 PM

wow :] nice howto ...

there are some things which might be confusing ....

1.) The following WORKAROUND might or might not work ... since every piece of software has a different Makefile:

sed -i "s/CC=gcc/CC=gcc -march=i386/g" Makefile

It usually needs at least basic knowledge of Makefile structure. In such cases You would be able to produce a product specific workaround for missing architecture enforcements.

2.) If static libs can't be disabled, then they can be usually removed by the rm command after the build ... it's the most stupid way, but sometimes there's no other way ...


RE: PKGBUILD files - nl2stk - 01-01-2012 05:58 PM

(01-01-2012 05:14 PM)tavvva Wrote:  1.) The following WORKAROUND might or might not work ... since every piece of software has a different Makefile:

sed -i "s/CC=gcc/CC=gcc -march=i386/g" Makefile

That's what I know, but forgot to put in the text-file.
Before I put it in the PKGBUILD, I take a look in the Makefile.
I've had it once or twice that the Makefile was already for the i386 structure.

tavvva Wrote:2.) If static libs can't be disabled, then they can be usually removed by the rm command after the build ... it's the most stupid way, but sometimes there's no other way ...

Updated the text-file again, but I try to avoid such builds (better to be safe than sorry).


RE: PKGBUILD files - tavvva - 01-05-2012 05:10 PM

(01-05-2012 01:52 PM)Compact Wrote:  Are there more packages that better stay untouched ? Binutils e.g.? Maybe others ???
What about gtk, python, perl and other packages ?

These components were in my update plans too, but as they are quite critical, we'll have to be very careful while touching them. These components need to be very well tested (including performance tests) before we introduce them.

(01-05-2012 01:52 PM)Compact Wrote:  I stumbled several times upon this error during different compilations:
unrecognized commanline option "-Wno-pointer-sign"
Is there a way to circumvent it ?

You can patch the Makefile to skip this option ... simple substitution with empty string using the sed command could help Wink


RE: PKGBUILD files - nl2stk - 01-08-2012 03:15 PM

My first attempt to make a 'new style' PKGBUILD.
Ttytter, the console twitter-client, which contains the latest stable version :]

PKGBUILD

Code:
# Maintainer: theo - nl2stk

pkgname=ttytter
pkgver=1.2.05
pkgrel=1
pkgdesc="A multi-functional, command-line twitter client"
url="http://www.floodgap.com/software/ttytter"
license=('custom:FFSL')
depends=('perl' 'curl')
install=$pkgname.install
source=($url/dist1/$pkgver.txt
        $pkgname.desktop
    ${pkgname}_16x16.xpm
    ${pkgname}_32x32.xpm)
md5sums=('8d0e3a65b1ffb91983efcd6351414c81'
         'a031d1bac32ea0cad9a2be3f0b655ee8'
         '74aa592028ae757c67425fd937582c8e'
         '2ff39f605ae8793995e5e4ef0fbada71')

build() {
  cd "$srcdir"
  install -Dm755 $pkgver.txt "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 $srcdir/$pkgname.desktop $pkgdir/usr/share/applications/$pkgname.desktop
  install -Dm 644 $srcdir/${pkgname}_32x32.xpm $pkgdir/usr/share/pixmaps/${pkgname}_32x32.xpm
  install -Dm 644 $srcdir/${pkgname}_16x16.xpm $pkgdir/usr/share/pixmaps/${pkgname}_16x16.xpm
}

ttytter.desktop

Code:
[Desktop Entry]
Name=TTYtter
Exec=xterm -fg white -bg black -e ttytter
Icon=ttytter
Categories=Network;


ttytter.install
Code:
post_install() {
  [ -x /usr/bin/menu-generator-trigger ] && /usr/bin/menu-generator-trigger
}

post_upgrade() {
  [ -x /usr/bin/menu-generator-trigger ] && /usr/bin/menu-generator-trigger
}

post_remove() {
  [ -x /usr/bin/menu-generator-trigger ] && /usr/bin/menu-generator-trigger
}

op=$1
shift
$op $*

The icons are in the attachement (packed, the forum doesn't like .xpm files)


RE: PKGBUILD files - tavvva - 01-08-2012 03:54 PM

I believe I rebuilt enough in the first wave ... and going to start with the reviews again ....

Guys ... if Your PKGBUILDs do not generate the following files (doesn't matter how), then please update them to do so:

/usr/share/applications/myapp.desktop
/usr/share/pixmaps/myapp_16x16.xpm
/usr/share/pixmaps/myapp_32x32.xpm

If Your package needs just one menu entry and You have to create new .desktop file and .xpm icons, then You can use the following lines at the end of the build section

install -Dm644 $srcdir/$pkgname.desktop $pkgdir/usr/share/applications/$pkgname.desktop
install -Dm644 $srcdir/${pkgname}_16x16.xpm $pkgdir/usr/share/pixmaps/${pkgname}_16x16.xpm
install -Dm644 $srcdir/${pkgname}_32x32.xpm $pkgdir/usr/share/pixmaps/${pkgname}_32x32.xpm

The following lines can be used in the sources:
${pkgname}_16x16.xpm
${pkgname}_32x32.xpm
${pkgname}.desktop

And the following line is recommended for the install file:
install=${pkgname}.install

It would be nice to generate some PNG icons too ... they could be possibly used in the future. But this is not a rule yet :]


RE: PKGBUILD files - nl2stk - 01-08-2012 04:10 PM

I believe/hope that I don't miss a thing during the 'remake' of ttytter. A newer version was already planned, so it was a bit like 'kill two birds with one stone'.


RE: PKGBUILD files - tavvva - 01-08-2012 04:38 PM

(01-08-2012 03:15 PM)nl2stk Wrote:  My first attempt to make a 'new style' PKGBUILD.
Ttytter, the console twitter-client, which contains the latest stable version :]

It's OK ...

Btw. XPM format supports transparency if You'd like to hide those black edges in the icon. But that's a detail.