From ad1f299bfc32bf593f4e11ca3077b092233566bf Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 5 Apr 2020 15:41:18 +0000 Subject: [PATCH] .uppbox git-svn-id: svn://ultimatepp.org/upp/trunk@14236 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppbox/MakePosixInstall/Main.cpp | 22 +++++++++----------- uppbox/MakePosixInstall/MakePosixInstall.upp | 1 + uppbox/MakePosixInstall/readme.cpp | 19 +++++++++++++++++ uppbox/MakePosixInstall/scripts.cpp | 11 +++++----- 4 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 uppbox/MakePosixInstall/readme.cpp diff --git a/uppbox/MakePosixInstall/Main.cpp b/uppbox/MakePosixInstall/Main.cpp index 942e45a6d..040e399e1 100644 --- a/uppbox/MakePosixInstall/Main.cpp +++ b/uppbox/MakePosixInstall/Main.cpp @@ -62,23 +62,20 @@ String release_dir = GetHomeDirFile("release"); String release = release_dir + "/upp"; String upp_src = GetHomeDirFile("upp.src"); -int NoDigit(int c) { return IsDigit(c) ? 0 : c; } -int FilterVersion(int c) { return c == ':' ? '_' : c; } - -void Make(String pkg, String exe, String method = "MINGW") -{ -// Syx("c:/upp/umk " + ass + " " + pkg + " c:/upp/" + method + ".bm -arv " + upptmp + "/" + exe); -// FileDelete(upptmp + "/" + ForceExt(exe, ".map")); -} - extern const char *install_script; extern const char *clean_script; +extern const char *readme; -void SaveScript(const char *name, const char *text) +String SaveText(const char *name, const char *text) { String t = release + "/" + name; SaveFile(t, Filter(text, [](int c) { return c == '\r' ? 0 : c; })); - Syx("chmod +x " + t); + return t; +} + +void SaveScript(const char *name, const char *text) +{ + Syx("chmod +x " + SaveText(name, text)); } CONSOLE_APP_MAIN @@ -86,7 +83,7 @@ CONSOLE_APP_MAIN StdLogSetup(LOG_COUT|LOG_FILE); Syx("svn update " + upp_src); - Vector s = Split(Syx("svnversion " + upp_src), NoDigit); + Vector s = Split(Syx("svnversion " + upp_src), [](int c) { return IsDigit(c) ? 0 : c; }); if(s.GetCount() == 0) Error("Invalid version"); String version = s.Top(); @@ -113,6 +110,7 @@ CONSOLE_APP_MAIN SaveScript("install", install_script); SaveScript("clean", clean_script); + SaveText("README", readme); #ifdef _DEBUG #define OPTS " -rvb " diff --git a/uppbox/MakePosixInstall/MakePosixInstall.upp b/uppbox/MakePosixInstall/MakePosixInstall.upp index 8e1c9e566..d986aefff 100644 --- a/uppbox/MakePosixInstall/MakePosixInstall.upp +++ b/uppbox/MakePosixInstall/MakePosixInstall.upp @@ -7,6 +7,7 @@ uses file scripts.cpp, + readme.cpp, Main.cpp; mainconfig diff --git a/uppbox/MakePosixInstall/readme.cpp b/uppbox/MakePosixInstall/readme.cpp new file mode 100644 index 000000000..2ec6c1d9e --- /dev/null +++ b/uppbox/MakePosixInstall/readme.cpp @@ -0,0 +1,19 @@ +const char *readme = +R"--(U++ is rapid C++ based development framework and environment. + +To start working with U++, you will have to install dependecies for your +platform and compile TheIDE. + +You can do this manually - install dependencies and run "make". This will +create 'ide' executable in current directory. + +Alternatively, there is 'install' script which will attempt to identify +your distro's packaging system, install required packages and then do the +required compilation. It will even try to use precompiled utility 'umks32' +to accelerate the build, if you allow it. + +After the installation, you can start using U++ be starting TheIDE. +The framework is designed to stay sandboxed - as long you do not copy binaries +from the unpacked archive, it would not write anything outside it. +)--"; + diff --git a/uppbox/MakePosixInstall/scripts.cpp b/uppbox/MakePosixInstall/scripts.cpp index 56f31a594..9e0349982 100644 --- a/uppbox/MakePosixInstall/scripts.cpp +++ b/uppbox/MakePosixInstall/scripts.cpp @@ -16,22 +16,22 @@ fi if [ -x "$(command -v yum)" ]; then echo 'Fedora packaging system (yum) detected' - DEP="yum install gcc-c++ clang make gtk3-devel libnotify-devel bzip2-devel freetype-devel" + DEP="yum install gcc-c++ clang make gtk3-devel libnotify-devel bzip2-devel freetype-devel openssl-devel" fi if [ -x "$(command -v dnf)" ]; then echo 'Fedora packaging system (dnf) detected' - DEP="dnf install gcc-c++ clang make gtk3-devel libnotify-devel bzip2-devel freetype-devel" + DEP="dnf install gcc-c++ clang make gtk3-devel libnotify-devel bzip2-devel freetype-devel openssl-devel" fi if [ -x "$(command -v urpmi)" ]; then echo 'Mandriva packaging system (urpmi) detected' - DEP="urpmi install gcc-c++ clang make gtk3-devel libnotify-devel bzip2-devel freetype-devel" + DEP="urpmi install gcc-c++ clang make gtk3-devel libnotify-devel bzip2-devel freetype-devel openssl-devel" fi if [ -x "$(command -v zypper)" ]; then - echo 'Zypper packaging system (dnf) detected' - DEP="sudo zypper -n install clang make gtk3-devel libnotify-devel bzip2-devel freetype-devel" + echo 'Zypper packaging system (zypper) detected' + DEP="sudo zypper install clang make gtk3-devel libnotify-devel bzip2-devel freetype-devel openssl-devel" fi #add more packaging systems / distros here @@ -58,6 +58,7 @@ else fi else echo Please make sure that build dependecies are satisfied. + AskContinue fi fi