# HG changeset patch # User ellis # Date 1701146878 18000 # Node ID 87dd4724adfbda5dadc21fdc2069b4d855a3c433 # Parent 17a70918610c1a75652abea232585e0a490a3068 build scripts diff -r 17a70918610c -r 87dd4724adfb makefile --- a/makefile Mon Nov 27 22:33:13 2023 -0500 +++ b/makefile Mon Nov 27 23:47:58 2023 -0500 @@ -5,6 +5,8 @@ ROCKSDB_VERSION:=main SBCL_VERSION:=main RUST_VERSION:=main +B:=build +D:=dist SRC:=comp SHELL=/bin/sh UNAME=$(shell uname) @@ -17,7 +19,7 @@ all:linux emacs rocksdb sbcl rust code virt dist; -clean:linux-clean code-clean dist-clean; +clean:clean-linux clean-code clean-dist; ### Linux LINUX_TARGET:=linux-$(LINUX_VERSION) @@ -30,17 +32,30 @@ cd build && unxz $@.tar.xz && tar -xvf $@.tar $(LINUX_TARGET) linux-config:$(LINUX_TARGET); cd build/$< && make mrproper -j && zcat /proc/config.gz > .config && yes N | make localmodconfig -linux-clean::;rm -rf build/$(LINUX_TARGET)* +clean-linux::;rm -rf build/$(LINUX_TARGET)* ### Emacs -EMACS_TARGET:=emacs-$(EMACS_VERSION) +EMACS_TARGET:=build/src/emacs-$(EMACS_VERSION) +EMACS_DIST:=$(DIST)/src/emacs emacs:scripts/get-emacs.sh; $< $(EMACS_VERSION) +emacs-build:emacs scripts/build-emacs.sh; + cd $(EMACS_TARGET) + ./autogen.sh + mkdir -pv $(EMACS_DIST) + scripts/build-emacs.sh $(EMACS_VERSION) $(EMACS_TARGET) $(EMACS_DIST) + +emacs-install:emacs-build; + cd $(EMACS_DIST) + make install + ### RocksDB -ROCKSDB_TARGET:=rocksdb-$(ROCKSDB_VERSION) +ROCKSDB_TARGET:=build/src/rocksdb-$(ROCKSDB_VERSION) rocksdb:scripts/get-rocksdb.sh; $< $(ROCKSDB_VERSION) + cd $(ROCKSDB_TARGET) + make shared_lib DISABLE_JEMALLOC=1 ### SBCL SBCL_TARGET:=sbcl-$(SBCL_VERSION) @@ -48,29 +63,29 @@ $< $(SBCL_VERSION) ### Rust -RUST_TARGET:=rust-$(RUST_VERSION) +RUST_TARGET:=build/src/rust-$(RUST_VERSION) rust:scripts/get-rust.sh $< $(RUST_VERSION) -rust-install-x:rust; - cargo install --path build/$(RUST_TARGET)/src/tools/x +rust-x:rust; + cargo install --path $(RUST_TARGET)/src/tools/x rust-build:rust rust-install-x; - cd build/$(RUST_TARGET) && x build library + cd $(RUST_TARGET) && x build library rust-doc:rust rust-install-x; - cd build/$(RUST_TARGET) && x doc + cd $(RUST_TARGET) && x doc rust-build-full:rust-build; - cd build/$(RUST_TARGET) && x build --stage 2 compiler/rustc + cd $(RUST_TARGET) && x build --stage 2 compiler/rustc rust-install:rust-build; - cd build/$(RUST_TARGET) && x install -rust-dist:rust-build; - cd build/$(RUST_TARGET) && x dist + cd $(RUST_TARGET) && x install + ### Code +CODE_TARGET:=build/src/$(SRC) code:scripts/get-code.sh $< $(SRC) -code-clean::;rm -rf build/$(SRC)* +clean-code::;rm -rf $(CODE_TARGET)/* ### Virt -pod:virt/build-pod.sh +dev-pod:virt/build-pod.sh $< archlinux:virt/build-archlinux-base.sh $< @@ -85,16 +100,16 @@ heptapod-runner:virt/build-heptapod-runner.sh $< -vc:heptapod heptapod-runner +vc-pod:heptapod heptapod-runner virt:pod box bbdb vc -### Web ### Dist -dist/comp:scripts/bundle-dir.sh +dist/bundle:scripts/bundle-dir.sh $< dist/cdn:cdn + mkdir -pv $@ cp -r $^ $@ dist/sbcl:sbcl; @@ -102,12 +117,18 @@ dist/linux:linux; dist/rocksdb:rocksdb; + cd $(ROCKSDB_TARGET) + cp -rf include/* $(D) + cp -f librocksdb.so* $(D)/lib/ + +dist/rust:rust-build; + cd $(RUST_TARGET) && x dist dist/emacs:emacs; -dist:dist/comp dist/cdn dist/sbcl dist/linux dist/rocksdb +dist:dist/bundle dist/cdn dist/sbcl dist/rocksdb # dist/linux dist/rust -dist-clean::;rm -rf dist/* +clean-dist::;rm -rf dist/* ### Quickstart quick:code diff -r 17a70918610c -r 87dd4724adfb scripts/build-emacs.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/build-emacs.sh Mon Nov 27 23:47:58 2023 -0500 @@ -0,0 +1,22 @@ +#!/usr/bin/bash +CPUS=$(shell getconf _NPROCESSORS_ONLN) +VER="${1:-main}" +TARGETDIR=${2:-$(realpath build/emacs-$VER)} +DISTDIR=${3:-$(realpath dist/emacs-$VER)} +CONFIG=(--with-mailutils + --with-imagemagick + --with-x-toolkit=gtk + --without-pop + --without-sound + --with-json + --enable-link-time-optimization + --with-native-compilation + --with-modules) +pushd $TARGETDIR +./autogen.sh +mkdir -pv $DISTDIR +pushd $DISTDIR +$TARGETDIR/configure ${CONFIG[@]} +NATIVE_FULL_AOT=1 make -j$CPUS +popd +popd diff -r 17a70918610c -r 87dd4724adfb scripts/bundle-dir.sh --- a/scripts/bundle-dir.sh Mon Nov 27 22:33:13 2023 -0500 +++ b/scripts/bundle-dir.sh Mon Nov 27 23:47:58 2023 -0500 @@ -8,25 +8,28 @@ echo "Bundling $BUNDLE_NAME in $OUT..." rm -rf $OUT/* -rm -rf $WD/$BUNDLE_NAME.* +mkdir -pv $OUT mkdir -pv $WD/vc/{zst,stream} pushd $SRC_PATH -# Find all mercurial repositories, create bundles and dump them to $OUT dir +# Find all mercurial repositories, create bundles and dump them to $OUT dir. for i in $(find . -name ".hg" | cut -c 3-); do - echo ""; - echo $i; - - cd "$i"; - cd ..; - hg bundle -a -t zstd-v2 $WD/vc/zst/$(basename $(hg root)).hg.zst; - hg bundle -a -t none-v2 $WD/vc/$(basename $(hg root)).hg; - hg debugcreatestreamclonebundle $WD/vc/$(basename $(hg root)).hg.stream; - echo "... Done."; + echo "" + echo "found hg repo: $i" + cd "$i" + cd .. + echo "making zstd-v2 bundle..." + hg bundle -a -t zstd-v2 $WD/vc/zst/$(basename $(hg root)).hg.zst + echo "making none-v2 bundle..." + hg bundle -a -t none-v2 $WD/vc/$(basename $(hg root)).hg + echo "making stream bundle..." + hg debugcreatestreamclonebundle $WD/vc/stream/$(basename $(hg root)).hg.stream + echo "... Done." cd $SRC_PATH done popd pushd $WD +# archive all *.hg.zst bundles, final compression with zst tar -I 'zstd' -cf $OUT/$BUNDLE_NAME.tar.zst vc/zst/*.hg.zst # tar -cf $OUT/$BUNDLE_NAME.tar.stream vc/stream/*.hg.stream # tar -cf $OUT/$BUNDLE_NAME.tar vc/*.hg diff -r 17a70918610c -r 87dd4724adfb scripts/get-emacs.sh --- a/scripts/get-emacs.sh Mon Nov 27 22:33:13 2023 -0500 +++ b/scripts/get-emacs.sh Mon Nov 27 23:47:58 2023 -0500 @@ -1,25 +1,5 @@ #!/usr/bin/bash -CPUS=$(shell getconf _NPROCESSORS_ONLN) VER="${1:-main}" TARGETDIR=${2:-$(realpath build/emacs-$VER)} -DISTDIR=${3:-$(realpath dist/emacs-$VER)} -CONFIG=(--with-mailutils - --with-imagemagick - --with-x-toolkit=gtk - --without-pop - --without-sound - --with-json - --enable-link-time-optimization - --with-native-compilation - --with-modules) git clone https://vc.compiler.company/packy/shed/vendor/emacs.git $TARGETDIR -pushd $TARGETDIR -./autogen.sh -mkdir -pv $DISTDIR -pushd $DISTDIR -$TARGETDIR/configure ${CONFIG[@]} -NATIVE_FULL_AOT=1 make -j$CPUS -# make install -popd -popd diff -r 17a70918610c -r 87dd4724adfb scripts/get-rocksdb.sh --- a/scripts/get-rocksdb.sh Mon Nov 27 22:33:13 2023 -0500 +++ b/scripts/get-rocksdb.sh Mon Nov 27 23:47:58 2023 -0500 @@ -1,12 +1,4 @@ #!/usr/bin/bash VER="${1:-main}" -TARGETDIR=${2:-$(realpath build/rocksdb-$VER)} -DISTDIR=${3:-$(realpath dist)} +TARGETDIR=${2:-$(realpath build/src/rocksdb-$VER)} git clone https://vc.compiler.company/packy/shed/vendor/rocksdb.git $TARGETDIR -pushd $TARGETDIR -make shared_lib DISABLE_JEMALLOC=1 && -mkdir -pv $DISTDIR/include -mkdir -pv $DISTDIR/lib -# cp -rf include/* $DISTDIR -# cp -f librocksdb.so* $DISTDIR/lib/ -popd diff -r 17a70918610c -r 87dd4724adfb scripts/get-rust.sh --- a/scripts/get-rust.sh Mon Nov 27 22:33:13 2023 -0500 +++ b/scripts/get-rust.sh Mon Nov 27 23:47:58 2023 -0500 @@ -6,7 +6,4 @@ VER="${1:-main}" TARGETDIR=${2:-$(realpath build/rust-$VER)} -DISTDIR=${3:-$(realpath dist/rust)} git clone https://vc.compiler.company/packy/shed/vendor/rust.git $TARGETDIR -pushd $TARGETDIR -popd