From 22d522f6cd09e2c5f1678a0479be5dc19ca1eb15 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 28 Dec 2017 17:14:04 +0100 Subject: Replace cmake with sibs. Sibs builds itself now If you dont already have sibs to build sibs, download first release: https://github.com/DEC05EBA/sibs/archive/0.1.0.tar.gz Then you can install new version of sibs --- .gitignore | 14 ++------------ CMakeLists.txt | 24 ------------------------ backend/ninja/Ninja.cpp | 2 +- install.sh | 12 +++++------- project.conf | 7 ++++--- src/main.cpp | 2 ++ 6 files changed, 14 insertions(+), 47 deletions(-) delete mode 100644 CMakeLists.txt diff --git a/.gitignore b/.gitignore index f76c38c..5dc9509 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,2 @@ -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake -cmake-build-debug -.idea -build +sibs-build +.idea/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index a636daa..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.0.2) -project(sibs) - -set(CMAKE_CXX_STANDARD 11) - -set(SOURCE_FILES - external/xxhash.c - backend/ninja/Ninja.cpp - src/main.cpp - src/FileUtil.cpp - src/Conf.cpp - src/PkgConfig.cpp - src/Exec.cpp - src/GlobalLib.cpp - src/curl.cpp - src/Archive.cpp) - -find_package(CURL REQUIRED) -find_package(LibArchive REQUIRED) - -add_executable(sibs ${SOURCE_FILES}) - -include_directories(${CURL_INCLUDE_DIR} ${LibArchive_INCLUDE_DIR}) -target_link_libraries(sibs ${CURL_LIBRARIES} ${LibArchive_LIBRARIES}) \ No newline at end of file diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index ddc20dd..43ded44 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -30,7 +30,7 @@ namespace backend i = 0; for(const string &str : list) { - if(i > 0); + if(i > 0) result += joinStr; result += str; ++i; diff --git a/install.sh b/install.sh index ac18bf8..c73d777 100755 --- a/install.sh +++ b/install.sh @@ -2,10 +2,8 @@ set -e -scriptpath="$(dirname "$0")" -mkdir -p "$scriptpath/build/release" -cd "$scriptpath/build/release" -cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../../ -ninja -sudo cp sibs /usr/bin/ -echo "Copied $scriptpath/build/release/sibs to /usr/bin/sibs" +project_dir=`dirname $0` +sibs build $project_dir --release +sudo cp "$project_dir/sibs-build/release/sibs" "/usr/bin/sibs" +echo "Copied $project_dir/sibs-build/release/sibs to /usr/bin/sibs" +echo "Installation successful!" \ No newline at end of file diff --git a/project.conf b/project.conf index 96bb9b9..a6e811c 100644 --- a/project.conf +++ b/project.conf @@ -1,8 +1,9 @@ [package] name = "sibs" +type = "executable" version = "0.1.0" -authors = ["Aleksi Lindeman "] +authors = ["DEC05EBA <0xdec05eba@gmail.com>"] [dependencies] -sfml-all = "2.4" -xxhash = "0.1.0" \ No newline at end of file +libcurl = "7" +libarchive = "3.3" \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 0f20ea0..c9b1fe2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,6 +20,8 @@ using namespace sibs; // TODO: Places that use PATH_MAX should be modified. A path CAN be longer than PATH_MAX... (does this include replacing tinydir.h?) +// TODO: Remove install.sh when sibs supports installation of packages (so it can install itself) + void usage() { printf("Usage: sibs COMMAND\n\n"); -- cgit v1.2.3