Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 24 Oct 2017, 02:01
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Compiling
Pet building system
Post new topic   Reply to topic View previous topic :: View next topic
Page 5 of 5 [75 Posts]   Goto page: Previous 1, 2, 3, 4, 5
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2541
Location: UK

PostPosted: Tue 12 Sep 2017, 21:54    Post subject:  

Pigz - faster alternative to gzip

Code:
# 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

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 10992
Location: Gatineau (Qc), Canada

PostPosted: Wed 13 Sep 2017, 00:57    Post subject:  

ScOtman,

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

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?! Laughing

TIA for any leads.

BFN.

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4662
Location: Republic of Novo Zelande

PostPosted: Wed 13 Sep 2017, 03:44    Post subject:  

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?
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2541
Location: UK

PostPosted: Wed 13 Sep 2017, 07:20    Post subject:  

musher0 wrote:
ScOtman,

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

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:
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:
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..

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Wed 13 Sep 2017, 10:46; edited 13 times in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2541
Location: UK

PostPosted: Wed 13 Sep 2017, 07:21    Post subject:  

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 Smile

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2541
Location: UK

PostPosted: Wed 20 Sep 2017, 13:51    Post subject: Azpainter
Subject description: excellent lightweight painting/drawing program
 

Azpainter - fantastic painting/drawing tool..

Much easier to use than Mtpaint (imho)

Save this as /path/to/your/petbuild/azpainter/azpainter.petbuild
Code:
# 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:
[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:
cd /path/to/petbuild
cd azpainter
sh azpainter.petbuild


That should compile you a nice Azpainter-2.1.1 PET (abut 760kb):



Or get the source from https://osdn.net/dl/azpainter/azpainter-2.1.1.tar.xz

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
belham2

Joined: 15 Aug 2016
Posts: 1190

PostPosted: Wed 20 Sep 2017, 16:27    Post subject:  

Hi Sc0ttman,

Am totally lost Embarassed : 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 Question
figure-I-must-be-doing-something-very-stupidly-wrong.png
 Description   
 Filesize   62.62 KB
 Viewed   270 Time(s)

figure-I-must-be-doing-something-very-stupidly-wrong.png

Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2541
Location: UK

PostPosted: Wed 20 Sep 2017, 17:54    Post subject:  

belham2 wrote:
Hi Sc0ttman,

Am totally lost Embarassed : 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...)


Quote:
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 Question

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)? ..

Quote:
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... Rolling Eyes

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'.

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Thu 21 Sep 2017, 05:30; edited 1 time in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2541
Location: UK

PostPosted: Wed 20 Sep 2017, 18:41    Post subject:  

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/Creating_packages#Creating_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/Creating_an_Alpine_package#Creating_an_APKBUILD_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.

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4662
Location: Republic of Novo Zelande

PostPosted: Thu 21 Sep 2017, 03:52    Post subject:  

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 Smile

Even harder than just loading the devx....

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

Thanks to you all!
Back to top
View user's profile Send private message 
belham2

Joined: 15 Aug 2016
Posts: 1190

PostPosted: Thu 21 Sep 2017, 04:18    Post subject:  

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 Smile

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
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4662
Location: Republic of Novo Zelande

PostPosted: Thu 21 Sep 2017, 05:11    Post subject:  

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!)
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2541
Location: UK

PostPosted: Thu 21 Sep 2017, 05:26    Post subject:  

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..

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Thu 21 Sep 2017, 11:41; edited 1 time in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2541
Location: UK

PostPosted: Thu 21 Sep 2017, 07:26    Post subject:  

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:
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:
git checkout slacko_142


Code:
git checkout slacko_141


Code:
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:
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:
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 Smile

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:
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.

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
battleshooter


Joined: 14 May 2008
Posts: 1342
Location: Australia

PostPosted: Sun 22 Oct 2017, 06:25    Post subject:  

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:
# 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:
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:
   ./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:
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 Laughing

_________________
LMMS 1.0.2, Ardour 3.5.389, Kdenlive 0.9.8
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 5 of 5 [75 Posts]   Goto page: Previous 1, 2, 3, 4, 5
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Compiling
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1215s ][ Queries: 14 (0.0151s) ][ GZIP on ]