diff --git a/uppbox/MakePosixInstall/Main.cpp b/uppbox/MakePosixInstall/Main.cpp index e55580e67..942e45a6d 100644 --- a/uppbox/MakePosixInstall/Main.cpp +++ b/uppbox/MakePosixInstall/Main.cpp @@ -125,6 +125,8 @@ CONSOLE_APP_MAIN Syx(GetHomeDirFile("bin/umk") + " uppsrc umk GCC -rvsM"); SaveFile(release + "/uMakefile", LoadFile(release + "/Makefile")); Syx(GetHomeDirFile("bin/umk") + " uppsrc ide GCC -rvsM theide"); + + system("cp " + GetHomeDirFile("upp.bin") + "/" + "*.udc " + release); chdir(release_dir); diff --git a/uppbox/MakePosixInstall/scripts.cpp b/uppbox/MakePosixInstall/scripts.cpp index 737c1f8c4..56f31a594 100644 --- a/uppbox/MakePosixInstall/scripts.cpp +++ b/uppbox/MakePosixInstall/scripts.cpp @@ -3,30 +3,35 @@ R"--(#!/usr/bin/env bash AskContinue() { - read -p "Continue (y/n)?" CONT - if ! [ "$CONT" = "y" ]; then + read -p "Continue (Y/n)?" answer + if [ "$answer" != "${answer//[nN]/x}" ]; then exit; fi } if [ -x "$(command -v apt-get)" ]; then echo 'Debian packaging system (apt-get) detected' - DEP="apt-get -y install g++ clang make libgtk-3-dev libnotify-dev libbz2-dev libssl-dev" + DEP="apt-get install g++ clang make libgtk-3-dev libnotify-dev libbz2-dev libssl-dev" fi if [ -x "$(command -v yum)" ]; then echo 'Fedora packaging system (yum) detected' - DEP="yum -y install gcc-c++ clang make gtk3-devel pango-devel atk-devel cairo-devel libnotify-devel bzip2-devel freetype-devel" + DEP="yum install gcc-c++ clang make gtk3-devel libnotify-devel bzip2-devel freetype-devel" fi if [ -x "$(command -v dnf)" ]; then echo 'Fedora packaging system (dnf) detected' - DEP="dnf -y install gcc-c++ clang make gtk3-devel pango-devel atk-devel cairo-devel libnotify-devel bzip2-devel freetype-devel" + DEP="dnf install gcc-c++ clang make gtk3-devel libnotify-devel bzip2-devel freetype-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" fi if [ -x "$(command -v zypper)" ]; then echo 'Zypper packaging system (dnf) detected' - DEP="sudo zypper -n install gtk3-devel libbz2-devel ne xorg-x11-server-devel ssl-devel gcc-c++ make libXdmcp-devel clang" + DEP="sudo zypper -n install clang make gtk3-devel libnotify-devel bzip2-devel freetype-devel" fi #add more packaging systems / distros here @@ -34,23 +39,39 @@ fi if [ -z "$DEP" ]; then echo Packaging system was not identified. echo Automatic dependency instalation has failed. + echo You will have to install required packages manually. + echo Please make sure that build dependecies are satisfied. AskContinue else - echo We will now try to install required packages. - echo Please enter your password so that we can do: + echo Following command should be used to install required packages: + echo echo sudo $DEP - - if ! eval 'sudo $DEP'; then - echo Failed to install all required packages - AskContinue + echo + echo Install script can run this command for you, but that will require + echo your sudo password. + read -p "Do you want the script to do that (Y/n)?" answer + if [ "$answer" == "${answer//[nN]/x}" ]; then + if ! eval 'sudo $DEP'; then + echo Failed to install all required packages. + echo You will have to install required packages manually. + AskContinue + fi + else + echo Please make sure that build dependecies are satisfied. fi fi -if ./umks32; then - echo Using umks32 to build - UMK="./umks32" -else - echo umks32 not available, building umk using make +if ./umks32 >/dev/null; then + echo + read -p "Use prebuilt binary umks32 to accelerate the build (Y/n)?" answer + if [ "$answer" == "${answer//[nN]/x}" ]; then + echo Using umks32 to build + UMK="./umks32" + fi +fi + +if [ -z "$UMK" ]; then + echo umks32 cannot be used, building umk using make make -f uMakefile -j 4 UMK="./umk" fi @@ -58,10 +79,17 @@ fi $UMK ./uppsrc ide CLANG -brs ./theide $UMK ./uppsrc umk CLANG -brs ./umk -echo Install process has been finished. Do you want to start theide now? -AskContinue +if [ -x ./theide ]; then + echo Install process has been finished, TheIDE is built as ./theide + read -p "Do you want to start TheIDE now? (Y/n):" answer + if [ "$answer" == "${answer//[nN]/x}" ]; then + ./theide + fi +else + echo Something went wrong. + echo Please use 'make' to compile theide and/or notify developers. +fi -./theide )--"; const char *clean_script = @@ -70,6 +98,6 @@ R"--(#!/usr/bin/env bash rm -rf .config/* rm -rf .cache/* -rm theide -rm umk +rm -f theide +rm -f umk )--"; diff --git a/uppsrc/Core/App.cpp b/uppsrc/Core/App.cpp index db8a90275..7a9417d88 100644 --- a/uppsrc/Core/App.cpp +++ b/uppsrc/Core/App.cpp @@ -150,6 +150,18 @@ void SetAppName(const String& name) sAppName = name; } +static String sConfigGroup = "u++"; + +void SetConfigGroup(const char *group) +{ + sConfigGroup = group; +} + +String GetConfigGroup() +{ + return sConfigGroup; +} + String GetTempDirectory() { return GetTempPath(); @@ -222,6 +234,8 @@ String ConfigFile(const char *file) { cfgdir = GetEnv("XDG_CONFIG_HOME"); if(IsNull(cfgdir) || !DirectoryExists(cfgdir)) cfgdir = GetHomeDirFile(".config"); + if(sConfigGroup.GetCount()) + cfgdir = AppendFileName(cfgdir, sConfigGroup); } String pp = AppendFileName(cfgdir, GetAppName()); RealizeDirectory(pp); diff --git a/uppsrc/Core/src.tpp/AppEnv_en-us.tpp b/uppsrc/Core/src.tpp/AppEnv_en-us.tpp index d309e50c0..349d364be 100644 --- a/uppsrc/Core/src.tpp/AppEnv_en-us.tpp +++ b/uppsrc/Core/src.tpp/AppEnv_en-us.tpp @@ -64,6 +64,19 @@ onst]_[_^Upp`:`:String^ String][@(0.0.255) `&]_[*@3 name])&] [s2;%% Overrides the name of the application.&] [s3;%% &] [s4; &] +[s5;:Upp`:`:SetConfigGroup`(const char`*`): [@(0.0.255) void]_[* SetConfigGroup]([@(0.0.255) c +onst]_[@(0.0.255) char]_`*[*@3 group])&] +[s2;%% In POSIX systems, ConfigFile function default path is inside +`".cache`" directory. This function allows to set a name of subdirectory +of this directory where the another subdirectory named GetAppName() +specific to the application will store the configuration. Setting +group empty just removes whole level. Default value is `"u`+`+`".&] +[s3;%% &] +[s4; &] +[s5;:Upp`:`:GetConfigGroup`(`): [_^Upp`:`:String^ String]_[* GetConfigGroup]()&] +[s2;%% Returns current config group.&] +[s3; &] +[s4; &] [s5;:Upp`:`:GetTempDirectory`(`): [_^Upp`:`:String^ String]_[* GetTempDirectory]()&] [s2;%% Return the temporary directory.&] [s3; &] diff --git a/uppsrc/ide/Builders/Install.cpp b/uppsrc/ide/Builders/Install.cpp index dbc0e5736..d338a1e2a 100644 --- a/uppsrc/ide/Builders/Install.cpp +++ b/uppsrc/ide/Builders/Install.cpp @@ -127,4 +127,11 @@ String GetDefaultUppOut() return out; } -#endif +#else + +String GetDefaultUppOut() +{ + return ConfigFile("_out"); +} + +#endif \ No newline at end of file diff --git a/uppsrc/ide/Install.cpp b/uppsrc/ide/Install.cpp index ae6171eff..9d227efd4 100644 --- a/uppsrc/ide/Install.cpp +++ b/uppsrc/ide/Install.cpp @@ -1,7 +1,7 @@ #include "ide.h" //#include "Install.h" -#ifndef PLATFORM_WIN32 +#ifdef PLATFORM_POSIX bool Install(bool& hasvars) { diff --git a/uppsrc/ide/InstantSetup.cpp b/uppsrc/ide/InstantSetup.cpp index a0c3e9795..aed53079d 100644 --- a/uppsrc/ide/InstantSetup.cpp +++ b/uppsrc/ide/InstantSetup.cpp @@ -126,7 +126,7 @@ void InstantSetup() String bin = GetExeDirFile("bin"); - if(DirectoryExists(bin + "/clang")) // hopefully deprecated, but keep it for now + if(DirectoryExists(bin + "/clang")) for(int x64 = 0; x64 < 2; x64++) { String method = x64 ? "CLANGx64" : "CLANG"; #ifdef INSTANT_TESTING diff --git a/uppsrc/ide/OutputMode.cpp b/uppsrc/ide/OutputMode.cpp index 020442bad..d2d1204d0 100644 --- a/uppsrc/ide/OutputMode.cpp +++ b/uppsrc/ide/OutputMode.cpp @@ -483,11 +483,8 @@ void Ide::SetupDefaultMethod() if(IsNull(method)) { SetMethod(GetDefaultMethod()); if(IsNull(method)) { - if(FileExists(ConfigFile("MSC14.bm"))) - SetMethod("MSC14"); - else - if(FileExists(ConfigFile("MSC15.bm"))) - SetMethod("MSC15"); + if(FileExists(ConfigFile("CLANG.bm"))) + SetMethod("CLANG"); else if(FileExists(ConfigFile("GCC.bm"))) SetMethod("GCC");