Pet building system

discuss compiling applications for Puppy
Message
Author
User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#61 Post by sc0ttman »

Pigz - faster alternative to gzip

Code: Select all

# pigz
# Builds from https://github.com/puppylinux-woof-CE/petbuilds

. ../func
. ../build.conf

URL=https://zlib.net/pigz
PKG=pigz
VER=2.3.4
COMP=tar.gz
DESC="multi-threaded gzip replacement library"
DEPS=
CAT=BuildingBlock
DESKTOP=
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)	
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not	

ARCH=$(uname -m)
case $ARCH in
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build() {
	cd ${PKG}-${VER}
	
	make
	[ "$?" -eq 0 ] || exit
	make DESTDIR=$CWD/${PKG}-install install

	cd -
}

package_build(){
	mkdir -p ${PKG}-install/usr/bin/
	mv ${PKG}-${VER}/pigz ${PKG}-install/usr/bin/
}

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
build
package_build
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT
[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]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#62 Post by musher0 »

ScOtman,

You lost me! What are you trying to do here? :)

Is there anything wrong with downloading the aqualung source (for example)
from the aqualung site, and building it on your Puppy using the devx?

I gather that pigz don't end up in your ham sandwich?! :lol:

TIA for any leads.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#63 Post by greengeek »

sc0ttman wrote:Ranger - console based file manager with Vi-like bindings

(Python based, very powerful)
Every time I see a python based utility I run a mile. Not sure why that is - I just feel that Python is a security risk and it shrouds everything in mystery. Why can't code be transparent? Why does it need python to do stuff??

Am I being unreasonable?

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

#64 Post by sc0ttman »

musher0 wrote:ScOtman,

You lost me! What are you trying to do here? :)
The whole point of this thread is to support the PetBuild system that
01micko put together. The scripts are to go into the petbuild system, at GitHub


It compiles stuff using 'build scripts' ..

You could manually download the source, and manually compile, etc ..
But these '*.petbuild' are like recipes to compile stuff and they makes
compiling stuff reproducible for others..

EXAMPLE: So what if you compiled Aqualung? How does that help me or others?
Did you make a PET? On which Puppy? Will it work on mine too?
Did you share it? Where? Link still work?

Did you make separate EXE, DEV, DOC and NLS? Did you compress and
strip the binaries and image/dat/etc files with advancecomp and optipng?
(Petbuild doen't either but it could/should do this by default, like buildpet does..

... Maybe I try your PET and it doesnt work on my Puppy, so I compile it,
only to find it won't build, so I ask what options YOU used, then after
some time you realise the --no-slang options was needed, so I try that..
Nice it compiled, but how do I package it? Where is the menu entry?
)

Or.... You could just make a petbuild script, which automates all of the above, and I can download it, and then just do:

Code: Select all

cd /usr/share/petbuild/yourpkg
sh yourpkg.petbuild
And then it will compile for me, with all the same options, hacks, patches that
you put into the petbuild, inc any custom .desktop files, etc ..

(Plus, my Pkg manager integrates with this PetBuild system, and lets me
simply do `pkg --pkg-build PKGNAME` .... so rather than compiling
manually I just make a petbuild and run one command..)

Once I got a working PET, I can share the petbuild script, and others can
simply run 1 command to build the same PET:

Code: Select all

sh mypkg.petbuild

... This way is MUCH better than manually compiling stuff, not telling people
the options you used, sharing the PET in a random place, etc, etc ..

This way (with .petbuilds), instead of sharing a PET that *might* work for some, I am sharing
a build script that should compile a working Aqualung for all Puppies.


Puppy users really should get in the habit of making and sharing petbuild
scripts, instead of manually compiling stuff and sharing PETs that *might
work for some*

NOTE, I should *probably* be creating these as Pull Requests on GitHub,
but need to sort some stuff with my GitHub account first..
Last edited by sc0ttman on Wed 13 Sep 2017, 14:46, edited 13 times in total.
[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
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#65 Post by sc0ttman »

greengeek wrote:
sc0ttman wrote:Ranger - console based file manager with Vi-like bindings

(Python based, very powerful)
Every time I see a python based utility I run a mile. Not sure why that is - I just feel that Python is a security risk and it shrouds everything in mystery. Why can't code be transparent? Why does it need python to do stuff??

Am I being unreasonable?
Yes lol, ranger is awesome.. Look in /usr/lib/python*/*something*/ranger/*** to see its code...

Also, the config files in ~/.config/ranger/ are beautifully written...

And Python is a good language to build stuff in, that is why people use it.
But yeah, it's hard to read, and kinda bloated .. But Puppy has Python 2.7
already, ranger just uses that .. the ranger PET is like 120kb, just FYI..

I have ranger setup on my netbook as my main file manager, with file
previews and file contents listings for image, video, archives, PETs, DEBs,
pdf, doc, xls, torrent, etc, etc...

It's like a MMView on steroids, but works without X too :)
[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
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

Azpainter

#66 Post by sc0ttman »

Azpainter - fantastic painting/drawing tool..

Much easier to use than Mtpaint (imho)

Save this as /path/to/your/petbuild/azpainter/azpainter.petbuild

Code: Select all

# azpainter2
# Builds from https://github.com/puppylinux-woof-CE/petbuilds

. ../func
. ../build.conf


URL=https://osdn.net/dl/azpainter/
PKG=azpainter
VER=2.1.1
COMP=tar.xz
DESC="A feature-packed and user-friendly painting program"
DEPS=
CAT=Graphic
DESKTOP=azpainter.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)	
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not	

ARCH=$(uname -m)
case $ARCH in
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build() {
	cd ${PKG}-${VER}
	./configure --prefix=/usr \
				--localstatedir=/var \
				--sysconfdir=/etc \
				--libdir=/usr/${LIBDIR}
	
	[ "$?" -eq 0 ] || exit
	make $MKFLG
	[ "$?" -eq 0 ] || exit
	make DESTDIR=$CWD/${PKG}-install install
	cd -
}
	
# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
build
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT
The desktop file

Save this as /path/to/your/petbuild/azpainter/azpainter.desktop

Code: Select all

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=AzPainter
Comment=Painting program
TyrExec=azpainter
Exec=azpainter
Icon=azpainter
Terminal=false
Categories=RasterGraphics
MimeType=application/x-azpainter-apd;
Then you can compile this in your Puppy by doing this:

Code: Select all

cd /path/to/petbuild
cd azpainter
sh azpainter.petbuild
That should compile you a nice Azpainter-2.1.1 PET (abut 760kb):

Image

Or get the source from https://osdn.net/dl/azpainter/azpainter-2.1.1.tar.xz
[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]

belham2
Posts: 1715
Joined: Mon 15 Aug 2016, 22:47

#67 Post by belham2 »

Hi Sc0ttman,

Am totally lost :oops: : followed your directions, for both midnight commander build and also azpainter, and nothing happens. I'm inside the latest woof-CE Slacko 32-bit build, with devx loaded, the azpainter.petbuild file was made & it was made sure to have all correct permissions. And when I go to run "sh azpainter.petbuild" in terminal opened in the azpainter folder inside /usr/share/, I get the following (by the way, the exact same thing happened, in the same place (line 4), for the MC build too):



P.S. [Followup], just checked and it's kind of ironic midnight commander, for example, is available via PPM, for a 12MB install, and pulls all 3 dependencies in for ya. Are we re-inventing the wheel here with this .petbuild stuff......shouldn't this thread only be focused on stuff NOT available through the PPM :?:
Attachments
figure-I-must-be-doing-something-very-stupidly-wrong.png
(62.62 KiB) Downloaded 700 times

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

#68 Post by sc0ttman »

belham2 wrote:Hi Sc0ttman,

Am totally lost :oops: : followed your directions, for both midnight commander build and also azpainter, and nothing happens.
Maybe read 01mickos first post.. Did you to install PetBuild? (which this is a thread for...)

it's kind of ironic midnight commander is available via PPM, for a 12MB install... Are we re-inventing the wheel here with this .petbuild stuff :?:
yes on your puppy ... but what if people don't have it in their repo, or it is outdated?
What if they don't want to include the (unneeded) SLANG (or whatever MC wants by default instead of ncurses)? ..
shouldn't this thread only be focused on stuff NOT available through the PPM
I can guarantee the .petbuild script will build you a working MC for a lot less than 12mb, with zero deps.. split into EXE, DEV, DOC, etc...
Do the slackware/ubu repos have that? Nope..


Can people please read 01mickos first post .. This thread is about the PetBuild system ...
Don't see why I should have to keep justifying why I am supplying build scripts to a project/thread asking for build scripts... :roll:

Rather than telling me it's pointless (if so, why do almost all other distros have their own versions of PetBuild?) maybe read the first
post and start making (and sharing) build scripts of your own, so others can easily compile the cool prgrams that you compiled?

Plus I'm hoping to get some tips from the (many) compilers on this forum about improving any of these build scripts (or others)..
(Though, note to self, I should probably be tackling harder/rarer pkgs and doing PRs on github!)

EDITED.. removed the word 'ugh'.
Last edited by sc0ttman on Thu 21 Sep 2017, 09:30, edited 1 time in total.
[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
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#69 Post by sc0ttman »

Some further info:

Nearly all the big distros have this kind of build script system.. And they all benefit from their users using them..

(It's sometime called a 'ports' system.)

They are scripts that automate compiling and building packages...

Build scripts can be made for packages that ARE in an offical repo, (maybe yours has different options, newer version, or fewer deps),
but also packages that are not in the official repos too.

Examples:

* FreeBSD ports: https://www.freebsd.org/ports/

* The Arch Linux version of 'creating a PetBuild script': https://wiki.archlinux.org/index.php/Cr ... a_PKGBUILD

* The Slackware 'build script repo' : https://www.slackbuilds.org/repository/14.2/

* How to create build scripts for Alpine Linux: https://wiki.alpinelinux.org/wiki/Creat ... BUILD_file

* Here is all the build script repos that CRUX users maintain for each other (so they can easily rebuild each others packages): https://crux.nu/portdb/

* Here's Pkgsrc .. It's a beast (I left it compiling for 5 days straight, on an Ubuntu machine): https://www.pkgsrc.org/
(Pkgsrc can work on BSD, Linux and Mac, has over 40,000 pkg build scripts)

* Aaaand Joyent Pkgsrc (like above, but also have pre-built pkgs avail and an extra pkg manager to install/rm them): https://pkgsrc.joyent.com/

... the whole point of the PetBuild system is to give Puppy a similar build script system, cos it's a great way
to create good quality, sharable user-contributed packages, that can be built to work on any system...

A whole repository of just build scripts (not packages) allows users to download and build the package themselves..


* Slackware has SBopkg
* Arch has ABS (Arch Build System)
* FreeBSD has a 'ports' system
* CRUX has a 'ports' system
* Alpine has the APKBUILD system

.. and Puppy has PetBuild.
[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
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#70 Post by greengeek »

Hi Scottman - don't be too hard on Belham - when you posted the azpainter stuff I thought "yep, I have to try this" then I got exactly the same error Belham did. Then I realised the buildscript thing is for the devs :-)

Even harder than just loading the devx....

Fortunately we have brainiacs like yourself and micko to do the hard yards.

Thanks to you all!

belham2
Posts: 1715
Joined: Mon 15 Aug 2016, 22:47

#71 Post by belham2 »

greengeek wrote:Hi Scottman - don't be too hard on Belham - when you posted the azpainter stuff I thought "yep, I have to try this" then I got exactly the same error Belham did. Then I realised the buildscript thing is for the devs :-)

Even harder than just loading the devx....

Fortunately we have brainiacs like yourself and micko to do the hard yards.

Thanks to you all!

Hi Greengeek,

Yeah, my fault, was notunderstanding things correctly even though I had flashed thru the complete thread (too quickly obviously). What I love about the forum is the ability of people being decent. You know, where they take the time to write one line: "hey, so&so, read Micko's first thread (closely this time, if you did already) and then tell me what you think..." Instead we get what we got above, and people wonder what could possibly be wrong. Anyhow, after this, I'll just go back to the pups I normally build from woof-CE and compile (like I always do) with the devx anything that is not available via PPM. Screw this crap and especially the attitude.

On a more positive note, Greengeek, sure hope you're going to do a new, updated version of your secure pup banksy. :wink:

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#72 Post by greengeek »

Hi Belham - I should probably have spotted the similarity to "slackbuilds" - I tried one a few months ago and found it quite a useful idea. It's kind of like having someone iron out the bugs before compiling.

I just re-read mickos first post and realise there is still a lot to understand before this becomes a turnkey system for newbies. Unfortunately the older I get the less capable I feel - so I will be keen to see if this simplifies even further. PPM makes things easy but if I understand it correctly a petbuild system has the potential to make it possible for a less experienced person to "compile" (wrong word probably) a utility for their specific pup with little effort. At the moment I think it makes it quicker for an experienced dev to populate their repository (and boost the PPM).

Dunno if I got that right tho'

(Yeah I would love to update Banksy but there currently are two problems - I am unhappy with my understanding of openssl and also I need to work out the best way to make banksy easily compatible with kernel swaps. Thanks for the interest!)

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

#73 Post by sc0ttman »

Take out the word 'Ugh' and I don't see how my post was more than 1% rude.. Exasperated, yes..
(In fact, I edited the post to remove 'ugh', the only change, now go read it.. not rude)

Sorry if you are offended - but it's the 2nd time I have to 'justify' why I'm posting
build scripts to a thread about build scripts!!

And JUST after I explained to musher0 the EXACT same thing, just 2 or 3 posts up..

....And greengeek, you are spot on, except build scripts are not "just for devs" (not generally in linux world, anyway)...
greegeek wrote:I understand it correctly a petbuild system has the potential to make it possible for a less experienced person to "compile" (wrong word probably) a utility for their specific pup with little effort
Spot on.. to 'compile and package' it.. The "potential" is there already BTW - all PETs included in Slacko 14.2 are reproducible using PetBuild. Plus others.

Compiling stuff manually (adding tweaks, fixes, etc, splitting (EXE,DEV,etc), packaging) and THEN making a petbuild script should be for the devs.. cos THAT is the hard part..

...but simply running `sh **.petbuild` should be for the masses.. cos that's the easy bit which re-produces the "devs" work for all..

That is how other distros do it... And build scripts are partly why AUR and SBopkg have SO many packages..

(I'm crap at compiling, so to make a .petbuild I simply manually compile something to check it works, then I uninstall it .. I then copy an existing petbuild script,
I update the pkg name, source URL, version, config options (etc), and run PetBuild to automate re-building it.. If it workz, I sharez.. )

Having build scripts (or a repo full of them!) prevents users having to compile stuff themselves, particularly the harder stuff..
It also greatly increases the number AND quality of packages available..

(Of course users are always free to compile stuff themselves if they prefer... no one is stopping them..)

Hosting a repo of build scripts is like hosting a magic repo for ALL puppies.. and takes up a LOT less space online..



When you share a petbuild script, you are essentially sharing a PET that will work on any puppy
that can compile it.. Not only the puppy that YOU compiled it on...


Then you share your .petbuild (on here or via GitHub PR), and then others (who can't compile themselves) will
still be able to compile those PETs from scratch, no effort needed.

If people can't see the benefit of this, please don't complain to me about it.. I didn't even create PetBuild, and no one is making you install it and compile this way...


If people got in the habit of simply copying and pasting a petbuild script,
we wouldn't need to post random PETs to dodgy file hosting places, or
constantly be asking "Can you make a PET for my puppy?"

.. and "devs" (users like you and me) wouldnt need to make PETs for 10 different pups every time they compiled something and wanted to share it..
Last edited by sc0ttman on Thu 21 Sep 2017, 15:41, edited 1 time in total.
[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
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#74 Post by sc0ttman »

As 01mickos first post is a bit messy..

Here is a guide to make things easy as possible (if people want to try out PetBuild for themselves):

(But bear in mind I'm no expert at all on these things...
And feel free to ignore this entire thread and compile as usual if u prefer, but some of 01mickos good work will get wasted in that case)

Requirements: Devx installed.

1. Install PetBuild (inc build scripts) to /usr/share/petbuild and go there:

Code: Select all

git clone https://github.com/puppylinux-woof-CE/petbuilds.git /usr/share/petbuild
cd /usr/share/petbuild
2. Then (annoyingly) to see the buildscripts, you have to choose a branch:

Code: Select all

git checkout slacko_142

Code: Select all

git checkout slacko_141

Code: Select all

git checkout tahrpup
The reason for this, is that PetBuild was/is (primarily) designed to compile & package all the PETs needed
to build a Puppy (slacko141/slacko142/tahrpup) all in one go..

NOTE: many build systems don't have branches like that, and PetBuild prob shouldn't only have build scripts in specific branches.. It's a 'wrinkle'..
PetBuild's main branch (master) should be full of .petbuild scripts that are meant to work in "any" puppy.. and we should be contributing them..


So, at this point, you have some options:

a. Use whatever branch is closest to your running puppy (tahrpup for deb pups, etc)..
[For now, I do this option - I checkout slacko142, and just start adding new build scripts to /usr/share/petbuild/**]

b. Or, even better, create a branch for your custom pkgs:

Code: Select all

git checkout master
git checkout -b yourname_contrib
3. Either way (a. or b.), you can just ignore git from now on, if you like...

Once you have PetBuild at /usr/share/petbuild/ and some build scripts in their folders (/usr/share/petbuild/freeciv/freeciv.petbuild)
you can start using PetBuild to build your packages...

Code: Select all

cd /usr/share/petbuild/freeciv
sh freeciv.petbuild
Yours pets will be in /usr/share/petbuild/0pets_out

DONE.
______________________________________

Now you're not only compiling pkgs that work on YOUR puppy, but you also created scripts to automate building the
same thing on other Puppys too. 01micko, Tman iguleder (who paved the way) did great work..

Again, this might seem like a lot of "hard work", but PetBuild really is simpler and lighter (and easier) than the equivalents
in Arch, Alpine, etc (see links above), yet with all the same benefits of sharing "recipes" for pkgs..

But the "hard work" amounts to running 2 or 3 commands to get PetBuild setup, then copy and pasting existing petbuilds
and hacking them to change name, version, url, etc ... then running them :)

Then (optionally) instead of sharing your PETs, you can simply copy and paste your build script (and maybe desktop file) to the
forum, and others can build it for themselves.. They might (not) thank you for it.

Note: having build scripts only in branches for specific pups in a build system is not so user-friendly for average users,
but you *can* create any branches you like, or you *could* stay in master to create build scripts for 'any' puppy...

....In the future:

Even better, we *could* push our new branches of build scripts back to Git, so others can get our "username_contrib" repos,
with ALL our build scripts...

I look forward to the day when users can simply do:

Code: Select all

cd /usr/share/petbuild
git checkout sc0ttman_contrib
git pull origin sc0ttman_contrib  # get the latest build srcripts
cd puppy_arcade
sh puppy_arcade.petbuild
That would (hopefully) compile a freshly working puppy arcade PET for your system, including all emulators, config files etc, already setup,
with my custom frontends etc..

BENEFITS:

* If the build script worked (built good PETs) on many puppies, the .petbuild could go into the master branch, so users don't even need to checkout any other branches..

* The various PETs that got built from it (PetBuild would create differently named pets on diff puppies) would also be good candidates
for being added to the official repos of each Puppy on which they were built successfully..

* Users of many different Pups could update their repo and find lots of new PETs available, built on their system, for their system,
reliably, reproducibly built by other users, using PetBuild. All from a single build script.

* The distro devs/maintainers don't then need to be the people who compile ALL packages for a particular release (like 01micko did so far)

* And importantly in puppy land, other devs/users will not need to manually re-produce the same PETs for each new Puppy that comes along!!

* You could just download a new puppy (pupletX), then run petbuild in pupletX to re-produce the PETs you wanted for that system...

* Puplet builders could more easily re-produce their own efforts in the same way, while releasing new versions..

.. That is how lots of other distros go from source -> user package -> official repo package ... They do it via a PetBuild (build script) like system..


EDIT:

That's a long few posts, but hopefully clears up what this thread is all about, and why it exists...
And explains why 01micko made Petbuild in the first place...

Sorry if I offended anyone.
[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
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#75 Post by battleshooter »

Wow, I've got to say, this is really cool. Thanks for taking the time to explain it Scott, I just had a go and was successful in creating a pet build for libxfce4util-4.12.1.tar.bz2. I'm going to go ahead and dumb things down even further for anyone else also wanting to have a go at the deeper world of Puppy systems.

I followed Scott's instructions to set up the build system so once you're up to step 3, you're working on the actual pet script.

Each pet gets a pet script and they look like this:

Code: Select all

# galculator
# Builds from https://github.com/puppylinux-woof-CE/petbuilds

. ../func
. ../build.conf

URL=http://downloads.sourceforge.net/project/galculator/galculator/2.1.3
PKG=galculator
VER=2.1.3
COMP=tar.bz2
DESC="Nice light weight calculator"
DEPS=+gtk=2
CAT=Business
DESKTOP=galculator.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)	
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not	

ARCH=$(uname -m)
case $ARCH in
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build() {
	cd ${PKG}-${VER}
	./configure --prefix=/usr \
				--localstatedir=/var \
				--sysconfdir=/etc \
				--libdir=/usr/${LIBDIR} \
				--disable-gtk3
	[ "$?" -eq 0 ] || exit
	make $MKFLG
	[ "$?" -eq 0 ] || exit
	make DESTDIR=$CWD/${PKG}-install install
	cd -
}
	
# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
build
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT

This was one of the simplest ones but the others are amazing for giving examples of how complicated the scripts can get. But this one for gcalculator was most relatable as it follows the standard ./configure --prefix=/usr; make; make install process I'm familiar with.

These are the fields I changed:

Code: Select all

URL=Enter the folder that holds the source code 
PKG=Change to the package name
VER=Version number obviously
COMP=Change this to tar.gz, tar.bz, tar.xz whatever the archive type is
DESC="Describe the package"
DEPS=Dependencies go here
CAT=Category for menus (Not needed if there's no menu entry)
DESKTOP=What the desktop file should be called (Not needed if there's no menu entry)
With the paper work sorted out, jump down to the build section, that's where you put the commands as if you were compiling it by hand, the commands you'd normally type into a terminal.

Code: Select all

	./configure --prefix=/usr \
				--localstatedir=/var \
				--sysconfdir=/etc \
				--libdir=/usr/${LIBDIR} \
				--disable-gtk3
Replace this with your usual configure command

The remaining 2 commands are just the usual make and make install commands.

Final thing is to add your md5sum to /usr/share/petbuild/md5sums.txt. Took me awhile to realize that.

And just like that, anyone can rebuild your package by using

Code: Select all

cd /usr/share/petbuild/name_of_package
sh name_of_package.petbuild
As Scott mentioned. Cheers mate!

This is probably really obvious to anyone that's used to scripting, but I thought I'd leave a note in case it could help anyone while I'm still really excited about my basic discovery :lol:
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#76 Post by battleshooter »

XFCE petbuild files :)

Code: Select all

glib
gobject-introspection
atk
at-spi2-core
at-spi2-atk
harfbuzz
freetype
fontconfig
pango
gtk3+
libxfce4util
xfconf
startup-notification
libxfce4ui
exo
garcon
gtk-xfce-engine
libwnck
xfce4-panel
libnotify
xfce4-notifyd
Thunar
libgudev
thunar-volman
tumbler
xfce4-appfinder
xfce4-settings
xfdesktop
xfwm
xfce4-session
That's the order list if interested in compiling them straight up. Basically if you use them, they will compile and leave you in the state I find xfce after a fresh compile. I'm not sure if the tweaks needed to get xfce into the state you find it in XenialPup with XFCE (I really need to figure out a name for it) should go in a pet build, or Woof-CE code. All in all though, I'm pretty excited about this this is a big step closer in being able to have XFCE freshly compiled and ready to go with any Puplet (which seems important with swiftly moving Pup versions)

Either you can follow the order list and compile each one manually with

Code: Select all

sh <package name>.petbuild
Or you can run it automated with this second script attached I put together that utilize's Sc0ttman's handy dandy pkg.

I've got to say I absolutely love it, normally it can take me a day to compile XFCE from scratch, forgetting the tweaks I used last time, or compiling pitfalls I might forget how to get around. But with the scripts, it's all saved, remembered and automated, same product every time. Also because it's just bam bam bam, one compile after another, it's a lot faster than me waiting around for each build. All in all, took 30 minutes to compile XFCE including GTK3 unattended. So far I've only tested it on XenialPup64, and Slacko 32 bit 6.9.9.9*. Other than Phil's puplets, the script will need tweaking, probably adding a flag for 64 bit builds as I need to put in a switch so the libdir is set to /usr/lib64.

*Slacko is missing gtk2 dev files, specifically a gir file and gperf so preinstall those. Xenial should work straight off.

How to use the automated script:

1. Have devx, petbuild and Sc0ttman's pkg pet installed

2. Extract the contents of both scripts into the petbuild folder

3. Run build_all_with_install.sh in a terminal and hopefully in 30 minutes (if I've got the steps right) - you'll have a freshly baked version of xfce!

Edit: Ah crap, forgot about /root/.xinitrc, you need to comment out

Code: Select all

[ "$desktop" = "" ] && desktop=rox
and

Code: Select all

[ "$desktop" = "rox" ] && exec jwm
Otherwise the desktop doesn't show right. I've been meaning to do a rewrite of xinitrc with an actual xfce section, does anyone actually call xfwm4 directly as the window manager anymore instead of startxfce4 :shock: ?
Attachments
build_all_with_install.sh.tar.gz
Real tar.gz
(1.51 KiB) Downloaded 529 times
xfcebuilds.tar.gz
Real tar.gz
(235.72 KiB) Downloaded 543 times
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

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

#77 Post by 01micko »

Hi battleshooter..

Nice start! Working almost as advertised on 64 bit.

However, I see there is a lot of code duplication in your petbuilds which are taken care of in the functions.

For example, a pretty standard line in most is..

Code: Select all

./configure --prefix=/usr sysconfdir=/etc --localstatedir=/var
.. which is taken care of in the build_configure() function in ./func.

You'll notice to there is a --libdir= option to configure which is essential in slacko based pups as in 64 bit the libdir is /usr/lib64 (as opposed to /usr/lib - which configure defaults to if --prefix=/usr).

I'll leave you with those bones to pick, oh, and of course a screeny :) (has a custom icon theme I've been working on - and shows a few are missing)
Attachments
xfce.png
(191.05 KiB) Downloaded 793 times
Puppy Linux Blog - contact me for access

User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#78 Post by battleshooter »

Hah, wow, that is so cool! I know it's what it's suppose to do, but I can't help but feel chuffed someone else could reproduce it as intended :D

I see what you mean about the code reproduction, I can go through and reset them to use the provided function.

Scott mentioned the option to set the build to 64 bit in the conf but I haven't tested it yet, thanks for testing it and the feedback Micko! I know you're busier these days so appreciate you taking the time.

@anyone who knows
As as side topic, has Petbuild been incorporated into Woof-CE? I've been digging around but the only petbuilds I can find are the ones for initrd-progs
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#79 Post by peebee »

battleshooter wrote:has Petbuild been incorporated into Woof-CE?
https://github.com/puppylinux-woof-CE/petbuilds
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#80 Post by battleshooter »

I suppose what I'm trying to work out is how do I get Woof-CE to build a petbuild? Do I just use DISTRO_PKGS_SPECS-ubuntu-xenial:

Code: Select all

yes|xfdesktop4|xfdesktop4,xfdesktop4-data|exe,dev,doc,nls
Would that include the deb from the Ubuntu repository or would my petbuild recipe take precedence?
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

Post Reply