summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-02-06 00:40:22 +0000
committerdavidovski <david@davidovski.xyz>2022-02-06 00:40:22 +0000
commit2c82b81fcd8fc723712ac605041da5142f765730 (patch)
treeda3ebf0f981d9f6e6bf4ccecef4ba55c044ae0a3
parent0b0913a10d6714015f1d1afa1a737086e20bac41 (diff)
moved src files to xibuild files
-rwxr-xr-xbuild.sh9
-rw-r--r--sitegen/build_site.sh15
-rwxr-xr-xxib_env (renamed from src/prepare_environment.sh)2
-rwxr-xr-xxibuild/build_all.sh (renamed from src/build.sh)6
-rwxr-xr-xxibuild/build_order.pm (renamed from src/build_order.pm)0
-rwxr-xr-xxibuild/build_package.sh (renamed from src/build_package.sh)25
-rwxr-xr-xxibuild/make_infos.sh65
-rwxr-xr-xxibuild/make_tools.sh (renamed from src/make_tools.sh)41
8 files changed, 117 insertions, 46 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..3f424b9
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+source xib_env
+
+cd xibuild
+./build_all.sh || exit 1
+./make_infos.sh
+
+
diff --git a/sitegen/build_site.sh b/sitegen/build_site.sh
new file mode 100644
index 0000000..8daef8c
--- /dev/null
+++ b/sitegen/build_site.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+# builds the html files required for the xilinux website
+
+generate_index () {
+ envsubst < templ/index.html
+}
+
+generate_package_list() {
+ local repo_dir=$1
+ for info_file in $repo_dir/*.xipkg.info; do
+
+ done;
+}
+
+"$XIB_CHROOT"/
diff --git a/src/prepare_environment.sh b/xib_env
index 1f4952d..c74a6fb 100755
--- a/src/prepare_environment.sh
+++ b/xib_env
@@ -1,8 +1,6 @@
#!/bin/sh
export MAKEFLAGS="-j$(grep "processor" /proc/cpuinfo | wc -l)"
-export LDFLAGS="-liconv"
-#export LDFLAGS=""
export XIB_DIR="/var/lib/xib"
export XIB_BUILDFILES="$XIB_DIR/buildfiles"
diff --git a/src/build.sh b/xibuild/build_all.sh
index a01368b..275e50b 100755
--- a/src/build.sh
+++ b/xibuild/build_all.sh
@@ -6,8 +6,6 @@ PASS="\033[0;32m"
NEUTRAL="\033[0;33m"
RESET="\033[0m"
-source prepare_environment.sh
-
build_package () {
name=$(echo $line | cut -d"+" -f1)
buildfile=$(find $XIB_BUILDFILES -wholename "*/$name.xibuild" | head -1)
@@ -63,11 +61,13 @@ build_all () {
}
if build_all; then
- printf "$PASSBuilt all packages!"
+ printf "\n${PASS}Built all packages!"
+ exit 0
else
printf "$ERROR Something went wrong!$NEUTRAL Press enter to view recent log"
read;
f=$(ls -1 --sort time $XIB_EXPORT/repo/*/*.log | head -1 | xargs realpath)
less $f
+ exit 1
fi
diff --git a/src/build_order.pm b/xibuild/build_order.pm
index 606839c..606839c 100755
--- a/src/build_order.pm
+++ b/xibuild/build_order.pm
diff --git a/src/build_package.sh b/xibuild/build_package.sh
index a6d4a33..44521a9 100755
--- a/src/build_package.sh
+++ b/xibuild/build_package.sh
@@ -33,7 +33,7 @@ package_exists () {
local exported_pkg_info="$exported.xipkg.info"
local exported_pkg_build="$exported.xibuild"
- if [ -f $exported_pkg ] && [ -f $exported_pkg_info ] && [ -f $exported_pkg_build ]; then
+ if [ -f $exported_pkg ] && [ -f $exported_pkg_build ]; then
local built_sum=$(md5sum $exported_pkg_build | cut -d" " -f1)
local current_sum=$(md5sum $BUILDFILE | cut -d" " -f1)
@@ -168,29 +168,6 @@ package () {
tar -C $pkg_dest -czf $export_pkg ./
}
-create_info () {
- local export_pkg="$XIB_EXPORT/repo/$REPO/$NAME.xipkg"
- local pkg_info="$export_pkg.info"
-
- echo "" > $pkg_info
- echo "NAME=$NAME" >> $pkg_info
- echo "DESCRIPTION=$DESC" >> $pkg_info
- echo "PKG_FILE=$NAME.xipkg" >> $pkg_info
- echo "CHECKSUM=$(md5sum $export_pkg | awk '{ print $1 }')" >> $pkg_info
- echo "SOURCE=$SOURCE" >> $pkg_info
- echo "DATE=$(date)" >> $pkg_info
- echo "DEPS=(${DEPS[*]})" >> $pkg_info
-}
-
-sign () {
- local export_pkg="$XIB_EXPORT/repo/$REPO/$NAME.xipkg"
- local pkg_info="$export_pkg.info"
-
- echo "SIGNATURE=" >> $pkg_info
- openssl dgst -sign $PRIV_KEY $export_pkg >> $pkg_info
-
-}
-
build () {
printf "$BLUE\tCleaning chroot..."
clean_chroot && printf "$GREEN prepared\n" || return 1
diff --git a/xibuild/make_infos.sh b/xibuild/make_infos.sh
new file mode 100755
index 0000000..4817e6a
--- /dev/null
+++ b/xibuild/make_infos.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+
+# TODO remember to update this if there are ever changes
+XIPKG_INFO_VERSION='02'
+
+get_info() {
+ local name=$(basename -s ".xipkg" $1)
+
+ local pkg_ver=$PKG_VER
+ [ -z "$pkg_ver" ] && pkg_ver=$BRANCH
+ [ -z "$pkg_ver" ] && pkg_ver="latest"
+
+ echo "# XiPKG info file version $XIPKG_INFO_VERSION"
+ echo "# automatically generated from the built packages"
+ echo "NAME=$name"
+ echo "DESCRIPTION=$DESC"
+ echo "PKG_FILE=$name.xipkg"
+ echo "CHECKSUM=$(md5sum $1 | awk '{ print $1 }')"
+ echo "VERSION=$pkg_ver"
+ echo "SOURCE=$SOURCE"
+ echo "DATE=$(date -r $1)"
+ echo "DEPS=(${DEPS[*]})"
+ echo "MAKE_DEPS=(${MAKE_DEPS[*]})"
+}
+
+sign () {
+ echo "SIGNATURE="
+ openssl dgst -sign $PRIV_KEY $1
+}
+
+list_line() {
+ local pkg_file=$1
+
+ local name=$(basename -s ".xipkg" $pkg_file)
+ local filecount=$(gzip -cd $pkg_file | tar -tvv | grep -c ^-)
+ local checksum=$(md5sum $pkg_file | awk '{ print $1 }')
+ local size=$(du -s $pkg_file | awk '{print $1}')
+
+ echo $name.xipkg $checksum $size $filecount
+}
+
+
+for repo in $(ls -d "$XIB_EXPORT"/repo/*); do
+ file="$repo/packages.list"
+ [ -e $file ] && rm $file
+ touch $file
+ echo "Removed old package lists in $repo"
+done
+
+for pkg in $(ls "$XIB_EXPORT"/repo/*/*.xipkg); do
+ name=$(basename -s ".xipkg" $pkg)
+ repo=$(echo $pkg | rev | cut -d/ -f2 | rev)
+ info_file="$XIB_EXPORT/repo/$repo/$name.xipkg.info"
+ build_file="$XIB_EXPORT/repo/$repo/$name.xibuild"
+
+ source $build_file
+
+ get_info $pkg > $info_file
+ sign $pkg >> $info_file
+ list_line $pkg >> "$XIB_EXPORT"/repo/$repo/packages.list
+ echo "Enlisted $name to $info_file"
+
+
+done
diff --git a/src/make_tools.sh b/xibuild/make_tools.sh
index e55e3d6..10b70b5 100755
--- a/src/make_tools.sh
+++ b/xibuild/make_tools.sh
@@ -18,6 +18,9 @@ export PATH=$SYSTEM_DIR/tools/bin:$PATH
export CONFIG_SITE=$SYSTEM_DIR/usr/share/config.site
export LC_ALL=POSIX
+set +h
+umask 022
+
packages=(binutils gcc linux glibc mpfr gmp mpc m4 ncurses bash coreutils diffutils file findutils gawk grep gzip make patch sed tar xz)
@@ -475,6 +478,10 @@ build_gcc2() {
cd $SOURCES/gcc/
rm -rf build
+ rm -rf mpc gmp mpfr
+ [ -d mpfr ] || cp -r $SOURCES/mpfr mpfr
+ [ -d gmp ] || cp -r $SOURCES/gmp gmp
+ [ -d mpc ] || cp -r $SOURCES/mpc mpc
mkdir -v build
cd build
@@ -547,55 +554,55 @@ reset_before_build "libstdcxx"
build_libstdcxx &> libstdcxx.build.log && printf "\033[0;32mpassed\n" || exit 1
reset_before_build "m4"
-build_m4 &> m4.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_m4 &> m4.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "ncurses"
-build_ncurses &> ncurses.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_ncurses &> ncurses.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "bash"
-build_bash &> bash.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_bash &> bash.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "coreutils"
-build_coreutils &> coreutils.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_coreutils &> coreutils.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "diffutils"
-build_diffutils &> diffutils.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_diffutils &> diffutils.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "file"
-build_file &> file.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_file &> file.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "findutils"
-build_findutils &> findutils.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_findutils &> findutils.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "gawk"
-build_gawk &> gawk.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_gawk &> gawk.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "grep"
-build_grep &> grep.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_grep &> grep.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "gzip"
-build_gzip &> gzip.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_gzip &> gzip.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "make"
-build_make &> make.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_make &> make.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "patch"
-build_patch &> patch.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_patch &> patch.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "sed"
-build_sed &> sed.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_sed &> sed.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "tar"
-build_tar &> tar.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_tar &> tar.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "xz"
-build_xz &> xz.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_xz &> xz.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "binutils2"
-build_binutils2 &> bintuils2.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_binutils2 &> bintuils2.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
reset_before_build "gcc2"
-build_gcc2 &> gcc2.build.log && printf "\033[0;32mpassed\n" || exit 1
+build_gcc2 &> gcc2.build.log && printf "\033[0;32mpassed\n" || printf "\0330;34mFAIL\n"
echo "DONE"