Skip to content

Commit

Permalink
compile: +common.sh, +feh
Browse files Browse the repository at this point in the history
--
cpl: v-tint2>> sed -i "s^git://anongit.freedesktop.org/xcb/util-common-m4.git^https://gitee.com/g-system/util-common-m4.git^g" .gitmodules

v-tint2: apk add util-macros #ubt: xorg-macros

cpl: v-xlunch split common.sh

v-xlunch source /src/common.sh

v-xlunch: imlib2 mark ver; +imlib2_loaders

v-xlunch/build.sh tar -Jxf xx.tar.xz

cpl: common.sh git config --global http.sslVerify false ##关闭SSL验证

cpl: common.sh test -z "$TARGETPATH" && export TARGETPATH=/usr/local/static_temp1 #/opt/base

cpl: +v-feh/build.sh

feh source /src/common.sh

feh up

up v-feh/build.sh

cpl: feh fix

v-feh: apk add libxt-dev; DESTDIR=

#xinerama=0

v-feh/build.sh: bash /src/v-xlunch/build.sh imlib2 #imlib2-1.7.4.tar.g@sourceforge

cpl: dockerfile +feh
  • Loading branch information
huapox committed Aug 20, 2024
1 parent c438ad6 commit 2fd13cd
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 57 deletions.
16 changes: 15 additions & 1 deletion compile/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,19 @@ RUN mkdir -p $TARGETPATH; \
\
find ${TARGETPATH} -type f |sort;

# Build feh
FROM base AS feh
ARG COMPILE_FEH="yes"
ENV CONSOLE_LOG=no \
TARGETPATH=/usr/local/static/feh
RUN mkdir -p $TARGETPATH; \
# sh /src/v-feh/build.sh cache; \
\
test "yes" != "$COMPILE_FEH" && exit 0 || echo doMake; \
sh /src/v-feh/build.sh b_deps; \
sh /src/v-feh/build.sh feh; \
\
find ${TARGETPATH} -type f |sort;

FROM base AS xcompmgr
ARG COMPILE_XCOMPMGR="yes"
Expand Down Expand Up @@ -305,11 +318,12 @@ COPY --from=dropbear ${STATIC} /rootfs${STATIC}
COPY --from=pulseaudio ${STATIC} /rootfs${STATIC}
COPY --from=fluxbox ${STATIC} /rootfs${STATIC}
COPY --from=openbox ${STATIC} /rootfs${STATIC}
COPY --from=tint2 ${STATIC} /rootfs${STATIC}
COPY --from=suckless ${STATIC} /rootfs${STATIC}
#
COPY --from=xcompmgr ${STATIC} /rootfs${STATIC}
COPY --from=xlunch ${STATIC} /rootfs${STATIC}
COPY --from=tint2 ${STATIC} /rootfs${STATIC}
COPY --from=feh ${STATIC} /rootfs${STATIC}
COPY --from=pcmanfm ${STATIC} /rootfs${STATIC}
COPY --from=lxde ${STATIC} /rootfs${STATIC}
COPY --from=perp ${STATIC} /rootfs${STATIC}
Expand Down
56 changes: 56 additions & 0 deletions compile/src/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/sh

set -e # Exit immediately if a command exits with a non-zero status.
# set -u # Treat unset variables as an error.

# Set same default compilation flags as abuild.
export CFLAGS="-Os -fomit-frame-pointer"
export CXXFLAGS="$CFLAGS"
export CPPFLAGS="$CFLAGS"
export LDFLAGS="-Wl,--as-needed --static -static -Wl,--strip-all"
#
export CC=xx-clang

# set -u; err if not exist
test -z "$TARGETPATH" && export TARGETPATH=/usr/local/static_temp1 #/opt/base
test -z "$CONSOLE_LOG" && export CONSOLE_LOG=yes
# rm -rf $LOGS; #avoid deleted @batch-mode
CACHE=$TARGETPATH/../.cache; LOGS=$TARGETPATH/../.logs; mkdir -p $CACHE $LOGS
function down_catfile(){
url=$1
file=${url##*/}
#curl -# -L -f
test -f $CACHE/$file || curl -# -k -fSL $url > $CACHE/$file
cat $CACHE/$file
}
function print_time_cost(){
local begin_time=$1
gawk 'BEGIN{
print "本操作从" strftime("%Y年%m月%d日%H:%M:%S",'$begin_time'),"开始 ,",
strftime("到%Y年%m月%d日%H:%M:%S",systime()) ,"结束,",
" 共历时" systime()-'$begin_time' "秒";
}' 2>&1 | tee -a $logfile
}
function log {
echo -e "\n\n>>> $*"
}


# export CC=clang
# export CXX=clang++

function oneBuild(){
# $1 |tee $LOGS/$1.log
# env |sort #view
set +e
echo -e "\n$1, start building.."
begin_time="`gawk 'BEGIN{print systime()}'`"; export logfile=$LOGS/xlunch-$1.log
test "yes" == "$CONSOLE_LOG" && echo yes || echo no
test "yes" == "$CONSOLE_LOG" && $1 |tee $logfile || $1 > $logfile 2>&1;
# $1 > $logfile 2>&1;

test "0" != "$?" && tail -200 $logfile || echo "err 0, pass"
print_time_cost $begin_time; echo "$1, finished."
}

git config --global http.sslVerify false ##关闭SSL验证
65 changes: 65 additions & 0 deletions compile/src/v-feh/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/sh
set -e
source /src/common.sh

FEH_VER=0.8.4
FEH_URL=${gh}https://github.com/neutrinolabs/xrdp/releases/download/v${XRDP_VER}/xrdp-${XRDP_VER}.tar.gz

#
# Build feh
# export TARGETPATH=/usr/local/static/feh
function feh(){
# ./wallpaper.h:31:10: fatal error: 'X11/Intrinsic.h' file not found
apk add libxt-dev

log "Downloading FEH..."
rm -rf /tmp/fk-feh; # mkdir -p /tmp/fk-feh ##feh> fk-feh
# down_catfile ${FEH_URL} | tar -zx --strip 1 -C /tmp/fk-feh
# branch="--branch=$FEH_VER"
# repo=https://hub.nuaa.cf/Tomas-M/feh
repo=https://gitee.com/g-system/fk-feh
git clone --depth=1 $branch $repo /tmp/fk-feh #;
log "Configuring FEH..."
cd /tmp/fk-feh #&& ./bootstrap;
deps1="-lXft -lX11 -lxcb -lXau -lfontconfig -lfreetype -lXrender -lXdmcp -lpng -lexpat -lxml2 -lz -lbz2 -lbrotlidec -lbrotlicommon"
deps2="-lXdamage -lX11-xcb -lxcb-shm -lxcb-render -lxcb-util -lmd"
deps3="-lXext -lXinerama -lXfixes -lXrandr -lXi"

# ./configure
sed -i "s^-lm -lpng -lX11 -lImlib2^-lm -lpng -lX11 -lImlib2 $deps1 $deps2 $deps3^g" config.mk

# make
export DESTDIR= PREFIX=$TARGETPATH
export curl=false exif=0 magic=0 #xinerama=0
make clean; make LDFLAGS="-static $deps1 $deps2 $deps3 "

log "Install FEH..."
# make-install
make install;

# view
ls -lh /tmp/fk-feh/src/feh
xx-verify --static /tmp/fk-feh/src/feh
}


case "$1" in
cache)
# down_catfile ${IMLIB2_URL} > /dev/null
;;
full)
# imlib2
feh
;;
b_deps)
bash /src/v-xlunch/build.sh imlib2 #imlib2-1.7.4.tar.g@sourceforge
#
bash /src/v-tint2/build.sh xcbutil & ##need?
bash /src/v-tint2/build.sh libxi &
wait
;;
*) #compile
oneBuild $1
;;
esac
exit 0
3 changes: 2 additions & 1 deletion compile/src/v-tint2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ function xcbutil(){
cd /tmp/xcb-util
# git clone $GITHUB/freedesktop-unofficial-mirror/xcb__util
# cd xcb__util/
apk add util-macros #ubt: xorg-macros
sed -i "s^git://anongit.freedesktop.org/xcb/util-common-m4.git^https://gitee.com/g-system/util-common-m4.git^g" .gitmodules
git submodule update --init
apk add xorg-macros
./autogen.sh
#
# cd /mnt2/_deps/xcb__util/
Expand Down
69 changes: 14 additions & 55 deletions compile/src/v-xlunch/build.sh
Original file line number Diff line number Diff line change
@@ -1,52 +1,23 @@
#!/bin/sh
set -e
source /src/common.sh

# v1.12.3 @ 2024-02-03
# v1.7.4 @2021-09-17
IMLIB2_VER=1.7.4
IMLIB2_URL=https://master.dl.sourceforge.net/project/enlightenment/imlib2-src/${IMLIB2_VER}/imlib2-${IMLIB2_VER}.tar.gz
# v1.12.2 tar -Jxf xx.tar.xz
# https://nchc.dl.sourceforge.net/project/enlightenment/imlib2-src/1.12.2/imlib2-1.12.2.tar.xz #xz,gz
# https://nchc.dl.sourceforge.net/project/enlightenment/imlib2-src/1.12.2/imlib2_loaders-1.12.2.tar.xz
# v1.7.4
# https://master.dl.sourceforge.net/project/enlightenment/imlib2-src/1.7.4/imlib2-1.7.4.tar.gz #gz,bz2
# https://master.dl.sourceforge.net/project/enlightenment/imlib2-src/1.7.4/imlib2_loaders-1.7.4.tar.gz

set -e # Exit immediately if a command exits with a non-zero status.
# set -u # Treat unset variables as an error.


IMLIB2_URL=https://master.dl.sourceforge.net/project/enlightenment/imlib2-src/1.7.4/imlib2-1.7.4.tar.gz
# gh=https://ghps.cc/
# https://gitee.com/g-system/fk-suckless-xlunch #git clone;
XLUNCH_VER=0.8.4
XLUNCH_URL=${gh}https://github.com/neutrinolabs/xrdp/releases/download/v${XRDP_VER}/xrdp-${XRDP_VER}.tar.gz

# Set same default compilation flags as abuild.
export CFLAGS="-Os -fomit-frame-pointer"
export CXXFLAGS="$CFLAGS"
export CPPFLAGS="$CFLAGS"
export LDFLAGS="-Wl,--as-needed --static -static -Wl,--strip-all"
#
export CC=xx-clang

# set -u; err if not exist
test -z "$TARGETPATH" && export TARGETPATH=/opt/base
test -z "$CONSOLE_LOG" && export CONSOLE_LOG=yes
# rm -rf $LOGS; #avoid deleted @batch-mode
CACHE=$TARGETPATH/../.cache; LOGS=$TARGETPATH/../.logs; mkdir -p $CACHE $LOGS
function down_catfile(){
url=$1
file=${url##*/}
#curl -# -L -f
test -f $CACHE/$file || curl -# -k -fSL $url > $CACHE/$file
cat $CACHE/$file
}
function print_time_cost(){
local begin_time=$1
gawk 'BEGIN{
print "本操作从" strftime("%Y年%m月%d日%H:%M:%S",'$begin_time'),"开始 ,",
strftime("到%Y年%m月%d日%H:%M:%S",systime()) ,"结束,",
" 共历时" systime()-'$begin_time' "秒";
}' 2>&1 | tee -a $logfile
}
function log {
echo -e "\n\n>>> $*"
}


# export CC=clang
# export CXX=clang++


# https://master.dl.sourceforge.net/project/enlightenment/imlib2-src/1.7.4/imlib2-1.7.4.tar.gz
# https://master.dl.sourceforge.net/project/enlightenment/imlib2-src/1.7.4/imlib2_loaders-1.7.4.tar.gz
function imlib2(){
Expand Down Expand Up @@ -74,10 +45,8 @@ function imlib2(){

#
# Build xlunch
#
# export TARGETPATH=/usr/local/static/xlunch
function xlunch(){

apk add hicolor-icon-theme #need hicolor
# ref: xcompmgr
apk add cairo-static expat-static fribidi-static glib-static graphite2-static harfbuzz-static
Expand Down Expand Up @@ -127,17 +96,7 @@ full)
xlunch
;;
*) #compile
# $1 |tee $LOGS/$1.log
# env |sort #view
set +e
echo -e "\n$1, start building.."
begin_time="`gawk 'BEGIN{print systime()}'`"; export logfile=$LOGS/xlunch-$1.log
test "yes" == "$CONSOLE_LOG" && echo yes || echo no
test "yes" == "$CONSOLE_LOG" && $1 |tee $logfile || $1 > $logfile 2>&1;
# $1 > $logfile 2>&1;

test "0" != "$?" && tail -200 $logfile || echo "err 0, pass"
print_time_cost $begin_time; echo "$1, finished."
oneBuild $1
;;
esac
exit 0

0 comments on commit 2fd13cd

Please sign in to comment.