1+ # !/SBUILD ver @v1.0.0
2+ # SELF: https://raw.githubusercontent.com/pkgforge/soarpkgs/refs/heads/main/binaries/svn-lite/static.official.source.yaml
3+ _disabled : false
4+
5+ pkg : " svn-lite"
6+ pkg_id : " github.com.rofl0r.svn-lite.source"
7+ pkg_type : " static"
8+ category :
9+ - " ConsoleOnly"
10+ - " Utility"
11+ description : " Minimalist svn client to checkout/update Subversion repositories"
12+ homepage :
13+ - " https://github.com/rofl0r/svn-lite"
14+ # license:
15+ # - id: "Apache-2.0"
16+ # url: "https://github.com/rofl0r/svn-lite/raw/3c21dc42dcba02d62f4b4b67adcb592f5863790b/COPYING"
17+ maintainer :
18+ - " Azathothas (https://github.com/Azathothas)"
19+ note :
20+ - " [DO NOT RUN] (Meant for pkgforge CI Only)"
21+ - " Built From Source (Latest Git HEAD). Check/Report @ https://github.com/rofl0r/svn-lite"
22+ provides :
23+ - " svn-lite"
24+ - " svn2git"
25+ # repology:
26+ # - "svn-lite"
27+ src_url :
28+ - " https://github.com/rofl0r/svn-lite"
29+ tag :
30+ - " vcs"
31+ x_exec :
32+ host :
33+ - " aarch64-Linux"
34+ - " x86_64-Linux"
35+ shell : " bash"
36+ pkgver : |
37+ pushd "$(mktemp -d)" >/dev/null 2>&1 && \
38+ git clone --depth="1" --filter="blob:none" --no-checkout --single-branch --quiet "https://github.com/rofl0r/svn-lite" "./TEMPREPO" >/dev/null 2>&1 && \
39+ git --git-dir="./TEMPREPO/.git" --no-pager log -1 --pretty=format:'HEAD-%h-%cd' --date=format:'%y%m%dT%H%M%S' && \
40+ [ -d "$(realpath .)/TEMPREPO" ] && rm -rf "$(realpath .)" >/dev/null 2>&1 && popd >/dev/null 2>&1
41+ run : |
42+ #Build
43+ mkdir -pv "${SBUILD_TMPDIR}/tmp" && docker run --privileged --net="host" --name "alpine-builder" --pull="always" \
44+ -e "PKG=${PKG}" -e "PKG_ID=${PKG_ID}" -e "PKG_TYPE=${PKG_TYPE}" -e "PKG_VER=${PKG_VER}" \
45+ -e "PKGVER=${PKGVER}" -e "SBUILD_PKG=${SBUILD_PKG}" -e "SBUILD_PKGVER=${SBUILD_PKGVER}" \
46+ --volume "${SBUILD_TMPDIR}/tmp:/tmp:rw" \
47+ "ghcr.io/pkgforge/devscripts/alpine-builder:latest" \
48+ bash -l -c '
49+ #Setup ENV
50+ set -x ; mkdir -p "/build-bins" && pushd "$(mktemp -d)" >/dev/null 2>&1
51+ #Build
52+ git clone --filter "blob:none" --depth="1" --quiet "https://github.com/rofl0r/svn-lite" "./TEMPREPO" && cd "./TEMPREPO"
53+ export CC="clang"
54+ export CXX="clang++"
55+ export CFLAGS="-Os -flto=auto -fuse-ld=$(which mold) -g0 -pipe -static -static-pie -v -w -Wno-error"
56+ export CPPFLAGS="${CFLAGS}"
57+ export CXXFLAGS="${CFLAGS}"
58+ export LD="$(which mold)"
59+ export LDFLAGS="-static -static-pie -Wl,--Bstatic,--build-id=none,--no-dynamic-linker,--no-fatal-warnings,--static,--stats,--strip-all,-z,noexecstack,-z,pack-relative-relocs,-z,relro"
60+ make --jobs="$(($(nproc)+1))" --keep-going
61+ find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep -Ei "application/.*executable|text/x-perl|text/.*script" | cut -d":" -f1 | xargs realpath | xargs -I "{}" sh -c '\''echo "File: {}"; readelf -p ".comment" "{}"'\''
62+ #Copy
63+ #cp "./svn-lite" "/build-bins/svn-lite"
64+ find "." -maxdepth 1 -type f -exec file -i "{}" \; | grep -Ei "application/.*executable|text/x-perl|text/.*script" | cut -d":" -f1 | xargs realpath | xargs -I "{}" rsync -achvL "{}" "/build-bins/"
65+ mv -fv "/build-bins/svn" "/build-bins/svn-lite" 2>/dev/null
66+ mv -fv "/build-bins/svn2git.sh" "/build-bins/svn2git" 2>/dev/null
67+ ( askalono --format "json" crawl --follow "$(realpath .)" | jq -r ".. | objects | .path? // empty" | head -n 1 | xargs -I "{}" cp -fv "{}" "/build-bins/LICENSE" ) 2>/dev/null
68+ #strip & info
69+ find "/build-bins/" -type f -exec objcopy --remove-section=".comment" --remove-section=".note.*" "{}" \;
70+ find "/build-bins/" -type f ! -name "*.no_strip" -exec strip --strip-debug --strip-dwo --strip-unneeded "{}" \; >/dev/null 2>&1
71+ file "/build-bins/"* && du -sh "/build-bins/"*
72+ popd >/dev/null 2>&1
73+ '
74+ #Copy & Meta
75+ docker cp "alpine-builder:/build-bins/." "${SBUILD_TMPDIR}/"
76+ [ -s "${SBUILD_TMPDIR}/LICENSE" ] && cp -fv "${SBUILD_TMPDIR}/LICENSE" "${SBUILD_OUTDIR}/LICENSE"
77+ find "${SBUILD_TMPDIR}" -maxdepth 1 -type f -exec file -i "{}" \; | grep -Ei "application/.*executable|text/x-perl|text/.*script" | cut -d":" -f1 | xargs realpath | xargs -I "{}" rsync -achvL "{}" "${SBUILD_OUTDIR}"
0 commit comments