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 Wed 21 Aug 2019, 05:32
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Bacon 101 using only the official *.bac files used here
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
big_bass

Joined: 13 Aug 2007
Posts: 1742

PostPosted: Sat 01 Oct 2011, 00:01    Post subject:  

auto download compile install bacon with the files auto modified
to allow for shared libraries (this sets up everything needed for the examples )


*minor update to save all the old files in /usr/share/BaCon/old-version-saved as a safety
thanks to GatorDog for the kind warning
Code:

#!/bin/bash


# Joe Arose  big_bass 12-14-2010 last update 11-1-2011
# call this  auto-build-compile-bacon2
# auto download compile install
# so you can easily update when needed

# thanks "mechanic" for the speed tip  using bacon instead of bacon.bash for compiling

# thanks seaside for the bash version test

BASHV=$(bash --version | head -1)
VN=$(echo $BASHV | cut -f1 -d. | sed 's/^.*\(.\)$/\1/')
[ $VN -lt 4 ] && Xdialog --title "bash version test " \
           --infobox "\nBash Version Problem $BASHV installed
---------------> Bash must be version 4 or above for BaCon <-------------------" "\n" 0 0





#   =====================================
#    downoad ,compile and install BaCon
#   =====================================


Xdialog --wrap --title "bacon instlaller" \
        --yesno "Do you want to install bacon  " 0 0

case $? in
  0)
    echo "Yes chosen."
 
mkdir -p /usr/share/BaCon/old-version-saved
mkdir -p /usr/share/BaCon/
cd /usr/share/BaCon/

mv  bacon.bash* bacon* hug.bac* hug_imports* bacon.lang* bacon.* *.c *.h *.log /usr/share/BaCon/old-version-saved || true

# bacon.bash
xterm  -geometry 40x30+150+40 -e wget -N http://www.basic-converter.org/stable/bacon.bash
chmod a+x bacon.bash

# bacon.bac
xterm  -geometry 40x30+150+40 -e wget -N http://www.basic-converter.org/stable/bacon.bac
chmod a+x bacon.bac

# fix for bash if you have a different version you compiled
# depends on the replace app
#replace '#!/usr/bin/env bash' '#!/bin/bash'  bacon.bash

# use sed (#!/usr/bin/env bash change to #!/bin/bash)
sed -i 's/\#\!\/usr\/bin\/env bash/\#\!\/bin\/bash/' /usr/share/BaCon/bacon.bash


# much faster with a pre installed bacon ( use this if you have bacon installed )
# to compile a fresh bacon binary with a pre installed bacon
#xterm  -geometry 40x30+150+40 -e bacon bacon.bac

# very slow *without* a pre installed bacon  (default for a safety )
# to compile a fresh bacon binary *without* a pre installed bacon
xterm  -geometry 40x30+150+40 -e '. /usr/share/BaCon/bacon.bash bacon.bac'



# copy bacon bin into the path
cp bacon /usr/sbin


# hug.bac
xterm  -geometry 40x30+150+40 -e wget -N http://www.basic-converter.org/hug.bac


# hug_imports.bac
xterm  -geometry 40x30+150+40 -e wget -N http://www.basic-converter.org/hug_imports.bac

# auto edit the hug_imports.bac  must have the replace command installed
#replace  'CONST HUG_lib$ = "./hug.so"' 'CONST HUG_lib$ = "/usr/lib/libhug.so"' hug_imports.bac

# auto edit the hug_imports.bac
sed -i 's/\.\/hug.so/\/usr\/lib\/libhug.so/' hug_imports.bac



# use the new bacon binary to make the new libhug.so
cp hug.bac libhug.bac
xterm  -geometry 40x30+150+40 -e bacon -f libhug.bac

md5sum libhug.so >md5sum_libhug.txt

# add a md5sum in the sources
MD=$(<md5sum_libhug.txt)
sed -i "2a \'$MD " hug_imports.bac


cp libhug.so /usr/lib

# bacon.lang
xterm  -geometry 40x30+150+40 -e wget -N http://www.basic-converter.org/bacon.lang

Xdialog --title "Complete" \
           --infobox "\nInstalling bacon has finished.\n" 0 0 3000
     #clean up C crap
     rm -f *.c
     rm -f *.h

   ;;
  1)
    echo "No chosen."
    exit
   ;;
  255)
    echo "Box closed."
    exit
   ;;

esac
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0705s ][ Queries: 11 (0.0191s) ][ GZIP on ]