mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 14:32:22 +08:00
♻ update fmtlib
This commit is contained in:
parent
fd4b3f3126
commit
e00167d3b9
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@
|
||||
*.ctu-info
|
||||
.cache
|
||||
.idea
|
||||
build.sh
|
||||
build
|
||||
cmake-build-release
|
||||
cmake-build-debug
|
||||
|
@ -41,7 +41,7 @@ FetchContent_Declare(ftxui
|
||||
)
|
||||
FetchContent_Declare(fmt
|
||||
GIT_REPOSITORY "https://github.com/fmtlib/fmt.git"
|
||||
GIT_TAG "c06bef7273e594bfa91739e29d339fba51fd4e0e"
|
||||
GIT_TAG "a7aecbfcaa0e1586da9cf8175bd8d1c4383acd8c"
|
||||
)
|
||||
FetchContent_MakeAvailable(fmt)
|
||||
FetchContent_Declare(spdlog
|
||||
|
98
configure.sh
Executable file
98
configure.sh
Executable file
@ -0,0 +1,98 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2022 Vladislav Nepogodin
|
||||
#
|
||||
# This file is part of CachyOS CLI.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
set -e
|
||||
|
||||
cd "`dirname "$0"`"
|
||||
|
||||
if [[ $1 == "--help" ]]; then
|
||||
cat<<EOF
|
||||
Usage: configure.sh [options]
|
||||
Options:
|
||||
--help Display this information.
|
||||
--buildtype=, -t= Specify build type.
|
||||
--prefix= Specify install prefix.
|
||||
--libdir= Specify lib directory.
|
||||
--path=, -p= Specify build directory.
|
||||
EOF
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
_buildpath="build"
|
||||
_prefix="/usr/local"
|
||||
_libdir="lib"
|
||||
_buildtype="RelWithDebInfo"
|
||||
for i in "$@"; do
|
||||
case $i in
|
||||
-t=*|--buildtype=*)
|
||||
_buildtype="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--prefix=*)
|
||||
_prefix="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--libdir=*)
|
||||
_libdir="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
-p=*|--path=*)
|
||||
_buildpath="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
cmake -S . -B ${_buildpath}/${_buildtype} \
|
||||
-DCMAKE_BUILD_TYPE=${_buildtype} \
|
||||
-DCMAKE_INSTALL_PREFIX=${_prefix} \
|
||||
-DCMAKE_INSTALL_LIBDIR=${_libdir}
|
||||
|
||||
cat > build.sh <<EOF
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2022 Vladislav Nepogodin
|
||||
#
|
||||
# This file is part of CachyOS CLI.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
set -e
|
||||
|
||||
cd "\`dirname "\$0"\`"
|
||||
|
||||
cmake --build ${_buildpath}/${_buildtype} --parallel $(nproc)
|
||||
EOF
|
||||
|
||||
chmod +x ./build.sh
|
@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/fmtlib/fmt.git
|
||||
revision = c06bef7273e594bfa91739e29d339fba51fd4e0e
|
||||
revision = a7aecbfcaa0e1586da9cf8175bd8d1c4383acd8c
|
||||
|
||||
patch_directory = fmt
|
||||
|
||||
|
102
toolbox.sh
102
toolbox.sh
@ -1,102 +0,0 @@
|
||||
#!/bin/bash
|
||||
clear
|
||||
|
||||
binName="cachyos-installer"
|
||||
|
||||
if [[ $EUID -eq 0 ]]; then
|
||||
echoRed "You cannot run this as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function run() {
|
||||
sudo $binName
|
||||
}
|
||||
|
||||
function build() {
|
||||
echoGreen "Building CachyOS Installer..."
|
||||
|
||||
if [[ ! -d "cmake-build-release" ]]; then
|
||||
mkdir -p cmake-build-release
|
||||
fi
|
||||
|
||||
cd cmake-build-release || return
|
||||
cmake -D CMAKE_BUILD_TYPE=Release ..
|
||||
make -j "$(nproc --all)"
|
||||
sudo cp -rf $binName /usr/bin/$binName
|
||||
cd ..
|
||||
}
|
||||
|
||||
function buildDebug() {
|
||||
echoOrange "Building CachyOS Installer in debug..."
|
||||
|
||||
if [[ ! -d "cmake-build-debug" ]]; then
|
||||
mkdir -p cmake-build-debug
|
||||
fi
|
||||
|
||||
cd cmake-build-debug || return
|
||||
cmake -D CMAKE_BUILD_TYPE=Debug ..
|
||||
make -j "$(nproc --all)"
|
||||
sudo cp -rf $binName /usr/bin/$binName
|
||||
cd ..
|
||||
}
|
||||
|
||||
function pull() {
|
||||
git pull
|
||||
}
|
||||
|
||||
function echoOrange() {
|
||||
echo -e "\\e[33m$*\\e[0m"
|
||||
}
|
||||
|
||||
function echoRed() {
|
||||
echo -e "\\e[31m$*\\e[0m"
|
||||
}
|
||||
|
||||
function echoGreen() {
|
||||
echo -e "\\e[32m$*\\e[0m"
|
||||
}
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
keys="$1"
|
||||
case $keys in
|
||||
-r | --run)
|
||||
run
|
||||
shift
|
||||
;;
|
||||
-b | --build)
|
||||
build
|
||||
shift
|
||||
;;
|
||||
-bd | --build_debug)
|
||||
buildDebug
|
||||
shift
|
||||
;;
|
||||
-p | --pull)
|
||||
pull
|
||||
shift
|
||||
;;
|
||||
-h | --help)
|
||||
echo "
|
||||
Toolbox script for CachyOS-Installer
|
||||
=============================================================================================
|
||||
| Argument | Description |
|
||||
| -------------------- | -------------------------------------------------------------------|
|
||||
| -r (--run) | Run the built binary. |
|
||||
| -b (--build) | Build and install. |
|
||||
| -bd (--build_debug) | Build and install as debug. |
|
||||
| -p (--pull) | Update from repo. |
|
||||
| -h (--help) | Show help. |
|
||||
=============================================================================================
|
||||
|
||||
All args are executed in the order they are written in, for
|
||||
example, \"-p -b -r\" would update the software, then build it, and
|
||||
then run it.
|
||||
"
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
echo "Unknown arg $1, use -h for help"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
done
|
Loading…
Reference in New Issue
Block a user