I need to learn some new skills. Can anyone recommend a good tutorial or resources to get started?
Learning how to compile from source
Moderator: Forum moderators
Re: Learning how to compile from source
If you just want to compile packages that someone else built then have a look at the slackbuild scripts they have a very high success rate for me.
Click here to get the SlackBuild and source code.
Download the slackbuild file to a partition with lots of space: emelfm2.tar.gz
Now click on the slackbuild file. It will create a directory called emelfm2. Enter the directory. Once in the directory you will see five files. If you have been using Rox, and I expect you would, press the ~ key, just under the Esc key. This will open a terminal in the same directory.
Download and copy the source code into the same directory. There should now be six files in the directory.
In the terminal type the following: ./emelfm2.SlackBuild then press enter. Now site back and watch the magic.
Notice the dot slash at the beginning and capital S and B in SlackBuild.
http://smokey01.com/newsletters/2017/Fe ... y2017.html
You can install the package output unmodified on fatdog64 (it outputs to the /tmp director). It may also work on other versions of puppylinux and possibly without a conversion tool. Here are some links:
https://slackbuilds.org/howto/
https://www.slackwiki.com/Writing_A_SlackBuild_Script
Re: Learning how to compile from source
s243a wrote: Thu Nov 12, 2020 5:52 amIf you just want to compile packages that someone else built then have a look at the slackbuild scripts they have a very high success rate for me.
Click here to get the SlackBuild and source code.
Download the slackbuild file to a partition with lots of space: emelfm2.tar.gz
Now click on the slackbuild file. It will create a directory called emelfm2. Enter the directory. Once in the directory you will see five files. If you have been using Rox, and I expect you would, press the ~ key, just under the Esc key. This will open a terminal in the same directory.
Download and copy the source code into the same directory. There should now be six files in the directory.
In the terminal type the following: ./emelfm2.SlackBuild then press enter. Now site back and watch the magic.
Notice the dot slash at the beginning and capital S and B in SlackBuild.http://smokey01.com/newsletters/2017/Fe ... y2017.html
You can install the package output unmodified on fatdog64 (it outputs to the /tmp director). It may also work on other versions of puppylinux and possibly without a conversion tool. Here are some links:
https://slackbuilds.org/howto/
https://www.slackwiki.com/Writing_A_SlackBuild_Script
Some more ideas on how to build packages can be found at:
http://distro.ibiblio.org/fatdog/web/fa ... ckage.html
The sandbox idea is quite useful and can work with puppy (but may require some modifications?). Note that most software project have a readme file that tells you how to build your own package.
Going one step further, puppylinux and puppy-like systems have various tools that let you build a whole distro. See post:
http://murga-linux.com/puppy/viewtopic. ... 04#1026804
Jamesbond discusses a few more of these in this post:
Debian has "debuild", RedHat has "rpm", Arch Linux has "PKGBUILD", Slackware has SlackBuilds (for 3rd party packages only), etc. Each of these build systems have their own way to specify the "recipes" - some highly structured like debuild and rpm, some are rather loose like Arch PKGBUILD. You can use them, you don't have to re-invent the wheel. Of course, you can also come with your own if you wish.
...
There are already "distro build system" out there, complete with fully populated recipes for every software under the sun and the moon! There is one called T2-SDE, for example. "buildroot" from busybox can actually build an entire distro's worth of packages by itself, all nicely packaged into tarballs too. Or you can start with debootstrap from Debian and start working your way up - Debian publishes every single one of their recipes, from every version ever released. And wait, they're not the only one. You have openwrt, you have ptx-dist, you have open-embedded, you have gentoo, you have yocto, and many others that I've forgotten. (You can even include android in the list - yes AOSP is a distro build system). Why not just use them?
http://lightofdawn.org/blog/?viewDetailed=00192
I think that both fatdog64 and easyOs are built from source. Fatdog64 uses something called "ISO Builder"
http://murga-linux.com/puppy/viewtopic.php?t=105329
http://distro.ibiblio.org/fatdog/iso/builder/
and has the following source packages:
http://distro.ibiblio.org/fatdog/source/800/
-
- Posts: 1975
- Joined: Tue Jul 14, 2020 11:24 pm
- Has thanked: 172 times
- Been thanked: 372 times
Re: Learning how to compile from source
My progress so far on compiling emelfm2 with what I learned in green for the benefit of anyone following this thread in the future.
Now click on the slackbuild file. It will create a directory called emelfm2.
click, of course meaning to gunzip
Enter the directory. Once in the directory you will see five files. Download and copy the source code into the same directory. There should now be six files in the directory.
No need to decompress the source file, jut put the .tar.bz2 in with the others
In the terminal type the following: ./emelfm2.SlackBuild then press enter. Now site back and watch the magic.
the magic fails at
... snip above
emelfm2-0.9.1/po/app.emelfm2.policy.in
emelfm2-0.9.1/po/pl.po
emelfm2-0.9.1/Makefile.config
./emelfm2.SlackBuild: line 73: make: command not found
oops, forgot to load devx
on to the second try,
... snip above
src/e2_window.h:54:13: warning: inline function ‘e2_window_show_status_message’ declared but never defined
inline void e2_window_show_status_message (const gchar *message
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
installing plugins to prefix '/tmp/SBo/package-emelfm2/usr'
installing emelfm2 to prefix '/tmp/SBo/package-emelfm2/usr'
./emelfm2.SlackBuild: line 113: /sbin/makepkg: No such file or directory
hmm, RTFM. From http://smokey01.com/newsletters/2017/Fe ... 17.html#14
Using Rox navigate to /tmp. If everything went well and you had the Slackware Package Tools installed, you should see a package called /tmp/emelfm2-0.9.1-x86_64-1_SBo.tgz or something similar.
makepkg appears to be part of the Slackware Package Tools?
OK, I don't have an install of slacko. I am actually using the devx from easyOS at the moment. I wonder how I should proceed without a build script? emelfm2, as intriguing as it is, seems to be a dead project.
Here is a small html editor I was looking at https://github.com/Alex-D/Trumbowyg what do I need from the github page besides the src directory?
Re: Learning how to compile from source
williwaw wrote: Sat Nov 14, 2020 8:27 amMy progress so far on compiling emelfm2 with comments in green for the benefit of anyone following this thread in the future.
"Now click on the slackbuild file. It will create a directory called emelfm2." click, of course meaning to gunzip "Enter the directory. Once in the directory you will see five files."
"Download and copy the source code into the same directory. There should now be six files in the directory." No need to decompress the source file, jut put the .tar.bz2 in with the others
"In the terminal type the following: ./emelfm2.SlackBuild then press enter. Now site back and watch the magic."
the magic fails atCode: Select all
... snip above src/e2_window.h:54:13: warning: inline function ‘e2_window_show_status_message’ declared but never defined inline void e2_window_show_status_message (const gchar *message ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ installing plugins to prefix '/tmp/SBo/package-emelfm2/usr' installing emelfm2 to prefix '/tmp/SBo/package-emelfm2/usr' ./emelfm2.SlackBuild: line 113: /sbin/makepkg: No such file or directory #
From http://smokey01.com/newsletters/2017/Fe ... 17.html#14
Using Rox navigate to /tmp. If everything went well and you had the Slackware Package Tools installed, you should see a package called /tmp/emelfm2-0.9.1-x86_64-1_SBo.tgz or something similar.
makepkg appears to be part of the Slackware Package Tools?
OK, I don't have an install of slacko. I am actually using the devx from easyOS at the moment. I wonder how I should proceed without a build script? emelfm2, as intriguing as it is, seems to be a dead project.
Here is a small html editor I was looking at https://github.com/Alex-D/Trumbowyg what do I need from the github page besides the src directory?
makepkg is included with fadog64. If you aren't using fatdog64 you can replace this command with dir2pet. If you are running a newer version of puppy you should have this package already installed. I think it's also included in easyOS.
For now what you can do is comment out this line and manually try dir2pet in the terminal. When you better understand how it works, you can try modifying the script to include dir2pet. I can give you more instructions tomorrow if you are stuck.
Re: Learning how to compile from source
This is a good read for people getting into coding and compiling:
https://easyos.org/dev/coding-for-easyos.html
...although I wrote it for EasyOS, it is applicable to Puppy and the pup-derivatives, though the 'dir2sfs' script in EasyOS is somewhat different.
I think that 'new2dir' has changed a bit in pups of the last few years. Haven't checked woof-CE github, but i recall 01micko writing something about changes in it -- not using the 'installwatch' utility anymore -- that's what I seem to recall anyway. Mine in EasyOS (and EasyPup) is pretty much the same as it was in the pups back in 2013.
Re: Learning how to compile from source
Just reading through that link I posted above. It mentions 'gtkdialog' as very useful for writing GUI apps with shell scripts, then adds:
There are a host of other tools useful for GUIs with shell scripting. Just listing some here, you will have to chase up documentation on each. These are all builtin to Easy, without needing the devx SFS:
Xdialog, xmessage, pupmessage, pupdialog, popup, yaf-splash
But, I was looking at woof-CE on github recently, and saw that 'pupmessage' and 'pupdialog' were removed. Zigbert replaced all the scripts that used them, with calls to "box_*" shell scripts. Yes, I have that in my browser history:
https://github.com/puppylinux-woof-CE/w ... issues/601
...that was 2015, so you will find 'pupmessage' and 'pupdialog' in pups prior to that, and still in Easy.
Another one, 'popup', is a binary executable and only in Easy.
All pups right up to today, should have Xdialog, xmessage, yaf-splash, and probably also 'gxmessage'.
While I am at it, should mention 'yad', binary executable, that's another one for creating GUIs, in Easy and probably most recent pups -- probably but not certain about that.
-
- Posts: 1975
- Joined: Tue Jul 14, 2020 11:24 pm
- Has thanked: 172 times
- Been thanked: 372 times
Re: Learning how to compile from source
s243a wrote: Sat Nov 14, 2020 4:20 amNote that most software project have a readme file that tells you how to build your own package.
Thanks s243a.
I will read a bit further at the https://github.com/Alex-D/Trumbowyg project and see what I can learn. Being able to compile something from git hub is my goal, as many common apps such as emelfm2 are already available as .pets or .debs.
Looking at the slackbuild script, I can see the makepkg was the final step. I have tried dir2pet and dir2sfs with the two directories the script created in /tmp/SBo. Neither dir2pet or dir2sfs reference two directories, and I suspect my failures to create a working .sfs or a.pet may be the result of mixing apples and oranges (slackbuild scripts and easyos/puppy scripts) . It could well be my expectations are too high and success will come with a few more tries, but at this point I am reviewing some of the resources Barry pointed to and will start fresh without the slackbuild script.
Is there any reason the
Source Downloads:
emelfm2-0.9.1.tar.bz2 (ea83b73d76edf1cea5bce00ec630af6f)
from the same slackbuilds site should not work as well as getting the source from the original project?
Re: Learning how to compile from source
williwaw wrote: Sun Nov 15, 2020 12:53 ams243a wrote: Sat Nov 14, 2020 4:20 amNote that most software project have a readme file that tells you how to build your own package.
Thanks s243a.
I will read a bit further at the https://github.com/Alex-D/Trumbowyg project and see what I can learn. Being able to compile something from git hub is my goal, as many common apps such as emelfm2 are already available as .pets or .debs.Looking at the slackbuild script, I can see the makepkg was the final step. I have tried dir2pet and dir2sfs with the two directories the script created in /tmp/SBo. Neither dir2pet or dir2sfs reference two directories, and I suspect my failures to create a working .sfs or a.pet may be the result of mixing apples and oranges (slackbuild scripts and easyos/puppy scripts) . It could well be my expectations are too high and success will come with a few more tries, but at this point I am reviewing some of the resources Barry pointed to and will start fresh without the slackbuild script.
I think for the last 7 lines of emelfm2.SlackBuild should look like this.
Code: Select all
PKG_OLD="$PKG"
PKG_Fname="$PRGNAM-$VERSION-BUILD-$ARCH"
PKG="$(r$TMP/$PKG_Fname})"
mv "$PKG_OLD" "$PKG"
cd "$PKG"/..
#/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
dir2pet -s -p=$PKG -w="File Manager" -c="Filesystem"
[code]
I'll give it a try.
-
- Posts: 1975
- Joined: Tue Jul 14, 2020 11:24 pm
- Has thanked: 172 times
- Been thanked: 372 times
Re: Learning how to compile from source
s243a,
not sure I am making the substitution correctly.
The screenshot shows the tail of my emelfm2.slackbuild.
I can see where my line 113 needs to be replaced by your
Code: Select all
#/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
dir2pet -s -p=$PKG -w="File Manager" -c="Filesystem"
Does my line 112 needs to be replaced by your
Code: Select all
cd "$PKG"/..
I'm not clear on where these lines go.
Code: Select all
PKG_OLD="$PKG"
PKG_Fname="$PRGNAM-$VERSION-BUILD-$ARCH"
PKG="$(r$TMP/$PKG_Fname})"
mv "$PKG_OLD" "$PKG"
inserted at my line 111? not substituting for any thing above my line 111?
thanks
- Attachments
-
- capture21460.png (172.82 KiB) Viewed 3021 times
Re: Learning how to compile from source
williwaw wrote: Sun Nov 15, 2020 5:11 ams243a,
not sure I am making the substitution correctly.
The screenshot shows the tail of my emelfm2.slackbuild.
I can see where my line 113 needs to be replaced by yourCode: Select all
#/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} dir2pet -s -p=$PKG -w="File Manager" -c="Filesystem"
Does my line 112 needs to be replaced by your
Code: Select all
cd "$PKG"/..
normally when I run dir2pet, I'm one directory above the package directory. However, nomrally, I just give the file name rather than the whole path. I'm not sure if it works with the whole path. So yes, I recommend replacing the cd statement with mine above. And if you do this then you don't need to specify the whole path, you just need to specify the directory name. So instead of:
Code: Select all
dir2pet -s -p=$PKG -w="File Manager" -c="Filesystem"
it is probably better to type:
Code: Select all
dir2pet -s -p=$PKG_Fname -w="File Manager" -c="Filesystem"
*I replaced $PKG with $PKG_Fname
So let's try the following
Code: Select all
PKG_OLD="$PKG"
PKG_Fname="$PRGNAM-$VERSION-$ARCH"
PKG=$TMP/$PKG_Fname
mv $PKG_OLD $PKG
cd $PKG/..
dir2pet -s -p=$PKG_Fname -w="File Manager" -c="Filesystem"
in place of:
Code: Select all
cd "$PKG"/..
#/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
Please give me the console output so we can troubleshoot errors. Also note, that you can test the dir2pet folder in the /tmp directory where the package is built. This is an alternative to putting it at the end of your script.
Re: Learning how to compile from source
put on line 111 the command:
Code: Select all
set -x
This will print out the code as it's being executed. It will help with debugging.
Also type in a terminal:
Code: Select all
dir2pet --help
It's possible that there may be some differences in the version of dir2pet that is on easy OS vs what is dpup buster CE.
In lieu of fixing the script, we can do the following on a terminal:
Code: Select all
cd /tmp/SBo
mv package-eme1fm2 eme1fm2-0.9.1-x86_64
dir2pet eme1fm2-0.9.1-x86_64
this assumes that the slackbuild script properly built the package and all we are trying to get correct is to put it into the .pet format. I'm also assuming that your system is x86_64 rather than say i486 or arm.
-
- Posts: 1975
- Joined: Tue Jul 14, 2020 11:24 pm
- Has thanked: 172 times
- Been thanked: 372 times
Re: Learning how to compile from source
dir2sfs failed, but the renaming in /tmp/SBo completed
ran dir2sfs in /tmp/SBo, took the defaults and
EasyOs dir2fs attached for reference . It's cool being able to utilize slack build scripts. I see a similar thread nearby
- Attachments
-
- easyOs_dir2pet.txt
- (16 KiB) Downloaded 88 times
Re: Learning how to compile from source
It looks like version of dir2pet in easyOS doesn't have as many options. So instead of:
Code: Select all
dir2pet -s -p=$PKG_Fname -w="File Manager" -c="Filesystem"
you can do the following:
Code: Select all
dir2pet $PKG_Fname
ran dir2sfs in /tmp/SBo, took the defaults and
capture30682.png
EasyOs dir2fs attached for reference . It's cool being able to utilize slack build scripts. I see a similar thread nearby
I'm glad it worked for you . BTW, if you want you could try the puppy version of dir2pet
/usr/bin/dir2pet
but I would consider naming it something else (e.g. puppy_dir2pet) and if you want to try it you call it by the name puppy_dir2pet in your script. You can download it by clicking on the raw link on github:
raw.githubusercontent.com.../usr/bin/dir2pet
*don't forget to put in somewhere in $PATH, and make the script executable
It's also a good idea to check with Barry to see if this is a good idea. I"m not sure if there arny differences in package format between puppy and easyOS. The advantage of the puppy script though is that you can specify all the options on the command line rather than having to go through the GUI.
-
- Posts: 1975
- Joined: Tue Jul 14, 2020 11:24 pm
- Has thanked: 172 times
- Been thanked: 372 times
Re: Learning how to compile from source
It looks like version of dir2pet in easyOS doesn't have as many options. So instead of:
Code: Select all
dir2pet -s -p=$PKG_Fname -w="File Manager" -c="Filesystem"
you can do the following:
Code: Select all
dir2pet $PKG_Fname
That fixed it. The slackbuild script dropped right into Barrys gui version of dir2pet and created a working .pet
BTW, if you want you could try the puppy version of dir2pet...It's also a good idea to check with Barry to see if this is a good idea.
It may well work just fine, but being on the low end of the learning curve gives me enough gotchas. I may ask a few questions over at the EasyOs forum though. Barry's new Dunfell looks interesting, but I don't see a devx.sfs
I appreciate your patience and expertise in getting dir2pet working with the slackbuild script.
Re: Learning how to compile from source
s243a wrote: Sun Nov 15, 2020 4:52 pmIt looks like version of dir2pet in easyOS doesn't have as many options. So instead of:
Code: Select all
dir2pet -s -p=$PKG_Fname -w="File Manager" -c="Filesystem"
you can do the following:
Code: Select all
dir2pet $PKG_Fname
ran dir2sfs in /tmp/SBo, took the defaults and
capture30682.png
EasyOs dir2fs attached for reference . It's cool being able to utilize slack build scripts. I see a similar thread nearbyI'm glad it worked for you . BTW, if you want you could try the puppy version of dir2pet
/usr/bin/dir2petbut I would consider naming it something else (e.g. puppy_dir2pet) and if you want to try it you call it by the name puppy_dir2pet in your script. You can download it by clicking on the raw link on github:
raw.githubusercontent.com.../usr/bin/dir2pet
*don't forget to put in somewhere in $PATH, and make the script executableIt's also a good idea to check with Barry to see if this is a good idea. I"m not sure if there arny differences in package format between puppy and easyOS. The advantage of the puppy script though is that you can specify all the options on the command line rather than having to go through the GUI.
The dir2pet in EasyOS is almost the same as in pups 2013 and earlier. Mine only uses gzip compression, whereas the woof-ce one offers a choice of gzip or xz. But as far as I know, my dir2pet will generate a .pet that is compatible with all modern pups.
Yes, that's right, with mine you have to go through the GUI, as there are no commandline options.
Re: Learning how to compile from source
williwaw wrote: Mon Nov 16, 2020 2:43 amIt looks like version of dir2pet in easyOS doesn't have as many options. So instead of:
Code: Select all
dir2pet -s -p=$PKG_Fname -w="File Manager" -c="Filesystem"
you can do the following:
Code: Select all
dir2pet $PKG_Fname
That fixed it. The slackbuild script dropped right into Barrys gui version of dir2pet and created a working .pet
BTW, if you want you could try the puppy version of dir2pet...It's also a good idea to check with Barry to see if this is a good idea.
It may well work just fine, but being on the low end of the learning curve gives me enough gotchas. I may ask a few questions over at the EasyOs forum though. Barry's new Dunfell looks interesting, but I don't see a devx.sfs
I appreciate your patience and expertise in getting dir2pet working with the slackbuild script.
As an alternative to the dir2pet options shown above, One can first write the pet specs and then use the following options:
Code: Select all
-k keep pet.specs / do not overwrite it
-x use xz (high) compressio
-s skip all questions - for package build scripts
and while I don't believe that easyOS has these options the idea of writing the pet specs first could likely be used in easyOS. Also as an added benefit the method of first writing the pet specs allows One to use "_" to separate the package and version rather than "-". I would rather use "_" to separate the version info in the file name because some packages have a dash (i.e. "-") as part of the package name.
Here is an example:
Code: Select all
echo "${PRGNAM}-${VERSION}|${PRGNAM}|${VERSION}|${BUILD#-}|Utility|6132K||${PRGNAM}_${VERSION}${BUILD}_${ARCH}.pet||Keyboard and mouse sharing solution|ubuntu|focal||" > "$PKG/pet.specs"
dir2pet -k -x -s "${PRGNAM}_${VERSION}${BUILD}_${ARCH}"
see post.