linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
commit 09482bce81bc513db2661ee82706d7c21cd18314 parent 4f98568f8306a4283e28431f0ad6f8bcb6973f78 Author: Jul <jul@9o.is> Date: Thu, 27 Nov 2025 02:43:13 -0500 separate fetch() to git() and curl() Diffstat:
| M | pkg/ag/gen.sh | | | 2 | +- |
| M | pkg/awk/gen.sh | | | 2 | +- |
| M | pkg/b3sum/gen.sh | | | 2 | +- |
| M | pkg/byacc/gen.sh | | | 2 | +- |
| M | pkg/bzip2/gen.sh | | | 2 | +- |
| M | pkg/e2fsprogs/gen.sh | | | 2 | +- |
| M | pkg/freetype/gen.sh | | | 2 | +- |
| M | pkg/fspec-sync/gen.sh | | | 2 | +- |
| M | pkg/fzy/gen.sh | | | 2 | +- |
| M | pkg/genfn.sh | | | 105 | ++++++++++++++++++++++++++++++++++++++----------------------------------------- |
| M | pkg/less/gen.sh | | | 2 | +- |
| M | pkg/libpng/gen.sh | | | 2 | +- |
| M | pkg/libtermkey/gen.sh | | | 2 | +- |
| M | pkg/linux-headers/gen.sh | | | 2 | +- |
| M | pkg/lpeg/gen.sh | | | 2 | +- |
| M | pkg/lua/gen.sh | | | 2 | +- |
| M | pkg/mandoc/gen.sh | | | 2 | +- |
| M | pkg/netbsd-curses/gen.sh | | | 2 | +- |
| M | pkg/oksh/gen.sh | | | 2 | +- |
| M | pkg/pax/gen.sh | | | 2 | +- |
| M | pkg/pcre/gen.sh | | | 2 | +- |
| M | pkg/perp/gen.sh | | | 2 | +- |
| M | pkg/python/gen.sh | | | 2 | +- |
| M | pkg/qubes-core-qrexec/gen.sh | | | 2 | +- |
| M | pkg/qubes-core-vchan-xen/gen.sh | | | 2 | +- |
| M | pkg/sbase/gen.sh | | | 2 | +- |
| M | pkg/sinit/gen.sh | | | 2 | +- |
| M | pkg/ubase/gen.sh | | | 2 | +- |
| M | pkg/util-linux/gen.sh | | | 2 | +- |
| M | pkg/vis/gen.sh | | | 2 | +- |
| M | pkg/xen/gen.sh | | | 4 | ++-- |
| M | pkg/xz/gen.sh | | | 2 | +- |
| M | pkg/yajl/gen.sh | | | 2 | +- |
| M | pkg/zlib/gen.sh | | | 2 | +- |
| M | pkg/zstd/gen.sh | | | 2 | +- |
35 files changed, 85 insertions(+), 90 deletions(-)
diff --git a/pkg/ag/gen.sh b/pkg/ag/gen.sh @@ -1,4 +1,4 @@ -fetch git 2.2.0 +git 2.2.0 cflags " -D_GNU_SOURCE diff --git a/pkg/awk/gen.sh b/pkg/awk/gen.sh @@ -1,4 +1,4 @@ -fetch git 20250116 +git 20250116 cflags " -std=c11 diff --git a/pkg/b3sum/gen.sh b/pkg/b3sum/gen.sh @@ -1,4 +1,4 @@ -fetch git d995c3d +git d995c3d cflags " -std=c99 diff --git a/pkg/byacc/gen.sh b/pkg/byacc/gen.sh @@ -1,4 +1,4 @@ -fetch curl https://invisible-mirror.net/archives/byacc/byacc-20241231.tgz \ +curl https://invisible-mirror.net/archives/byacc/byacc-20241231.tgz \ 192c2fae048d4e7f514ba451627f9c4e612765099f819c19191f9fde3e609673 cflags " diff --git a/pkg/bzip2/gen.sh b/pkg/bzip2/gen.sh @@ -1,4 +1,4 @@ -fetch git bzip2-1.0.8 +git bzip2-1.0.8 cflags " -Wno-unused-parameter diff --git a/pkg/e2fsprogs/gen.sh b/pkg/e2fsprogs/gen.sh @@ -1,6 +1,6 @@ version=1.46.4 -fetch git v$version +git v$version cflags " -std=c99 diff --git a/pkg/freetype/gen.sh b/pkg/freetype/gen.sh @@ -1,4 +1,4 @@ -fetch git VER-2-14-1 +git VER-2-14-1 cflags " -std=c99 diff --git a/pkg/fspec-sync/gen.sh b/pkg/fspec-sync/gen.sh @@ -1,4 +1,4 @@ -fetch git eca7ad6 +git eca7ad6 cflags " -std=c99 diff --git a/pkg/fzy/gen.sh b/pkg/fzy/gen.sh @@ -1,6 +1,6 @@ version=1.1 -fetch git $version +git $version cflags " -std=c99 diff --git a/pkg/genfn.sh b/pkg/genfn.sh @@ -3,11 +3,11 @@ pkg() { } init_pkg() { + FTCH= OBJS= HDRS= SRCS= DEPS= - PCHS= var srcdir $dir/src var libdir $outdir @@ -27,10 +27,7 @@ fini_pkg() { [ "$DEPS" ] && phony deps $DEPS [ "$HDRS" ] && phony headers $HDRS - if [ "$SRCS" ]; then - phony "$(printf '%s\n' $SRCS | sort | uniq | xargs)" $outdir/fetched "$PCHS" - fi - + fetch_complete fini_files } @@ -299,66 +296,64 @@ files() { done } -fetch() { - case $1 in - git) - [ ! "${2-}" ] && error missing git ref || _ref=$2 - - fetch_git fetched - bind ref $_ref - ;; - curl) - [ ! "${2-}" ] && error missing curl url || _url=$2 - [ ! "${3-}" ] && error missing curl sha256sum || _sha=$3 - shift 3 - _srcs=$* - _name=${_url##*/} - - fetch_curl $_name - bind url $_url - - sha256sum checksum $outdir/$_name - bind sha256 $_sha - - case $_name in - *.tar.gz|*.tgz) - _archive=${_name%.t*gz}.tar - _tool=gzip - ;; - *.tar.xz) - _archive=${_name%.xz} - _tool=xz - ;; - *.tar.bz2) - _archive=${_name%.bz2} - _tool=bzip2 - ;; - *) - error unknown archive type $_name - ;; - esac +git() { + [ ! "${1-}" ] && error missing git ref || _ref=$1 + fetch_git ${_ref}_fetched + bind ref $_ref + FTCH="$FTCH $outdir/${_ref}_fetched" +} - extract fetched $outdir/$_name '|' $outdir/checksum - bind tool $_tool - bind srcs $_srcs +curl() { + [ ! "${1-}" ] && error missing curl url || _url=$1 + [ ! "${2-}" ] && error missing curl sha256sum || _sha=$2 + shift 2 + _srcs=$* + _name=${_url##*/} - if ! grep -qE "^${DIR#./}/src$" .git/info/exclude; then - printf "%s/src\n" ${DIR#./} >> .git/info/exclude - fi - ;; - *) - error unknown fetch method $1 - ;; + fetch_curl $_name + bind url $_url + + sha256sum ${_name}_checked $outdir/$_name + bind sha256 $_sha + + case $_name in + *.tar.gz|*.tgz) _tool=gzip;; + *.tar.xz) _tool=xz;; + *.tar.bz2) _tool=bzip2;; + *) error unknown archive type $_name;; esac + extract ${_name}_extracted $outdir/$_name '|' $outdir/${_name}_checked + bind tool $_tool + bind srcs $_srcs + + if ! grep -qE "^${DIR#./}/src$" .git/info/exclude; then + printf "%s/src\n" ${DIR#./} >> .git/info/exclude + fi + + FTCH="$FTCH $outdir/${_name}_extracted" +} + +fetch_complete() { + if [ ! "$FTCH" ]; then + return + fi + + _patches= + phony fetch $FTCH + if [ -d $DIR/patch ]; then for _v in $DIR/patch/*.patch; do _out=$outdir/${_v##*/} _in=$dir/${_v#"$DIR"/} - patch $_out $_in '|' $outdir/fetched $PCHS - PCHS="$PCHS $_out" + patch $_out $_in '|' $dir/fetch $_patches + _patches="$_patches $_out" done fi + + if [ "$SRCS" ]; then + phony "$(printf '%s\n' $SRCS | sort | uniq | xargs)" $dir/fetch "$_patches" + fi } man() { diff --git a/pkg/less/gen.sh b/pkg/less/gen.sh @@ -1,4 +1,4 @@ -fetch curl https://www.greenwoodsoftware.com/less/less-679.tar.gz \ +curl https://www.greenwoodsoftware.com/less/less-679.tar.gz \ 9b68820c34fa8a0af6b0e01b74f0298bcdd40a0489c61649b47058908a153d78 cflags " diff --git a/pkg/libpng/gen.sh b/pkg/libpng/gen.sh @@ -1,4 +1,4 @@ -fetch git v1.6.43 +git v1.6.43 cflags " -DHAVE_CONFIG_H diff --git a/pkg/libtermkey/gen.sh b/pkg/libtermkey/gen.sh @@ -1,4 +1,4 @@ -fetch curl http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz \ +curl http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz \ 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600 cflags " diff --git a/pkg/linux-headers/gen.sh b/pkg/linux-headers/gen.sh @@ -1,4 +1,4 @@ -fetch curl \ +curl \ https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.12.tar.xz \ b1a2562be56e42afb3f8489d4c2a7ac472ac23098f1ef1c1e40da601f54625eb \ 'linux-*/Makefile' \ diff --git a/pkg/lpeg/gen.sh b/pkg/lpeg/gen.sh @@ -1,4 +1,4 @@ -fetch curl http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.1.0.tar.gz \ +curl http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.1.0.tar.gz \ 4b155d67d2246c1ffa7ad7bc466c1ea899bbc40fef0257cc9c03cecbaed4352a cflags " diff --git a/pkg/lua/gen.sh b/pkg/lua/gen.sh @@ -1,4 +1,4 @@ -fetch curl http://www.lua.org/ftp/lua-5.4.7.tar.gz \ +curl http://www.lua.org/ftp/lua-5.4.7.tar.gz \ 9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30 cflags " diff --git a/pkg/mandoc/gen.sh b/pkg/mandoc/gen.sh @@ -1,4 +1,4 @@ -fetch curl http://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz \ +curl http://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz \ 8bf0d570f01e70a6e124884088870cbed7537f36328d512909eb10cd53179d9c cflags " diff --git a/pkg/netbsd-curses/gen.sh b/pkg/netbsd-curses/gen.sh @@ -1,4 +1,4 @@ -fetch git 3aa07c2 +git 3aa07c2 cflags " -D_XOPEN_SOURCE=700 diff --git a/pkg/oksh/gen.sh b/pkg/oksh/gen.sh @@ -1,4 +1,4 @@ -fetch git oksh-7.7 +git oksh-7.7 cflags " -DEMACS diff --git a/pkg/pax/gen.sh b/pkg/pax/gen.sh @@ -1,4 +1,4 @@ -fetch git 95d26ab +git 95d26ab cflags " -std=c99 diff --git a/pkg/pcre/gen.sh b/pkg/pcre/gen.sh @@ -1,7 +1,7 @@ version=8.45 rel=2019-02-23 -fetch curl https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz \ +curl https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz \ 4e6ce03e0336e8b4a3d6c2b70b1c5e18590a5673a98186da90d4f33c23defc09 cflags " diff --git a/pkg/perp/gen.sh b/pkg/perp/gen.sh @@ -1,4 +1,4 @@ -fetch curl http://b0llix.net/perp/distfiles/perp-2.07.tar.gz \ +curl http://b0llix.net/perp/distfiles/perp-2.07.tar.gz \ 1222fe31c16014d8b2a78416f93ba9f8c31eddbc381adc9021fa5d9764475815 cflags " diff --git a/pkg/python/gen.sh b/pkg/python/gen.sh @@ -1,4 +1,4 @@ -fetch curl https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz \ +curl https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz \ 5a99f8e7a6a11a7b98b4e75e0d1303d3832cada5534068f69c7b6222a7b1b002 cflags " diff --git a/pkg/qubes-core-qrexec/gen.sh b/pkg/qubes-core-qrexec/gen.sh @@ -1,4 +1,4 @@ -fetch git v4.3.11 +git v4.3.11 cflags " -std=gnu11 diff --git a/pkg/qubes-core-vchan-xen/gen.sh b/pkg/qubes-core-vchan-xen/gen.sh @@ -1,4 +1,4 @@ -fetch git v4.2.7 +git v4.2.7 cflags " -DHAVE_XC_DOMAIN_GETINFO_SINGLE diff --git a/pkg/sbase/gen.sh b/pkg/sbase/gen.sh @@ -1,4 +1,4 @@ -fetch git 6b802ab +git 6b802ab cflags " -std=c99 diff --git a/pkg/sinit/gen.sh b/pkg/sinit/gen.sh @@ -1,4 +1,4 @@ -fetch git v1.1 +git v1.1 cflags " -std=c99 diff --git a/pkg/ubase/gen.sh b/pkg/ubase/gen.sh @@ -1,4 +1,4 @@ -fetch git a570a80 +git a570a80 cflags " -std=c99 diff --git a/pkg/util-linux/gen.sh b/pkg/util-linux/gen.sh @@ -1,6 +1,6 @@ version=2.37.0 -fetch git v2.37 +git v2.37 cflags " -include $dir/config.h diff --git a/pkg/vis/gen.sh b/pkg/vis/gen.sh @@ -1,6 +1,6 @@ version=0.9 -fetch git 8cdf93e +git 8cdf93e cflags " -std=c99 diff --git a/pkg/xen/gen.sh b/pkg/xen/gen.sh @@ -1,4 +1,4 @@ -fetch git RELEASE-4.19.3 +git RELEASE-4.19.3 case $TARGET_ARCH in x86_64) xen_arch=x86;; @@ -135,7 +135,7 @@ mkx86header() { bind expr "\"s/(__align8__ \(uint64_t\))/(\1)/g\"" } -linkheaders headerslinked '||' $outdir/fetched +linkheaders headerslinked '||' $dir/fetch mkx86header x86_32 mkx86header x86_64 gencpuid xen/lib/x86/cpuid-autogen.h xen/include/public/arch-x86/cpufeatureset.h diff --git a/pkg/xz/gen.sh b/pkg/xz/gen.sh @@ -1,4 +1,4 @@ -fetch git v5.8.1 +git v5.8.1 cflags " -DHAVE_CONFIG_H diff --git a/pkg/yajl/gen.sh b/pkg/yajl/gen.sh @@ -1,4 +1,4 @@ -fetch git 2.1.0 +git 2.1.0 cflags " -std=c99 diff --git a/pkg/zlib/gen.sh b/pkg/zlib/gen.sh @@ -1,4 +1,4 @@ -fetch git v1.3.1 +git v1.3.1 cflags " -std=c99 diff --git a/pkg/zstd/gen.sh b/pkg/zstd/gen.sh @@ -1,4 +1,4 @@ -fetch git v1.5.7 +git v1.5.7 if [ $TARGET_ARCH = x86_64 ]; then zstd_x86_64=lib/decompress/huf_decompress_amd64.S