Pet building system

discuss compiling applications for Puppy
Message
Author
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

Pet building system

#1 Post by 01micko »

UPDATE

I have started the git repository. Please fork and add your recipes!!! There are literally thousands needed. I have 4. :lol: Rome wasn't built in a day.

See https://github.com/puppylinux-woof-CE/petbuilds

Code: Select all

git clone https://github.com/puppylinux-woof-CE/petbuilds.git
UPDATE: new2dir is no longer a requirement. Splitting is done by split.sh

Image

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

NEW!

New git repository for Puppy Linux initrd.gz programs.

https://github.com/puppylinux-woof-CE/initrd_progs


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

This should have been done years ago, actually before the very first version of puppy was released, but it wasn't and no one has addressed the problem.

We all now the old routine.. compile .. new2dir.. dir2pet, manual garbage. The idea of computers is to *automate* isn't it? That's why scripts/batch files/whatever were invented. :roll:

Anyway, for the old schoolers who like the manual approach I have kept the old functionality of new2dir and dir2pet, probably not a bad idea for noobs.

However, if you're sick to death of the old school method, I have patched new2dir and dir2pet to be automated with some cli options, well the cli options are essential, there is a little help on the cli until I document this fully (soon).

So.. now it is possible to write a little script (in a specific format) and automate your builds.. you could nearly build the whole system with it.

script goes in >>> pet package comes out. Simple as that, and splitting (doc, dev, nls) is taken care of.

This is in no way a competitor or replacement for amigo's excellent src2pkg. It's for those who want to build in a queue.

Of course a refined recipe is needed and I'll attach a sample jwm.buildpet.

Inspiration for this came from Tman, who did similar to this awhile ago, but not as automated, jamesbond.. and Iguleder who has been harping on about this for ages (with good reason).. and amigo of course.

It still has all the disadvantages of installwatch, in that the binaries are installed to your system. maybe one day I'll get rid of installwacth as many sources these days support DESTDIR and if they don't can be sandboxed. But until then this is a step in the right direction.

Sample recipe (attached too, and a bit lazy .. build triplet? )

Code: Select all

# jwm
# this file requires new2dir and dir2pet updated @ 141012

URL=http://joewing.net/projects/jwm/snapshots/
PKG=jwm
VER=976
COMP=tar.xz
DESC="Joes Window Manager for X"
DEPS=+cairo,+rsvg,+libpng,+libjpeg,+xpm,+fribidi
CAT=Desktop

ARCH=`uname -m`
case $ARCH in
 *64) LIBDIR=lib64 ;;
 *) LIBDIR=lib ;;
esac

retrieve() {
	[ -f "${PKG}-${VER}.${COMP}" ] ||\
	 wget -t0 -c ${URL}/${PKG}-${VER}.${COMP}
}

extract() {
	tar -xvf ${PKG}-${VER}.${COMP}
	[ "$?" -eq 0 ] || exit
}

build() {
	# since not X compiling forget build triplet
	cd ${PKG}-${VER}
	./configure --prefix=/usr \
				--localstatedir=/var \
				--sysconfdir=/etc \
				--libdir=/usr/${LIBDIR}
	[ "$?" -eq 0 ] || exit
	make
	[ "$?" -eq 0 ] || exit
	newer2dir make install
	make clean
	cd -
}
	
package() {
	# add this recipe
	install -d -m 0755 ./$PKG-$VER-$ARCH/usr/share/doc
	cat ${PKG}.petbuild > ./$PKG-$VER-$ARCH/usr/share/doc/$PKG-build-recipe
	if [ "$DESKTOP" ];then
		install -d -m 0755 ./$PKG-$VER-$ARCH/usr/share/applications
		cat $DESKTOP > ./$PKG-$VER-$ARCH/usr/share/applications/$DESKTOP
	fi
	[ -f ./pinstall.sh ] && install -m 0755 pinstall.sh ./$PKG-$VER-$ARCH/
	[ -f ./puninstall.sh ] && install -m 0755 puninstall.sh ./$PKG-$VER-$ARCH/
	for p in `ls|grep "\-${ARCH}"|grep -v "files$"` ; do
		case $p in
			*_DEV*) DESC="$PKG development"; DEPS=+${PKG} ;;
			*_DOC*) DESC="$PKG documentation"; DEPS=+${PKG} ;;
			*_NLS*) DESC="$PKG locales"; DEPS=+${PKG} ;;
		esac	
		dir2pet -x -s -w="$DESC" -d="$DEPS" -c=$CAT -p=${p} 2>&1 >/dev/null
	done
}

# main
retrieve
extract
build
package	
	
Of course this is NOT one size fits all.. it is there to be tweaked for your sources. The new new2dir and dir2pet scripts are an requirement. (attached). Back up the originals first.

There is no warranty as usual and there is a high likelihood of BUGS. Please report/fix as necessary. Should work in all woof-CE builds, may work in some of Barry's woof builds, haven't tested.

Have fun.

PS: please invoke the recipe in it's OWN directory otherwise there could be unforeseen consequences.

UPDATE: installwatch sucks. There is an issue with the new2dir I uploaded, and I really can't work it out, but I have worked around it. There is now a symlink called newer2dir which is called to invoke the silent mode. CLI args are dropped (apart from the usual "make install").

REMOVED jwm attachment, all latest are at github
Attachments
new2dir_dir2pet-141012-2.tar.bz2
(10.31 KiB) Downloaded 910 times
Last edited by 01micko on Mon 20 Oct 2014, 01:13, edited 4 times in total.
Puppy Linux Blog - contact me for access

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#2 Post by amigo »

Yeah, recipes are the real bottleneck for any build system. The amount of code exclusive to a build should be very limited so that one doesn't have to write a build script from scratch for each package. Ideally, the system should be smart enough to build the simplest sources without any intervention -and with a single command. So, the answer is to use src2pkg as it already does these things -and will even write the build script for you so you always can refer back to it or easily edit it for tweaking the build.
What could be easier?:
'src2pkg URL-of-source'
will actually succeed in many cases. Of course, for many sources you will want/need to add a couple of configure options or a couple of lines of arbitrary code in order to achieve a 'perfect' package.
There are many build systems which address these needs, but all of them require at least a basic recipe -except for src2pkg- still the only system which really can build some things even without a recipe. And, it's 'smartness' can always be overridden when needed and it lets you customize configure/compile options on a system-wide, group or individual level.

BTW, src2pkg is now included in porteus -after being used and lauded for years by picky Slackware users...

Jasper

#3 Post by Jasper »

Hi guys,

It's my deficiency, but I'm not clear if this is intended to update to jwm v 976 (the latest version) or if jwm v 976 is needed to use it to make other pets.

My regards

PS I have src2pkg v 3.0 and to make and install the latest version of jwm-976 I use:

Code: Select all

src2pkg -PET http://joewing.net/projects/jwm/snapshots/jwm-976.tar.xz
by running it in a terminal after loading my devx.sfs (devx_precise_5.6.sfs).

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#4 Post by 01micko »

Hello Jasper,

This "build system" is more targeted toward distro/package builders. Once you have a set of recipes worked out, you should be able to identically reproduce the package - and the recipe is copied to the package. Once a builder has done that he/she can then reproduce for another arch or a newer distro.

The jwm recipe is merely an example. I'll attach a couple more.

Puppy has never had build scripts of its own. I've (we've?) always had to go searching through Barry's Blog or his source archive to find out how to compile stuffs, and sometimes it's tricky or BK's instructions are(were) rather vague.

What I'll probably do with this, after my mods to new2dir and dir2pet are proven relatively stable, is push those to woof-CE and start a separate git repo for build recipes. Over time all packages in puppy should have a recipe, that's the theory anyway.

I'm not advocating that anyone should use this over src2pkg. It is a fine program in it's own right, ideal for noobs and experienced users, especially when they need something fast and haven't time to hunt down build scripts.

A bit clearer now?

Cheers

EDIT:: removed attachments, latest are at github
Last edited by 01micko on Tue 14 Oct 2014, 00:20, edited 1 time in total.
Puppy Linux Blog - contact me for access

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#5 Post by Iguleder »

01micko wrote:... and start a separate git repo for build recipes. Over time all packages in puppy should have a recipe, that's the theory anyway.
I think it's the 4th or 5th time someone tries to do this. I hope it's going to work this time.

The next step is a script that extracts the pet.specs files from all PETs in a directory, then creates a "Packages-puppy-%s-official" thingy.

Once we have this and recipes for all must-have packages (pretty much everything in the "common" repository - the kernel, Aufs' tools, BusyBox, etc'), the development of future puppies (especially new 64-bit ports) will be way easier.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

Jasper

#6 Post by Jasper »

Hi 01micko,

Thank you very much for taking the time and trouble to explain the principles. The fog has not cleared, but it's not so dense now.

My regards

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#7 Post by 01micko »

No worries Jasper

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

Git repo created,

See main post
Puppy Linux Blog - contact me for access

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#8 Post by 01micko »

Just some stats...
  • petbuilds : 32
    commits : 14
    contributors : 1 :!:
    forks : 0 :!:
Traffic
  • views : 151 :?:
    unique visitors : 26
    clones : 1 :idea:
Puppy Linux Blog - contact me for access

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#9 Post by zigbert »

Even if things are moving slowly in the Puppy world, we're pushing in the right direction...

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#10 Post by Geoffrey »

I was the clown that cloned :lol: just having a look at the build scripts.
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#11 Post by 01micko »

Geoffrey wrote:I was the clown that cloned :lol: just having a look at the build scripts.
When you are happy enough then you can fork :wink: . When you make some send a pull request. I'm uploading sources to ibiblio as I go. crazy obscure ones like ifplugd and cddetect_quick (and other custom puppy source).

While you're at it, try the mtp_phone_connect BUT set the POPUP_NOTIFY varible (in the petbuild) to 1 for Carolina as you have a proper notification daemon builtin to xfce. Let me know what you think.

BTW, all testing is done on 64 and 32.

EDIT: petget (Carolina) would need to be patched for xz compression, or hack it out of dir2pet, your choice, unless it already does support xz?
Last edited by 01micko on Wed 15 Oct 2014, 10:02, edited 1 time in total.
Puppy Linux Blog - contact me for access

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#12 Post by sc0ttman »

Sorry if this is off topic, but ..

In the past when using Akita, and again recently in Slacko beta, I've installed sbopkg and used it to successfully compile a ton of programs from source, using the SlackBuild recipes which spopkg reads to build pkgs... I only had to add 'makepkg' to /sbin, and it was all good..

Can we not leverage the amount of SlackBuilds available online?

Can we steal some code from sbopkg and make this pet builder system work with SlackBuilds and source recipes of various other kinds? (The same way the PPM can install pkgs from various distros)...
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#13 Post by 01micko »

Absolutely sc0ttman!

My samba build script will be pilfered straight from PV's slackbuild. I have been building it like that for awhile but manually adding the puppy specifics.

The main difference is the end, where slackware will leverage DESTDIR, we install directly and call new2dir (installwatch frontend). A bit of sed trickery and a slackbuild could be converted easily.

When in doubt I either use a slackbuild or src2pkg.

However, all the custom puppy progs (obscure ones I have mentioned and others developed more recently) do need special attention.

How about a build script for sjpplog? It looks nice (jamesbond's blog is a fine example http://www.lightofdawn.org/blog/ - note the new address ).

:)
Puppy Linux Blog - contact me for access

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#14 Post by mavrothal »

Although all puppies can use slackware packages maybe dir2pet could be modified to use slackbuild output (mostly the install scripts and package info).

BTW line 218 of new2dir above, is a bit strange :P
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#15 Post by 01micko »

http://t.co/haQr9bjjn2

:lol:

Dunno how that happened.. but it doesn't seem to affect anything. :?

EDIT: fixed version pushed to woof-CE/testing
Puppy Linux Blog - contact me for access

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#16 Post by zigbert »

Is it a good idea for me to make 'buildscripts' for the pSeries. They would only download pets, but if it could simplify the package building process...

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#17 Post by Iguleder »

I think we should define some milestone.

Personally, I think the right thing to do is to create build scripts for all PETs in TahrPup (I mean, from both "common" and other repositories). I think we already have most of them.

Later, we'll be able to build all these packages under Slacko64 or Fatdog, to produce an ugly but working TahrPup64. The next step would be rebuilding everything from within TahrPup64, to produce a "clean" one.

The concept of build scripts could push Puppy forward :)
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#18 Post by 01micko »

01micko wrote:Just some stats...
  • petbuilds : 32
    commits : 14
    contributors : 1 :!:
    forks : 0 :!:
Traffic
  • views : 151 :?:
    unique visitors : 26
    clones : 1 :idea:
  • petbuilds : 46
    commits : 35
    contributors : 2 :!: Thanks @Iguleder!
    forks : 1 :!: ditto^^
Traffic
  • views : 481 :?:
    unique visitors : 46
    clones : 3 :idea:
Puppy Linux Blog - contact me for access

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#19 Post by trio »

Hi Mick :)

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#20 Post by 01micko »

:lol:

You back or passing by?

Good to see you around :)
Puppy Linux Blog - contact me for access

Post Reply