Automated compiling & packaging, using CRUX Linux build scripts

Moderator: Forum moderators

Post Reply
User avatar
sc0ttman
Posts: 93
Joined: Sat Aug 22, 2020 3:55 pm
Has thanked: 4 times
Been thanked: 33 times

Automated compiling & packaging, using CRUX Linux build scripts

Post by sc0ttman »

Hi all,

I made a small script called "crux-build.sh" (attached), that can be used to compile PET packages from CRUX Linux build scripts, called a "Pkgfile"

You get the Pkgfiles from the repos listed at CRUX ports: https://crux.nu/portdb/

(A "ports" system is just another name for a "build packages from source" system..
People offer "ports", which are their build scripts, in their repos..)

USAGE:

1. Download the attachment, extract it to /usr/bin
2. Choose a repo from the list at the CRUX Linux portdb: https://crux.nu/portdb/
3. Choose a package you want to build.. Example: feh
4. Download the Pkgfile and any assets (icons, fonts, patches, etc) to: /usr/local/src/feh/
5. You should have at least: /usr/local/src/feh/Pkgfile
6. Then run this command:

Code: Select all

crux-build.sh feh
It will (hopefully) download the required source code, compile the program, and package it up as a PET file for you.

You should end up with a package like this:

/usr/local/src/feh/feh-3.5-fossapup64-9.5-1-x86_64.pet

You can install it with the PPM (or Pkg).

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

BACKGROUND:

As some of you know, Pkg can compile programs from their source code and package up the results as a PET:

You do it like so:

```
pkg build <pkgname> # compile "pkgname" from source code and package it up as a PET
```

Normally, Pkg uses either Petbuild, Buildpet (outdated), src2pkg or SBoPkg to compile packages from "build scripts".

- Petbuild: made by 01micko, builds PETs from a *.petbuild shell script
- Buildpet: made by iguleder and Tman, builds PETs from a *.bp shell script
- SBoPkg: made by Slackware devs, builds txz packages from Sbopkg shell scripts
- src2pkg: made by amigo (Gilbert Ashley), builds all kinds of packages, from various sources (archives, URLs & build scripts)

Well, CRUX Linux has its own build scripts, too.

- In CRUX world, they call their database/collection of "user contributed" repos the "portdb" system.
- Each user can host their own repo, containing their "ports" (their package build scripts)
- CRUX users can install each others repos and build each others packages

Sooooo...

I made this little standalone script (doesn't need Pkg installed) which can compile and build PET packages from CRUX Linux ports.

It will eventually make its way into Pkg as a function, so Pkg has yet another backend it can use to build packages from source :thumbup2:
Attachments
crux-build.sh.tar.gz
(1.74 KiB) Downloaded 102 times
Last edited by sc0ttman on Sat Oct 31, 2020 1:49 pm, edited 4 times in total.
User avatar
sc0ttman
Posts: 93
Joined: Sat Aug 22, 2020 3:55 pm
Has thanked: 4 times
Been thanked: 33 times

Re: Automated compiling & packaging, using CRUX Linux build scripts

Post by sc0ttman »

Issues and caveats:

- obviously you need all required deps installed to build something
- the deps needed are listed at the top of the Pkgfile files
- some of the Pkgfiles call the "fakeroot" command, and we don't have "fakeroot" installed in Puppy by default
- fakeroot should be findable in the PPM (not tested it, myself)
- by default most Pkgfiles in CRUX disable building NLS stuff (non-english translations, etc)
- the packages built are not "split" into DEV, DOC and NLS (this could be added, for now you can do `pkg split <pkgname>`)
Last edited by sc0ttman on Sat Oct 31, 2020 7:19 pm, edited 1 time in total.
User avatar
sc0ttman
Posts: 93
Joined: Sat Aug 22, 2020 3:55 pm
Has thanked: 4 times
Been thanked: 33 times

Re: Automated compiling & packaging, using CRUX Linux build scripts

Post by sc0ttman »

Any fixes people need to make to the script to make it build stuff, post them here, I'll be happy to add them to the script and update the main post. :thumbup:
User avatar
sc0ttman
Posts: 93
Joined: Sat Aug 22, 2020 3:55 pm
Has thanked: 4 times
Been thanked: 33 times

Re: Automated compiling & packaging, using CRUX Linux build scripts

Post by sc0ttman »

The long term idea:

We can do some fairly small updates to Pkg and Petbuild, so that they can also build from Pkgfiles, if that is what they are given.

Then, we'd be able to more easily add to and compliment the build scripts already available in Petbuild, by finding (and fixing, if needed) working Pkgfiles from the CRUX Linux portdb repos.

This will make it easier the maintainers of Petbuild to maintain bigger list of build scripts - so that people can use them to build these packages, from source, using Woof-CE or Petbuild.

----

Also... With a few more updates to Pkg, it will be easy to write your own Pkgfiles and maintain your own "ports" repo - a repo full of build scripts, (more or less) just like CRUX users (but easier).

The build scripts could be downloaded by others, who then compile the packages for themselves.

If a build script can be made to produce working PET packages on lots of Puppies, then the build script can also be added to the list of build scripts in Petbuild.

This makes these custom packages available in Woof-CE for all future puppy builders, and therefore end-users.

---

The main difference using Pkgfiles over "binary packages" (like .pet, .deb) is

- the contents of a Pkgfile can be copied & pasted straight into a post on this forum - so easy to share

- people only need to copy/write/edit a Pkgfiles and host those online, and others will still be able to rebuild and re-produce the packages someone else has created.

- this save time, complexity, bandwidth, hosting requirements,

- makes it all more "re-producible", script-able...

- and it'll will surely help to improve the choices of packages you can "build from source" when using (or building) Puppy Linux.
User avatar
BarryK
Posts: 2271
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

Re: Automated compiling & packaging, using CRUX Linux build scripts

Post by BarryK »

@sc0ttman
Extremely interesting!

I am up to the eyeballs trying to get bluetooth to work properly on EasyOS right now, but I have bookmarked this thread and will be back!
User avatar
BarryK
Posts: 2271
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

Re: Automated compiling & packaging, using CRUX Linux build scripts

Post by BarryK »

I was thinking that CRUX does not really interest me, as it is only x86_64, however I have discovered that it also supports arm:

https://crux-arm.nu/

...seems that they do both 32-bit and 64-bit arm.

Post Reply

Return to “Compiling”