From 5f5313c63d269f1000fcd3d418ab0af79ae0e66b Mon Sep 17 00:00:00 2001 From: PktSurf Date: Fri, 21 Apr 2023 20:58:32 +0530 Subject: [PATCH] Removed llvm-runtimes from tmpfsexceptionlist array, added scanelf to rqfiles array in bldpkg.conf Discarded log script Added several fixes and build system checks to mksm --- bldpkg.conf | 4 ++-- log | 11 ----------- mksm | 33 ++++++++++++++++++++++++--------- 3 files changed, 26 insertions(+), 22 deletions(-) delete mode 100755 log diff --git a/bldpkg.conf b/bldpkg.conf index 76f80aa..b3fe16f 100644 --- a/bldpkg.conf +++ b/bldpkg.conf @@ -152,7 +152,7 @@ checkdependencies=0 tmpfsexceptionlist=( mozjs nodejs firefox wxwidgets palemoon qemu dovecot gdb gnumeric \ gtk+2 gtk+3 guile llvm mariadb mesa mesa-demos mupdf perl postfix python2 \ python3 rtorrent spice python-lxml kernel libreoffice mono \ -qtwebengine kernel-source rust webkitgtk boost go llvm-runtimes ) +qtwebengine kernel-source rust webkitgtk boost go ) # This array lists the packages which require additional swap for # compilation to prevent the system from becoming completely unresponsive @@ -174,7 +174,7 @@ protecteddirectories=( "/" "/bin" "/boot" "/dev" "/etc" "/home" "/include" \ rqfiles=( installpkg upgradepkg sha512sum patch find findmnt patch tput bc tar \ addr2line ar as c++ c++filt cc cpp elfedit g++ gcc gcc-ar gcc-nm gcc-ranlib gcov \ gcov-tool getconf gprof iconv ld ld.bfd nm objcopy objdump ranlib readelf size \ -strings strip ) +strings strip scanelf ) # Whether to output application build status in HTML format. Set 1 to enable, diff --git a/log b/log deleted file mode 100755 index 5fb6ae9..0000000 --- a/log +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Wrapper to redirect build output of an individual .SMBuild to a log file - -# Disable colours in the build summary. It looks nice in the terminal but not so good inside the actual build log. -SM_COLOURS=0 -export SM_COLOURS - -while [ $# -gt 0 ]; do - exec "$1" 2>&1 | tee -a "$1".buildlog - break -done diff --git a/mksm b/mksm index 3893463..dda5489 100755 --- a/mksm +++ b/mksm @@ -2,7 +2,7 @@ # Part of SMLinux distribution # Package build file generator -# Copyright (c) 2022 PktSurf +# Copyright (c) 2022-2023 PktSurf # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -19,6 +19,8 @@ # Abort on any error set -e +mksmversion="0.100" + # Date format filedate="$(date +%Y%m%d%H%M%S)" @@ -82,7 +84,6 @@ gensha512sums() { fi done printf '"' >> "$appname".SMBuild - exit 0 } while getopts ':a:b:v:h' option; do @@ -101,7 +102,6 @@ if [[ $OPTIND = 1 ]] ; then mkusage fi - # Show errors and exit if either of these is not set if [[ -z $envappname ]] ; then echo "[ERROR] Application name not provided. Please provide one." @@ -124,9 +124,10 @@ fi appname="$envappname" version="$envversion" -buildfile="$currentdir/$appname.SMBuild" +buildfile="$appname.SMBuild" -# Use case/esac to determine the value of envbuildsys supplied to us. If it isn't what's expected, throw an error and exit. +# Use case/esac to determine the value of envbuildsys supplied to us. If it isn't what's expected, +# throw an error and exit. case "$envbuildsys" in "autoconf"|"make"|"cmake"|"meson"|"guess") buildsys="$envbuildsys" ;; @@ -136,8 +137,7 @@ esac gen_autoconf() { cat << 'EOF' >> $buildfile ./configure \ - --prefix="" \ - --sysconfdir=/etc + --prefix="" make make install DESTDIR=$pkg @@ -215,6 +215,12 @@ gen_guess() { elif [[ -f Makefile ]] ; then echo "Looks like simple Makefile..." gen_make + elif [[ -f CMakeLists.txt ]] ; then + echo "Looks like a cmake system..." + gen_cmake + elif [[ -f meson.build ]] && [[ -f meson_options.txt ]] ; then + echo "Looks like meson build system..." + gen_meson fi else echo "Non-standard directory. Perhaps you might want to provide a definitive build system" @@ -233,7 +239,7 @@ echo "" # Copy the sample build file based on the build system argument passed if [[ -f $buildfile ]] ; then echo "[INFO] Found an existing $appname.SMBuild in the current directory." - echo "[INFO] Backing it up inside a directory 'old' and creating a new one here." + echo "[INFO] Backing it up inside a directory 'old' as '"$buildfile.$filedate"' and creating a new one here." mkdir -p old mv "$buildfile" old/"$buildfile.$filedate" fi @@ -242,6 +248,8 @@ fi # https://unix.stackexchange.com/questions/505949/expanding-only-certain-variables-inside-a-heredoc # Expand variables in this heredoc cat << EOF > $buildfile +# Maintainer: PktSurf +# Generated by mksm SMLinux build file generator version $mksmversion app=$appname version=$version build=1sml @@ -254,14 +262,16 @@ EOF # Single-quoted 'EOF' prevents variables from being expanded in this heredoc cat << 'EOF' >> $buildfile -build() { +prepbuilddir() { mkandenterbuilddir rm -rf $app-$version tar xf $srcdir/$app-$version.tar.?z* cd $app-$version fixbuilddirpermissions +} +build() { EOF case "$buildsys" in @@ -278,3 +288,8 @@ echo "" # Generate SHA512 checksums and exit gensha512sums + +echo +echo "'$buildfile' has been generated successfully." +echo "It is *STRONGLY RECOMMENDED* that you view '$buildfile'" +exit 0