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 Sat 30 Aug 2014, 18:41
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
pUPnGO - 6Mb ISO - Basic Building Block Puplet
Moderators: Flash, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 44 of 58 Posts_count   Goto page: Previous 1, 2, 3, ..., 42, 43, 44, 45, 46, ..., 56, 57, 58 Next
Author Message
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Wed 23 May 2012, 14:17    Post_subject:  

Need a small CD-player? Attached two different:
* cdtool-2.1.8 which also include tools for getting cddb output.
* dcd-0.99.2 - a more simple player.
Both need the hardware cabling from your CD/dvd-drive to your soundcard/motherboard being present...and remember to un-mute CD in audio mixer and turn up the volume as well...
Both might be handy back ends for a gtkdialog gui-frontend
cdtool-2.1.8-i486.pet
Description  static build CLI CD-player + other CD-utilities
pet

 Download 
Filename  cdtool-2.1.8-i486.pet 
Filesize  68.82 KB 
Downloaded  257 Time(s) 
dcd-0.99.2-i486.pet
Description  static build CLI CD-player
pet

 Download 
Filename  dcd-0.99.2-i486.pet 
Filesize  19.2 KB 
Downloaded  247 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Fri 01 Jun 2012, 15:37    Post_subject:  

After making the gtkman for gktdialog1 I tried to run it in pupngo. But found that although man-bin is static build it wont work. Turns out that man depends on at least tbl and nroff which in turn depends on different auxiliary macro-files.
All that just to view a man page that is "readable" by command "cat"...
tbl is quite easy to build static but nroff did not turn out easy. They belong to GNU groff-package which I did not manage to do a normal build of. Another source is The Heirloom Documentation Tools - all c-code and state that build with diet libc can be done. I tried diet but my version is 0.31 and I think it needs at least version 0.32 of diet libc (needs wctomb). But I managed to hack my way to a final static build of tbl and nroff - just to realize that although working they seems not to work well with man-expectations - some demand of -mandoc that I was not able to fullfill.
Btw. busybox man also needs tbl and nroff/troff/groff (it needs gtbl which is a symlink to tbl).
Another solution here. awf is a man-page formatter based on awk-macros and it does a decent job!
A third solution is to use the man2html - which is a standalone app with no need for auxiliary progs - and then use sed to remove the HTML-tags. man2html is part of the original man page.
The forth solution is to use sed on the raw man-page as well (guess awk would work too).
So ended up with a draft for gtkman version 0.2 where at least the sed-only and the man2html method gives reasonable output in pupngo - but with a lot of room for improvement...Maybe a project target for some sed -or awk-sharks?
The present draft code below:
Code:
#!/bin/ash
#simple demo for gtkdialog1 to view text formated man pages
#May 2012 goingnuts
#v0.1 needs original man - will not work with busybox man
#v0.2 liberate it from the man bin/use other ways...
#depending on the system one of the below will be used:
VIEW_ME=4   #simple sed - improve it please!

[ $(which awf) ] && VIEW_ME=3   #view http://awk.info/?tools/awf

[ $(which man2html) ] && VIEW_ME=2   #part of org man pkg

[ $(which man) ] && [ $(which tbl) ] && [ $(which nroff) ] && VIEW_ME=1 #for systems with all it takes for man to work

echo "Using methode $VIEW_ME" #just to know what is going on...

#hardcode mandirs...
MANDIRS="/usr/share/man /usr/man /usr/local/man"

echo > /tmp/gtkman

#create list of man-files present in system
COMBOLIST="<item>Select page to view</item>"
#v0.2
mandirs=$(find ${MANDIRS} -type f)

for file in $mandirs; do
   name=$(basename ${file})
   name=$(echo ${name%.*})   #for .gz
   name=$(echo ${name%.*})   #for .1
   COMBOLIST="$COMBOLIST<item>$name</item>"
done

#ash function file
echo '
view_me1 () {
   man -P cat ${1} 2> /dev/null | sed "s/.`echo -e\\\b`//g" | sed "s/.^H//g" | sed "s/.\x08//g" > /tmp/gtkman
}

macro_2 () {
   sed -e "s/<[^>]*>//g" | \
   sed -e "s/\&lt;/</g" | \
   sed -e "s/\&nbsp;/ /g" | \
   sed -e "s/\&gt;/>/g" | \
   sed "/^$/d"
}

view_me2 () {
   if [ ! $1 = "Select" ]; then
      manfile2view=$(find /usr -name ${1}.1*)
      if [ $(echo ${manfile2view##*.}) = "gz" ]; then
         zcat $manfile2view | man2html | grep -v "Content-type: text/html" | macro_2 > /tmp/gtkman
      else
         man2html $manfile2view | grep -v "Content-type: text/html" | macro_2 > /tmp/gtkman
      fi
   fi
}

view_me3 () {
   if [ ! $1 = "Select" ]; then
      manfile2view=$(find /usr -name ${1}.1*)
      if [ $(echo ${manfile2view##*.}) = "gz" ]; then
         zcat $manfile2view | awf -man | sed "s/.`echo -e\\\b`//g" | sed "s/.^H//g" | sed "s/.\x08//g" > /tmp/gtkman
      else
         awf -man $manfile2view | sed "s/.`echo -e\\\b`//g" | sed "s/.^H//g" | sed "s/.\x08//g" > /tmp/gtkman
      fi
   fi
}

macro_4 () {
   sed "s/.B //g" | \
   sed "s/.I //g" | \
   sed "s/.TP//g" | \
   sed "s/.PP//g" | \
   sed "s/.LP//g" | \
   sed "s/.TH //g" | \
   sed "s/.SH //g" | \
   sed "s/.BR //g" | \
   sed "s/.RI //g" | \
   sed "s/.BI //g" | \
   sed "s/.RI \[\\\| \\\//g" | \
   sed "s/.I \\\//g" | \
   sed "s/.br/\n/g" | \
   sed "s/fI//g"   
}


view_me4 () {
   if [ ! $1 = "Select" ]; then
      manfile2view=$(find /usr -name ${1}.1*)
      if [ $(echo ${manfile2view##*.}) = "gz" ]; then
         zcat $manfile2view | macro_4 > /tmp/gtkman
      else
         cat $manfile2view | macro_4 > /tmp/gtkman
      fi
   fi
}

' > /tmp/ashfunc

export MAIN_DIALOG='
<wtitle>gtkman</wtitle>
<vbox>
   <hbox>
      <button>
         <label>Quit</label>
         <input file>exit.png</input>
      </button>
   </hbox>
   <combobox>
      <variable>MAN_LIST</variable>
      '${COMBOLIST}'
      <action>view_me'${VIEW_ME}' ${MAN_LIST}</action> 
      <action>clear:EDIT</action>
      <action>refresh:EDIT</action>
   </combobox>
   <frame manpage view>
      <edit>
         <width>500</width>
         <height>300</height>
         <input file>/tmp/gtkman</input>
         <variable>EDIT</variable>
      </edit>
   </frame>
</vbox>
'

gtkdialog1 --center --wmclass gtkman --program=MAIN_DIALOG -i /tmp/ashfunc

#clean up
rm -f /tmp/gtkman
rm -f /tmp/ashfunc
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4347

PostPosted: Fri 01 Jun 2012, 16:43    Post_subject:  

Nice, we have needed a decent manpage viewer for a while.

As per our previous discussion on reducing xpm images I finally got around to patching mtpaint to support saving xpm images with 92 colors per character vs 64. It makes for a bit nicer looking reduced images, and also bumps support for over 8000 colors vs. ~4000.

the patch is here:
http://www.murga-linux.com/puppy/viewtopic.php?p=631164#631164

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
PANZERKOPF

Joined: 16 Dec 2009
Posts: 280
Location: Earth

PostPosted: Sat 02 Jun 2012, 12:57    Post_subject:  

Another small tools for mentioned above purposes:
Rman - standalone man page converter (converts man to html or plain text)
asm-toys - multicall tool, includes simple cdplayer
asmutils - coreutils,util-linux, netutils, shell and some other tools including cda2raw
asmutils-0.18src.tar.gz
Description 
gz

 Download 
Filename  asmutils-0.18src.tar.gz 
Filesize  352.69 KB 
Downloaded  249 Time(s) 
asm-toys-0.2.1.tar.gz
Description 
gz

 Download 
Filename  asm-toys-0.2.1.tar.gz 
Filesize  80.17 KB 
Downloaded  249 Time(s) 
rman_3.2.tar.gz
Description 
gz

 Download 
Filename  rman_3.2.tar.gz 
Filesize  77.54 KB 
Downloaded  243 Time(s) 

_________________
SUUM CUIQUE.
Back to top
View user's profile Send_private_message 
Ibidem

Joined: 25 May 2010
Posts: 484
Location: State of Jefferson

PostPosted: Sun 03 Jun 2012, 20:19    Post_subject:  

Busybox had an nroff patch once which I dug up and updated...
I'll have to see if I can find it again Rolling Eyes
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4347

PostPosted: Mon 04 Jun 2012, 16:25    Post_subject:  

I've been working with musl ind tinyx11 to see what I could build. It looks pretty promising so far. These are the uncompressed sizes:

jwm579 with xpm,png & jpg -448kb (earlier versions may be smaller?)
(Edit: jwm is only 274kb without png/jpg - only xpm)
desklaunch-104kb
rxvt-157kb
meh-270kb
9menu-94kb
mupdf-1182kb
wmix-138kb
calctool-124kb
pupslock-127kb

how does that compare with the uclibc toolchain?

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Tue 05 Jun 2012, 04:48    Post_subject:  

PANZERKOPF: Thank you - that are some nice findings! The cdplayer from asm-toys compile to less than 5k and have all functions to control and report status Very Happy Wish assembler was easier to learn...as most assembler progs for linux I have seen are a factor 5-10 smaller than the normal...some examples
technosaurus: I havent tried newer jwm (tried 562 but could not compile it) so below jwm is the usual patched jwm-2.0.1-pe-beta-1:
Code:
-rwxr-xr-x  1 root root  101596 2012-06-05 10:36 9menu*
-rwxr-xr-x  1 root root  140052 2012-06-05 10:36 calctool*
-rwxr-xr-x  1 root root  126960 2012-06-05 10:36 desklaunch*
-rwxr-xr-x  1 root root  437644 2012-06-05 10:36 jwm*
-rwxr-xr-x  1 root root  261600 2012-06-05 10:36 meh*
-rwxr-xr-x  1 root root  136688 2012-06-05 10:36 pupslock*
-rwxr-xr-x  1 root root  187532 2012-06-05 10:36 rxvt*
-rwxr-xr-x  1 root root  180808 2012-06-05 10:36 wmix*


so your builds looks very promising! The size might depend on how much your tinyX is modified - above is build with a tinyX that I also use to build the gtk-apps with.

From amigos repo a file manager with drag&drop: uxplor.
It also work with older kernels where ROX and emelfm tends to fail.
snap0003.png
 Description   
 Filesize   26.86 KB
 Viewed   863 Time(s)

snap0003.png

uxplor.gz
Description  static build + upx. fake .gz-file rename to uxplor
gz

 Download 
Filename  uxplor.gz 
Filesize  329.97 KB 
Downloaded  250 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
Ibidem

Joined: 25 May 2010
Posts: 484
Location: State of Jefferson

PostPosted: Tue 05 Jun 2012, 21:38    Post_subject:  

I've dug up the nroff patch. Not bothering to attach the original, since it's hopelessly ancient...

And yes, it does have bad formatting.
bb-nro.bz2
Description  Busybox nroff patch updated for Busybox 1.18.4 (not tested with 1.2x)--BAD FORMATTING!
bz2

 Download 
Filename  bb-nro.bz2 
Filesize  1.19 KB 
Downloaded  246 Time(s) 
Back to top
View user's profile Send_private_message 
PANZERKOPF

Joined: 16 Dec 2009
Posts: 280
Location: Earth

PostPosted: Thu 07 Jun 2012, 11:44    Post_subject:  

goingnuts wrote:
PANZERKOPFas most assembler progs for linux I have seen are a factor 5-10 smaller than the normal

Not only for linux. Assembler progs are always faster and smaller than same written in other language but have one big disadvantage: they are not portable.
Also, If you like assembler, play with KolibriOS. Really cool Smile

_________________
SUUM CUIQUE.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4347

PostPosted: Thu 07 Jun 2012, 23:21    Post_subject:  

PANZERKOPF wrote:
Assembler progs are always faster and smaller than same written in other language.
assuming the coders are equally competent ...

So, I have been doing static compiles with my musl toolchain and I have gotten to some stuff that uses gdk-pixbuf-1.0.
@goingnuts - How did you grok the static compile of gtkdialog1 so that the gdkpixbuf stuff worked?

Edit: nevermind the configure script improperly set:
#define USE_GMODULE 1
... commented it out and works fine

Edited_time_total
Back to top
View user's profile Send_private_message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Fri 08 Jun 2012, 00:44    Post_subject:  

Ibidem: Thanks for the patch - I try it out.
PANZERKOPF: Yea - its quite impressive - this Kolebri!
technosaurus; Ok - glad you made it! Have you plans to post your tool-chain/build-script/sources at some time?
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4347

PostPosted: Fri 08 Jun 2012, 04:33    Post_subject:  

doing a static toolchain, you find a lot of bugs that go unseen otherwise... I am just trying to narrow down the issues to the appropriate place - usually it is autoconf
for gdk-pixbuf --disable-modules _should_ undef, not #define USE_GMODULE 1
(removed support for libtiff while I was at it - its just larger than it is useful)
I am trying to set up things as much as possible to allow people to use the toolchain without having to learn the intricacies of gcc ( I'm adding appropriate flags in a wrapper script - the included one has a couple of issues that require constant patching of makefiles ... sometimes libtool or autotools ignore CC=musl-gcc and CPP="musl-gcc -E" amongst other things and I figured I may as well hard code in all of the safe optimizations and necessary defines while I was at it)

I have also patched tinyX11 to some extent, but if you have your patched sources still, it would help (right now I have threads and NLS disabled and minimal utf8 in order to build - it seems that the sources from xfree86-4.8 work fine - just a lot of cut and paste)

I also got a cutdown freetype, openjpeg, jpeg, jbig2dec and z libs from mupdf (they have a nice build script for them) ... only read support so it worked well with gdkpixbuf and failed on mtpaint (so i built with only xpm and png) anyhow gtkdialog1 is working with jpeg support now.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Fri 08 Jun 2012, 12:25    Post_subject:  

Sound really cool! I still have some gtk-apps that build fine dynamic and static but wont run in the static version (gtksee-0.6.0b-1) or run and fail at some point (chbg-1.4) that would be nice to have...
PM-ed link for dl of my current sources.
Back to top
View user's profile Send_private_message Visit_website 
Ibidem

Joined: 25 May 2010
Posts: 484
Location: State of Jefferson

PostPosted: Sat 09 Jun 2012, 01:37    Post_subject:  

technosaurus wrote:
doing a static toolchain, you find a lot of bugs that go unseen otherwise... I am just trying to narrow down the issues to the appropriate place - usually it is autoconf
for gdk-pixbuf --disable-modules _should_ undef, not #define USE_GMODULE 1
(removed support for libtiff while I was at it - its just larger than it is useful)
I am trying to set up things as much as possible to allow people to use the toolchain without having to learn the intricacies of gcc ( I'm adding appropriate flags in a wrapper script - the included one has a couple of issues that require constant patching of makefiles ... sometimes libtool or autotools ignore CC=musl-gcc and CPP="musl-gcc -E" amongst other things and I figured I may as well hard code in all of the safe optimizations and necessary defines while I was at it)

I have also patched tinyX11 to some extent, but if you have your patched sources still, it would help (right now I have threads and NLS disabled and minimal utf8 in order to build - it seems that the sources from xfree86-4.8 work fine

If apps are trying g++, that's because they look for a C++ compiler.
The quickest stop to that business is CXX=false CC=musl-gcc ./configure
(and by the way, would CFLAGS=-UUSE_GMODULE help for gdk-pixbuf?)
Threads should be safe with musl--unless you use a kernel that needs linuxthreads (Linux 2.4.x)
Also, musl supports utf8 natively. This can enlarge binaries a little, but not much.
Also, what sort of issues are you having? musl-gcc currently (0.9.x) only changes the spec file for gcc, so it should be 99% compatible.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4347

PostPosted: Sat 09 Jun 2012, 11:22    Post_subject:  

Ibidem wrote:
If apps are trying g++, that's because they look for a C++ compiler.
The quickest stop to that business is CXX=false CC=musl-gcc ./configure
(and by the way, would CFLAGS=-UUSE_GMODULE help for gdk-pixbuf?)
Threads should be safe with musl--unless you use a kernel that needs linuxthreads (Linux 2.4.x)
Also, musl supports utf8 natively. This can enlarge binaries a little, but not much.
Also, what sort of issues are you having? musl-gcc currently (0.9.x) only changes the spec file for gcc, so it should be 99% compatible.
CPP is the preprocessor (the thing that handles all of the macros/includes/etc...) - in a gcc tool chain usually this is just gcc -E, but in order to force it to look in my musl toolchain and not the standard directories I tell it to use my make shift wrapper built on the musl wrapper (just a script named gcc that calls gcc-real with appropriate defines and flags, yes I renamed gcc and called the wrapper gcc to save a helluvalotta editing) that prevents most of these broken scripts from doing the wrong thing. The issues aren't necessarily with musl, but I am having to add a few includes here and there or add -D_GNU_SOURCE or similar, but I am just going to add those to my wrapper script and maybe every once in a while add a symlink for a missing include like io.h (but most are kernel headers that just got missed or were overwritten by glibc)

After I have done a run through all of the useful C libraries on this toolchain without threads and locales, I will do a try with a native toolchain and try them out. (I just wanted to minimize my patching on the first run - its less overwhelming that way)

*question???
What is the best way to get a disk image onto a really low resource computer using minimal ram/cpu, but also not really long or complicated. I was thinking of piping an xz compressed tarball of a filesystem image through dd. However I am hesitant to do it that way due to the possibility of broken pipes (the plumbing is not always in good in these old beasts)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 44 of 58 Posts_count   Goto page: Previous 1, 2, 3, ..., 42, 43, 44, 45, 46, ..., 56, 57, 58 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1349s ][ Queries: 13 (0.0175s) ][ GZIP on ]