Skip to content

Commit 30d511a

Browse files
committed
juanito: initial commit
1 parent 6c2fc29 commit 30d511a

13 files changed

Lines changed: 7691 additions & 0 deletions

File tree

Compilefluff

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
#!/bin/sh
2+
3+
alias cp='busybox cp -a'
4+
alias cut='busybox cut'
5+
alias date='busybox date'
6+
alias du='busybox du'
7+
alias mkdir='busybox mkdir -p'
8+
alias rm='busybox rm -rf'
9+
alias sed='busybox sed'
10+
alias tar='busybox tar'
11+
12+
PROGRAM="fluff"
13+
14+
STARTDIR="$PWD"
15+
PACKAGEDIR="$STARTDIR/package"
16+
PREFIX="/usr/local"
17+
DESTDIR="$PACKAGEDIR/$PREFIX"
18+
SRCDIR="src"
19+
20+
OPTIMIZE="-Os -flto"
21+
SYMBOLS="-g"
22+
23+
TOOLCHAIN="compiletc sstrip submitqc"
24+
BUILD_DEPS="fltk-1.3-dev"
25+
PACKAGE_DEPS="fltk-1.3"
26+
27+
GDEBUG="No"
28+
# Uncomment the next line to compile a version that can be run under gdb.
29+
#GDEBUG="Debug"
30+
31+
if [ "$GDEBUG" == "Debug" ]
32+
then
33+
# -flto gets removed because it interferes with gdb being able to display
34+
# code listings.
35+
OPTIMIZE="-O0 -ggdb"
36+
fi
37+
38+
39+
PROCESSOR_TYPE=`uname -m`
40+
echo "$PROCESSOR_TYPE detected."
41+
42+
case "$PROCESSOR_TYPE" in
43+
i686)
44+
CFLAGS="-fuse-linker-plugin -march=i486 -mtune=i686 $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-plt"
45+
CXXFLAGS="-fuse-linker-plugin -march=i486 -mtune=i686 $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
46+
LDFLAGS="-Wl,-T/usr/local/lib/ldscripts/elf_i386.xbn"
47+
;;
48+
49+
x86_64)
50+
CFLAGS="-fuse-linker-plugin -mtune=generic $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-plt"
51+
CXXFLAGS="-fuse-linker-plugin -mtune=generic $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
52+
LDFLAGS="-Wl,-T/usr/local/lib/ldscripts/elf_x86_64.xbn"
53+
;;
54+
55+
armv*)
56+
CFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra"
57+
CXXFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
58+
LDFLAGS="-Wl,-O1"
59+
;;
60+
61+
aarch64)
62+
CFLAGS="-march=armv8-a+crc -mtune=cortex-a72 $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra"
63+
CXXFLAGS="-march=armv8-a+crc -mtune=cortex-a72 $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
64+
LDFLAGS="-Wl,-O1"
65+
;;
66+
67+
*)
68+
echo "$PROCESSOR_TYPE: Unknown processor type. Please add an entry for it in this script."
69+
exit
70+
;;
71+
esac
72+
73+
# Download packages required for compiling, filter out success messages.
74+
tce-load -w "$TOOLCHAIN $BUILD_DEPS" 2>&1 | grep -v "already downloaded"
75+
76+
# Install packages required for compiling, filter out success messages.
77+
tce-load -i "$TOOLCHAIN $BUILD_DEPS" 2>&1 | grep -v "already installed"
78+
79+
cd "$STARTDIR/$SRCDIR"
80+
81+
# Build "$PROGRAM"
82+
#gcc -march=i486 -mtune=i686 "$OPTIMIZE" -pipe -Wall -Wextra -c "$PROGRAM".c "$SYMBOLS"
83+
gcc $CXXFLAGS -std=c++03 -Wno-unused-parameter -Wno-missing-field-initializers -c "$PROGRAM".cpp
84+
85+
# Link "$PROGRAM"
86+
#gcc -I. -L. "$PROGRAM".o -o "$PROGRAM" "$SYMBOLS" "$OPTIMIZE" -lX11 -lXfixes -T/usr/local/lib/ldscripts/elf_i386.xbn
87+
gcc $LDFLAGS "$PROGRAM".o -o "$PROGRAM" -L/usr/lib -lfltk -lfltk_images -lfltk_forms -lpng -lstdc++
88+
89+
size "$PROGRAM".o "$PROGRAM"
90+
ls -l "$PROGRAM"
91+
if [ "$GDEBUG" == "No" ]
92+
then
93+
sstrip "$PROGRAM"
94+
fi
95+
ls -l "$PROGRAM"
96+
97+
#exit
98+
99+
cd "$STARTDIR"
100+
101+
# Remove output from previous build.
102+
rm "$PROCESSOR_TYPE"
103+
rm "$PACKAGEDIR"
104+
rm *.tcz*
105+
rm *.gz
106+
rm *.bfe
107+
108+
# Create the destination directories for packaging.
109+
mkdir "$PROCESSOR_TYPE"
110+
mkdir "$DESTDIR/bin"
111+
mkdir "$DESTDIR/share/applications"
112+
mkdir "$DESTDIR/share/doc/$PROGRAM"
113+
mkdir "$DESTDIR/share/pixmaps"
114+
115+
# Copy program files to their final destination.
116+
cp "$STARTDIR/$SRCDIR/$PROGRAM" "$DESTDIR/bin"
117+
cp "$STARTDIR/$SRCDIR/$PROGRAM"_"fc.sh" "$DESTDIR/bin"
118+
cp "$STARTDIR/$SRCDIR/$PROGRAM.desktop" "$DESTDIR/share/applications"
119+
cp "$STARTDIR/$SRCDIR/$PROGRAM"_"help.htm" "$DESTDIR/share/doc/$PROGRAM"
120+
cp "$STARTDIR/$SRCDIR/$PROGRAM.gif" "$DESTDIR/share/doc/$PROGRAM"
121+
cp "$STARTDIR/$SRCDIR/$PROGRAM.png" "$DESTDIR/share/pixmaps"
122+
123+
# Update version number and date in the help file.
124+
DATE=`date '+%b %d, %Y'`
125+
VERSION="`grep "#define APP_VER" $STARTDIR/$SRCDIR/fluff.cpp | cut -d' ' -f3 | tr -d '"'`"
126+
sed -i "s|.*<p>Version.*|<p>Version $VERSION, $DATE</p>|" "$DESTDIR/share/doc/$PROGRAM/$PROGRAM"_"help.htm"
127+
128+
# Create .tcz, .md5,txt, and .list files.
129+
mksquashfs $PACKAGEDIR $PROGRAM.tcz -noappend -quiet -no-progress
130+
md5sum $PROGRAM.tcz > $PROGRAM.tcz.md5.txt
131+
cd "$PACKAGEDIR"
132+
# Find files including their path starting from the current directory,
133+
# cut the leading dot, sort it, and save it to the .list file.
134+
find . -not -type d | cut -c 2- | sort > ../$PROGRAM.tcz.list
135+
cd "$STARTDIR"
136+
137+
# Create dependency file.
138+
for EXT in $PACKAGE_DEPS
139+
do
140+
echo "$EXT".tcz >> "$PROGRAM".tcz.dep
141+
done
142+
143+
# Create .info file
144+
DATE=`date '+%Y/%m/%d'`
145+
SIZE="`du -h $PROGRAM.tcz | cut -f1`"
146+
echo "Title: $PROGRAM.tcz
147+
Description: File Manager
148+
Version: $VERSION
149+
Author: Michael A. Losh
150+
Original-site: http://tinycorelinux.com
151+
Copying-policy: GPLv3
152+
Size: $SIZE
153+
Extension_by: Michael A. Losh
154+
Tags: File Manager fm
155+
Comments: Full Version including icon and
156+
.desktop file, suitable for Tiny Core 3.7 and later.
157+
Fluff is a fast, light utility for files. Fluff uses
158+
the FLTK user interface library, which makes it
159+
especially efficient on TinyCore Linux. The source code
160+
of Fluff is released under the GNU license. This file
161+
manager features a directory tree and file details list;
162+
keyboard, menu, and drag-and-drop file manipulations;
163+
automatic configurable program associations; trashbin with
164+
restore; file renaming; file property editing; and more!
165+
Less than 150 KB installed.
166+
167+
168+
Built with:
169+
CFLAGS=$CFLAGS
170+
CXXFLAGS=$CXXFLAGS
171+
LDFLAGS=$LDFLAGS
172+
173+
Change-log: 2011/05/13 (Initial release as extension)
174+
2010/05/13 1.0.0
175+
2014/03/19 v1.0.7 compiled for corepure64-v5.x (coreplayer2)
176+
2020/01/30 v1.0.7 compiled for tc-11.x and fltk-1.3.5 (gnuser)
177+
2020/02/07 updated 1.0.7 -> 1.0.8 (gnuser)
178+
Current: $DATE $VERSION Reverted previous pointer changes, see fluff.cpp
179+
" > $PROGRAM.tcz.info
180+
181+
# Check the newly created extension files for errors.
182+
submitqc --libs 2>&1 > submitqc.txt
183+
184+
# Create archive of the package.
185+
tar -czf "$PROGRAM".tar.gz "$PROGRAM".tc*
186+
187+
# Create archive of the source package.
188+
tar -czf "$PROGRAM"-source-"$VERSION".tar.gz --exclude "*.o" ../"$PROGRAM"/"$SRCDIR" ../"$PROGRAM"/Compile"$PROGRAM"
189+
190+
# Tar the package archive and build script. Include processor type as part of archive name.
191+
tar -czf "$PROGRAM-$PROCESSOR_TYPE".tar.gz --exclude "$PROGRAM-$PROCESSOR_TYPE*" *.tar.gz
192+
193+
# bcrypt the final file with the password tinycore
194+
yes tinycore | bcrypt "$PROGRAM-$PROCESSOR_TYPE".tar.gz
195+
196+
# Save copies in the $PROCESSOR_TYPE directory in case we want
197+
# to compile for another architecture.
198+
cp "$SRCDIR/$PROGRAM" "$PROCESSOR_TYPE"
199+
cp "$PROGRAM".tc* "$PROCESSOR_TYPE"
200+
cp *.tar.gz* "$PROCESSOR_TYPE"
201+
cp submitqc.txt "$PROCESSOR_TYPE"
202+
203+
204+
echo "Check $PACKAGEDIR/submitqc.txt for any errors."
205+
echo "Send $PROGRAM-$PROCESSOR_TYPE.tar.gz.bfe to: tcesubmit@gmail.com"
206+
echo

src/RemovedFiles/Makefile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#makefile for fltk program
2+
CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti"
3+
PROG=fluff
4+
PROG_CAPS=FileMgr
5+
DESC="File Manager"
6+
#UNCOMMENT THE FIRST LINE FOR Tiny Core 3.x, THE SECOND for Core 4.x
7+
#TCEDIR=`cat /opt/.tce_dir`
8+
TCEDIR="/etc/sysconfig/tcedir"
9+
BASEDIR=`pwd`
10+
11+
all: ${PROG}.cpp
12+
g++ ${CXXFLAGS} `fltk-config --cxxflags` -Wall -c ${PROG}.cpp
13+
g++ `fltk-config --use-images --ldflags` -lfltk_images -lm ${PROG}.o -o ${PROG}
14+
strip ${PROG}
15+
echo `ls -l fluff`
16+
17+
debug: ${PROG}.cpp
18+
# g++ ${CXXFLAGS} `fltk-config --cxxflags` -g -O0 -c ${PROG}.cpp
19+
g++ ${CXXFLAGS} `fltk-config --cxxflags` -g -c ${PROG}.cpp
20+
g++ `fltk-config --use-images --ldflags` -lfltk_images -lm ${PROG}.o -o ${PROG}
21+
22+
clean:
23+
rm *.o ${PROG}
24+
25+
run:
26+
fluff &
27+
28+
oldpackage: ${PROG}
29+
./build-tcz_for_tc_2_10.sh
30+
31+
package: all
32+
./build-tcz.sh ${PROG} ${PROG_CAPS} ${BASEDIR} ${DESC} "FULL"
33+
34+
upgrade_package: ${PROG}
35+
./build-tcz.sh ${PROG} ${PROG_CAPS} ${BASEDIR} ${DESC} "UPGRADE"
36+
37+
38+
tarball:
39+
tar -czf ${PROG}_src.tar.gz fluff.cpp fluff_fc.sh fluff.png fluff_help.htm build-tcz.sh fluff.gif test.sh mkdirs.sh Makefile
40+
41+
unpack:
42+
tar -xzf ${PROG}_src.tar.gz
43+
44+
45+
install: package
46+
if grep ${PROG}.tcz ${TCEDIR}/onboot.lst; \
47+
then echo "Already installed. Use \"make update.\""; \
48+
else echo "${PROG}.tcz" >> ${TCEDIR}/onboot.lst; \
49+
sudo cp ${PROG}.tcz ${TCEDIR}/optional; \
50+
tce-load -ic ${PROG}.tcz; \
51+
fi
52+
53+
54+
update: package
55+
if grep ${PROG}.tcz ${TCEDIR}/onboot.lst; \
56+
then sudo cp ${PROG}.tcz ${TCEDIR}/optional; \
57+
sudo cp ${PROG} /usr/local/bin/; \
58+
sudo cp fluff_fc.sh /usr/local/bin/; \
59+
sudo cp ${PROG}_help.htm /usr/local/share/doc/fluff/; \
60+
sudo cp ${PROG}.gif /usr/local/share/doc/fluff/; \
61+
sudo cp ${PROG}.png /usr/local/share/pixmaps; \
62+
else echo "Not installed yet. Use \"make install.\""; \
63+
fi
64+
65+

src/RemovedFiles/build-tcz.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/sh
2+
# Build .tcz extension package for version 3.x and 4.x of Tinycore
3+
4+
PROG=$1
5+
PROG_CAPS=$2
6+
BASEDIR=$3
7+
DESC=$4
8+
PACKAGE_TYPE="FULL"
9+
PACKAGE_FILE=$PROG".tcz"
10+
11+
if [ $5 = "UPGRADE" ]; then
12+
PACKAGE_TYPE=$5
13+
PACKAGE_FILE=$PROG"_upgrade.tcz"
14+
fi
15+
echo "Package name: " $PACKAGE_FILE
16+
17+
mkdir /tmp/${PROG}
18+
cd /tmp/${PROG}
19+
20+
# Executable
21+
mkdir -p usr/local/bin
22+
cp ${BASEDIR}/${PROG} usr/local/bin/
23+
chmod 755 usr/local/bin/${PROG}
24+
cp ${BASEDIR}/fluff_fc.sh usr/local/bin/
25+
chmod 755 usr/local/bin/fluff_fc.sh
26+
27+
# Help file
28+
mkdir -p usr/local/share/doc/fluff
29+
cp ${BASEDIR}/${PROG}_help.htm usr/local/share/doc/fluff/
30+
cp ${BASEDIR}/${PROG}.gif usr/local/share/doc/fluff/
31+
32+
if [ $PACKAGE_TYPE = "FULL" ]; then
33+
# Icon
34+
mkdir -p usr/local/share/pixmaps
35+
cp ${BASEDIR}/${PROG}.png usr/local/share/pixmaps
36+
37+
# .desktop file for icons on desctop, menu items
38+
DOTDESKTOP=usr/local/share/applications/${PROG}.desktop
39+
mkdir usr/local/share/applications
40+
echo "[Desktop Entry]" > ${DOTDESKTOP}
41+
echo "Encoding=UTF-8" >> ${DOTDESKTOP}
42+
echo "Name=${PROG}" >> ${DOTDESKTOP}
43+
echo "Comment=${DESC}" >> ${DOTDESKTOP}
44+
echo "GenericName=${PROG_CAPS}" >> ${DOTDESKTOP}
45+
echo "Exec=${PROG}" >> ${DOTDESKTOP}
46+
echo "Icon=${PROG}" >> ${DOTDESKTOP}
47+
echo "Terminal=false" >> ${DOTDESKTOP}
48+
echo "StartupNotify=true" >> ${DOTDESKTOP}
49+
echo "Type=Application" >> ${DOTDESKTOP}
50+
echo "Categories=Utility;" >> ${DOTDESKTOP}
51+
echo "X-FullPathIcon=/usr/local/share/pixmaps/${PROG}.png" >> ${DOTDESKTOP}
52+
echo "******************************"
53+
cat ${DOTDESKTOP}
54+
echo "******************************"
55+
fi
56+
57+
cd usr/local
58+
cd /tmp/${PROG}
59+
mksquashfs . ../${PACKAGE_FILE}
60+
61+
#cd $TMPDIR
62+
find usr -not -type d > ../${PACKAGE_FILE}.list
63+
64+
# Create md5 file
65+
cd /tmp
66+
md5sum ${PACKAGE_FILE} > ${PACKAGE_FILE}.md5.txt
67+
68+
cp /tmp/${PACKAGE_FILE}* ${BASEDIR}
69+
rm -rf /tmp/${PROG}
70+
rm -f /tmp/${PACKAGE_FILE}*
71+
72+
echo "Build of .tcz for TC 3.0 and higher is complete."

src/RemovedFiles/compile_fluff

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
# tce-load -i fltk-1.3-dev Xorg-7.7-dev compiletc
4+
5+
# g++ -march=i486 -mtune=i686 -Os -fno-exceptions -fno-rtti -fpic -L/usr/lib -lfltk -lfltk_images -lfltk_forms -lpng -o fluff fluff.cpp
6+
7+
# error: narrowing conversion
8+
# Try adding -std=c++03 to your compiler flags or CFLAGS=-Wno-narrowing make
9+
10+
# g++ -march=i486 -mtune=i686 -O0 -ggdb -std=c++03 -fno-exceptions -fno-rtti -fpic -L/usr/lib -lfltk -lfltk_images -lfltk_forms -lpng -o fluff fluff.cpp
11+
g++ -march=i486 -mtune=i686 -Os -std=c++03 -fno-exceptions -fno-rtti -fpic -L/usr/lib -lfltk -lfltk_images -lfltk_forms -lpng -o fluff fluff.cpp
12+
13+
size fluff.o fluff
14+
ls -l fluff
15+
sstrip fluff
16+
ls -l fluff

0 commit comments

Comments
 (0)