#!/bin/sh
# test we are root
if [ "$(id -u)" != "0" ]; then
echo "run as root now exitting"
exit 1
fi
export CFLAGS="-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe"
export CXXFLAGS="-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -fno-exceptions -fno-rtti"
P=jwm
V=2.4.3
SRC=$P-$V
SRC2=squashfs-root/usr/local
USER=`cat /etc/sysconfig/tcuser`
LIST="compiletc submitqc libjpeg-turbo-dev libXinerama-dev libXpm-dev \
libtool gettext-dev libXrender-dev libpng-dev libXft-dev "
for Z in $LIST
do
su -c "tce-load -i $Z" $USER
done
# list may have more than loaded
cd /usr/local/lib
rm -rf *.la
rm -rf gcc/aarch64-unknown-linux-gnu/12.2.0/plugin/*.la
rm -rf gcc/aarch64-unknown-linux-gnu/12.2.0/*.la
rm -rf gprofng/*.la
rm -rf python3.8/site-packages/*.la
rm -rf pkcs11/*.la
rm -rf cairo/*.la
rm -rf gtk-2.0/modules/*.la
rm -rf gtk-2.0/2.10.0/printbackends/*.la
rm -rf gtk-2.0/2.10.0/immodules/*.la
rm -rf gtk-2.0/2.10.0/engines/*.la
rm -rf imlib2/loaders/*.la
rm -rf imlib2/filters/*.la
rm -rf gdk-pixbuf-2.0/2.10.0/loaders/*.la
cd /tmp
rm -rf /usr/lib/*.la
# failed to use URL=http://tinycorelinux.net/12.x/aarch64/tcz/src/jwm/jwm-files with some files
su -c "/usr/local/bin/wget -nc --no-check-certificate \
https://github.com/joewing/$P/releases/download/v$V/$SRC.tar.xz \
http://tinycorelinux.net/12.x/aarch64/tcz/jwm.tcz " $USER
unsquashfs $P.tcz
rm -rf $P.tcz
# due to a glitch where if I attempt to delete jwm_ondemand it deletes entire bin dir we try
mv squashfs-root/usr/local/bin squashfs-root/usr/local/z
rm -rf $SRC2/z/jwm
mv squashfs-root/usr/local/z/jwm_ondemand squashfs-root/usr/local/
# now we are good for below to work $ jwm -p showed an error for ondemand so not installed
tar xvf $SRC*xz
cd $SRC
# not used pango has an issue according to web search CFLAGS="-I/usr/local/include/pango-1.0"
./configure --prefix=/usr/local --disable-pango --disable-rsvg --disable-shape --disable-xmu \
CFLAGS="-I/usr/local/include/freetype2"
# Confirm: yes
# Icon: yes
# Cairo: no
# RSVG: no
# PNG: yes
# JPEG: yes
# XBM: yes
# XPM: yes
# XFT: yes
# XRender: yes
# Pango: no
# Shape: no
# Xmu: no
# Xinerama: yes
# Debug: no
make -j5 # about 8s
make install DESTDIR=/tmp/$P
cd /tmp
# locale
#########
mkdir -p $P-locale/usr/local/share
mv $P/usr/local/share/locale $P-locale/usr/local/share
# doc
##########
rm -rf $P/usr/local/share/man
# main
#####
rm -rf $P/usr/local/share/$P/*.svg
mkdir -p $P/usr/local/share/doc/$P
cp $SRC/LICENSE $P/usr/local/share/doc/$P/
strip --strip-unneeded $P/usr/local/bin/$P
cp $SRC2/z/* $P/usr/local/bin/
# tce.install
#############
mkdir -p $P/usr/local/tce.installed
cat >> $P/usr/local/tce.installed/$P <<'EOF'
#!/bin/sh
echo 'jwm' > /etc/sysconfig/desktop
EOF
chown -R root:staff $P/usr/local/tce.installed
chmod -R 775 $P/usr/local/tce.installed
# TC menu fix and adjust other roberts work
###########################################
cp -R $SRC2/share/$P/tce $P/usr/local/share/$P
# XML Parsing Error: not well-formed Location: file:///home/tc/.jwmrc-theme Line Number 40, Column 13:
# but its the line above
THEME=$P/usr/local/share/jwm/tce/.jwmrc-theme
sed 's|2e3a67|' -i $THEME
# make changes to roberts configs for personal reasons
CONFIG=$P/usr/local/share/$P/tce
sed 's|./.jwmrc-ondemand||' -i $CONFIG/.jwmrc
sed -i 's|CA|A|g' -i $CONFIG/.jwmrc-keys
sed -i 's|aterm|xterm|g' -i $CONFIG/.jwmrc-keys
sed -i '39aexec:apps' $CONFIG/.jwmrc-keys
sed -i '40aexec:beaver' $CONFIG/.jwmrc-keys
sed -i '41aexec:exittc' $CONFIG/.jwmrc-keys
sed -i '42aexec:firefox-perf' $CONFIG/.jwmrc-keys
sed -i '43aexec:leafpad' $CONFIG/.jwmrc-keys
sed -i '44aexec:mnttool' $CONFIG/.jwmrc-keys
sed -i '45aexec:pcmanfm' $CONFIG/.jwmrc-keys
sed -i '46aexec:update-desktops' $CONFIG/.jwmrc-keys
sed -i '47aexec:aterm -fn 12x24' $CONFIG/.jwmrc-keys
sed 's|aterm|xterm|' -i $CONFIG/.jwmrc-tray
sed -i '11aexec:apps' $CONFIG/.jwmrc-tray
sed -i '12aexec:firefox-perf' $CONFIG/.jwmrc-tray
sed -i '13aexec:mnttool' $CONFIG/.jwmrc-tray
# bin fixes
##########
sed 's|jwm_ondemand||' -i jwm/usr/local/bin/jwm_initmenu
sed 's|aterm|xterm|' -i jwm/usr/local/bin/jwm_menu_common
# TCZ them
###########
LIST2="$P $P-locale "
for Z in $LIST2
do
mksquashfs $Z $Z.tcz
md5sum $Z.tcz > $Z.tcz.md5.txt
cd $Z
find usr -not -type d > /tmp/$Z.tcz.list
sed 's|usr|/usr|g' -i /tmp/$Z.tcz.list
cd /tmp
done
ls -hal
echo 'Title: jwm-locale.tcz
Description: jwm locales
Version: 2.4.3
Author: Joe Wingbermuelhle
Original-site: http://joewing.net/projects/jwm/
Copying-policy: accompanied
Size: 52K
Extension_by: aus9
Tags: window manager wm
Comments: untested by me
Change-log: 2020/09/10 v 2.3.7 on 12x
Current: 2023/06/13 v 2.4.3 on 14x ' > $P-locale.tcz.info
echo 'jwm.tcz' > $P-locale.tcz.dep
echo "Title: jwm.tcz
Description: Xorg Stacking Window Manager
Version: 2.4.3
Author: Joe Wingbermuelhle for main source
Robert Shingledecker (roberts) for TC stuff
Original-site: http://joewing.net/projects/jwm/
Copying-policy: accompanied
Size: 132K
Extension_by: aus9
Tags: window manager wm
Comments: Joe's Window Manager
(update) Move your current configs somewhere
safe and compare changes to
~/.jwmrc no ondemand due to $ jwm -p error
~/.jwm-tray more buttons
~/.jwm-keys changes CA now A and more TCE keys
Untouched /usr/local/etc/system.jwmrc
Online guide http://joewing.net/projects/jwm/guide.html
If you make changes please run $ jwm -p
- if ok restart jwm with Alt + r
Change-log: 2020/09/10 v 2.3.7 on 12x
Current: 2023/06/13 v 2.4.3 on 14x " > $P.tcz.info
readelf -d $P/usr/local/bin/$P | grep 'NEEDED' # remove TCBs
#[libX11.so.6] libX11 Xorg
#[libpng16.so.16] libpng "
#[libjpeg.so.62] libjpeg-turbo "
#[libXft.so.2] libXft
#[libXrender.so.1] libXrender libXft
#[libXpm.so.4] libXpm
#[libXinerama.so.1] libXinerama Xorg
echo 'Xorg.tcz
libXft.tcz
libXpm.tcz ' > $P.tcz.dep
submitqc --libs
rm -rf *.zsync