From ce5f0aaa6397173fa6bcddb96ee2a1ee4434f23b Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sat, 7 Oct 2023 13:42:59 -0600 Subject: [PATCH 01/39] Created initial PKGBUILD and Dockerfile - Update `bin/compile.sh` to generate sha256sums from binaries --- Dockerfile | 11 +++++++++++ PKGBUILD | 22 ++++++++++++++++++++++ bin/compile.sh | 7 +++++++ 3 files changed, 40 insertions(+) create mode 100644 Dockerfile create mode 100644 PKGBUILD diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..75ad5c7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM cgr.dev/chainguard/wolfi-base + +RUN apk add --no-cache tini + +USER 65534:65534 + +COPY build/gdpm.static /gdpm + +CMD ["/gdpm"] + +ENTRYPOINT [ "/sbin/tini", "--" ] \ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..80f8cdb --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,22 @@ +# Maintainer: David J. Allen +pkgname=gdpm +pkgver=0.0.1 +pkgrel=1 +pkgdesc="CLI tool to automate managing Godot game engine assets from the command-line. This includes a pre-built, static binary." +arch=('x86_64') +url="https://github.com/davidallendj/gdpm" +license=('MIT') +#groups= +depends=('glibc') +makedepends=('cmake', 'make', 'clang') +source=("https://github.com/davidallendj/gdpm/releases/download/v$pkgver/$pkgname.static.$arch.linux.static") +sha256sums=('012e3c32511d6d762ac070808e8bcae7f68dd261bf1cad3dbf4607c97aa1bb3d') + +build () { + # shouldn't need to build anything with static binary... +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + make DESTDIR="$pkgdir/" install +} \ No newline at end of file diff --git a/bin/compile.sh b/bin/compile.sh index 3042f09..ce05fd9 100755 --- a/bin/compile.sh +++ b/bin/compile.sh @@ -53,6 +53,12 @@ function clean(){ rm ${script_dir}/../bin/$tests } +function checksums(){ + sha256sums ${script_dir}/../bin/$exe + sha256sums ${script_dir}/../bin/$static + sha256sums ${script_dir}/../bin/$tests +} + # Run this script at project root #meson configure build #CXX=clang++ meson compile -C build -j$(proc) @@ -118,6 +124,7 @@ do --exe) build_exe shift;; --libs) build_libs shift;; --tests) build_tests shift;; + --sums) checksums shift;; -d|--docs) build_docs shift;; -c|--clean) clean shift;; -s|--strip) strip_all shift;; From d9a9ea642617d75268fffc0315d729704cd54ffe Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sat, 7 Oct 2023 13:46:39 -0600 Subject: [PATCH 02/39] Updated `README.md` --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 95e2517..55a4755 100644 --- a/README.md +++ b/README.md @@ -338,7 +338,9 @@ $ gdpm config set username towk - [x] Parallel downloading. -- [ ] PKGBUILD for ArchLinux/Manjaro. +- [X] PKGBUILD for ArchLinux/Manjaro. + +- [X] Dockerfile to run in sandbox. - [ ] Proper updating. From d2a77fe28f965ad9b147f0472082b910fb2ead2f Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sat, 27 Jan 2024 14:34:17 -0700 Subject: [PATCH 03/39] Bump default godot version for search - Change error code from `NONE` TO `IGNORE` - Added format function to utils - Implement version functions --- include/error.hpp | 4 ++-- include/rest_api.hpp | 2 +- include/utils.hpp | 6 ++++++ include/version.hpp | 18 ++++++++++++------ src/config.cpp | 2 +- src/version.cpp | 29 ++++++++++++++++++++++++----- 6 files changed, 46 insertions(+), 15 deletions(-) diff --git a/include/error.hpp b/include/error.hpp index 59bacb3..8ce1b33 100644 --- a/include/error.hpp +++ b/include/error.hpp @@ -11,7 +11,7 @@ namespace gdpm::constants::error{ enum class ec{ - NONE = 0, + IGNORE = 0, UNKNOWN, UNKNOWN_COMMAND, UNKNOWN_ARGUMENT, @@ -93,7 +93,7 @@ namespace gdpm{ namespace ce = constants::error; class error { public: - constexpr explicit error(ec code = ec::NONE, const string& message = "{default}"): + constexpr explicit error(ec code = ec::IGNORE, const string& message = "{default}"): m_code(code), m_message(utils::replace_all(message, "{default}", ce::get_message(code))) {} diff --git a/include/rest_api.hpp b/include/rest_api.hpp index efcc351..0c11c1f 100644 --- a/include/rest_api.hpp +++ b/include/rest_api.hpp @@ -53,7 +53,7 @@ namespace gdpm::rest_api{ int support; string user = ""; string cost = ""; - string godot_version = "4.0"; + string godot_version = "4.3"; int max_results = 500; int page; int offset; diff --git a/include/utils.hpp b/include/utils.hpp index 3a75be3..dfebb51 100644 --- a/include/utils.hpp +++ b/include/utils.hpp @@ -78,6 +78,11 @@ namespace gdpm::utils { return a; } + template + std::string format(std::string_view fmt, Args&&...args){ + return std::vformat(fmt, std::make_format_args(args...)); + } + bool to_bool(const std::string& s); std::vector split_lines(const std::string& contents); std::string readfile(const std::string& path); @@ -97,6 +102,7 @@ namespace gdpm::utils { std::string join(const std::vector& target, const std::string& delimiter = ", "); std::string join(const std::unordered_map& target, const std::string& prefix = "", const std::string& delimiter = "\n"); std::string convert_size(long size); + // TODO: Add function to get size of decompressed zip namespace json { diff --git a/include/version.hpp b/include/version.hpp index b06715f..d267b2c 100644 --- a/include/version.hpp +++ b/include/version.hpp @@ -1,14 +1,20 @@ #pragma once +#include "error.hpp" +#include "result.hpp" + #include + namespace gdpm::version{ - struct version_context{ - int major; - int minor; - int patch; + struct context{ + int major = 0; + int minor = 0; + int patch = 0; + string commit = ""; }; - std::string to_string(const version_context& context); - version_context to_version(const std::string& version); + std::string to_string(const context& context); + result_t to_version(const std::string& version); + bool is_valid_version_string(const std::string& version); } \ No newline at end of file diff --git a/src/config.cpp b/src/config.cpp index c501b31..fc00107 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -343,7 +343,7 @@ namespace gdpm::config{ error.set_message("Key `remote_sources` is not a JSON object."); return error; } - error.set_code(ec::NONE); + error.set_code(ec::IGNORE); return error; } diff --git a/src/version.cpp b/src/version.cpp index 167f502..9cf8922 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -1,16 +1,35 @@ + #include "version.hpp" +#include + namespace gdpm::version{ + + void print(){ + + } - std::string to_string(const version_context& context){ - return std::string(); + string to_string(const context& c){ + return utils::format("{}.{}.{}", c.major, c.minor, c.patch); } - version_context to_version(const std::string& version){ - version_context v; + result_t to_version(const string& version){ + context v; - return v; + // check if string is valid + if(!is_valid_version_string(version)){ + return result_t(context(), error(ec::IGNORE, "invalid version string")); + } + + // convert string to version context + + + return result_t(v, error()); + } + + bool is_valid_version_string(const string &version){ + return std::regex_match(version, std::regex("^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$")); } } \ No newline at end of file From 4b0ded6b5bbcb3bf3bbc2cd226795fd38200e822 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 3 Mar 2024 19:11:11 -0700 Subject: [PATCH 04/39] Removed Poco as dependencies --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d784e7c..60ccd92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ find_package(RapidJSON CONFIG REQUIRED) find_package(fmt CONFIG REQUIRED) find_package(Catch2 CONFIG REQUIRED) find_package(cxxopts CONFIG REQUIRED) -find_package(Poco CONFIG REQUIRED COMPONENTS Net JSON Util) +#find_package(Poco CONFIG REQUIRED COMPONENTS Net JSON Util) find_package(libzip CONFIG REQUIRED) find_package(SQLiteCpp CONFIG REQUIRED) @@ -36,6 +36,9 @@ set(INCLUDE_DIRS "include" "/usr/include/doctest" ${RAPIDJSON_INCLUDE_DIRS} + # Poco::Net + # Poco::JSON + #Poco::Util ) set(LINK_LIBS fmt::fmt @@ -43,6 +46,9 @@ set(LINK_LIBS Catch2::Catch2 cxxopts::cxxopts SQLiteCpp + #Poco::Net + #Poco::JSON + #Poco::Util -lcurlpp -lzip -lsqlite3 From 644d79a7e47522ae6966ca04634c701633083b12 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 3 Mar 2024 19:17:36 -0700 Subject: [PATCH 05/39] Updated bin/compile.sh script to build with newer version of CMake --- bin/compile.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/compile.sh b/bin/compile.sh index ce05fd9..43da9f6 100755 --- a/bin/compile.sh +++ b/bin/compile.sh @@ -78,6 +78,7 @@ function build_all(){ function build_exe(){ mkdir -p build $CMAKE_COMMAND \ + --build . \ --target gdpm \ --target gdpm.static $NINJA_COMMAND @@ -87,6 +88,7 @@ function build_exe(){ function build_libs(){ mkdir -p build $CMAKE_COMMAND \ + --build . \ --target gdpm-static \ --target gdpm-shared \ --target gdpm-http \ @@ -96,7 +98,7 @@ function build_libs(){ function build_tests(){ mkdir -p build - $CMAKE_COMMAND --target gdpm.tests + $CMAKE_COMMAND --build . --target gdpm.tests $NINJA_COMMAND } From 6141f7af8bf923652e625f968f8f23798854f403 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 3 Mar 2024 19:21:23 -0700 Subject: [PATCH 06/39] Updated README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55a4755..17d00e4 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,7 @@ The `gdpm` command takes a single subcommand argument such as `install`, `remove ### Installing, Removing, Updating, and Listing -Packages can be installed using the `install` command with a list of package names or by providing a one-package-name-per-line file using the `-f/--file` option. The `-f/--file` option is compatible with the package list using the `export` command. +Packages can be installed using the `install` command with a list of package names or by providing a one-package-name-per-line file using the `-f/--file` option. The `-f/--file` option is compatible with the package list using the `export` command. (Note: You might have to run a `gdpm fetch` to update the local cache database to install assets.) Installation behavior can be adjusted using other flags like `--sync=disable`, `--cache=disable`, `-y/--skip-prompt`, or `--clean`. Use the `-j/--jobs` flag to download multiple packages in parallel. From 396ec234cf5540f534e1a32251587f9b1c32a088 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 3 Mar 2024 19:24:49 -0700 Subject: [PATCH 07/39] Updated README.md --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 17d00e4..d3dbab6 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,7 @@ The `gdpm` command takes a single subcommand argument such as `install`, `remove ### Installing, Removing, Updating, and Listing -Packages can be installed using the `install` command with a list of package names or by providing a one-package-name-per-line file using the `-f/--file` option. The `-f/--file` option is compatible with the package list using the `export` command. (Note: You might have to run a `gdpm fetch` to update the local cache database to install assets.) +Packages can be installed using the `install` command with a list of package names or by providing a one-package-name-per-line file using the `-f/--file` option. The `-f/--file` option is compatible with the package list using the `export` command. Installation behavior can be adjusted using other flags like `--sync=disable`, `--cache=disable`, `-y/--skip-prompt`, or `--clean`. Use the `-j/--jobs` flag to download multiple packages in parallel. @@ -227,6 +227,19 @@ $ gdpm export path/to/packages.txt $ gdpm install -f path/to/packages.txt --sync=disable --skip-prompt ``` +If you get a "no packages found to install" error message, try doing a `gdpm fetch` to update the local cache database, then try again. + +```bash +$ gdpm install "Godot Jolt" +[ERROR 07:18:41 PM; 2024-03-03] package::install(): no packages found to install. +$ gdpm fetch  ✔ +[INFO 07:19:19 PM; 2024-03-03] Sychronizing database...Done. +$ gdpm install "Godot Jolt"  ✔ + Title Author Category Version Godot Last Modified Installed? + Godot Jolt mihe Misc 16 4.2 2024-01-08 11:10:46 ❌ +Do you want to install these packages? (Y/n) +``` + If you leave out the `--skip-prompt` flag, hit enter to install by default. ```bash From d4b8c7ea368dd777d331a9abd5f51f11183fed99 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 3 Mar 2024 19:27:52 -0700 Subject: [PATCH 08/39] Updated README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d3dbab6..def5519 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,8 @@ The local database stores all the information sent by the Asset API with additio * Export list of installed packages to reinstall later. +* Parallel downloads using `libcurl`. + ## Building from Source The project uses the CMake or Meson build system and has been tested with GCC and Clang on Arch/Manjaro Linux. CMake is preferred, but a `meson.build` script is provided and should work with some tweaking. Building on Windows or Mac has not been tested yet so it's not guaranteed to work. Compiling with CMake will build 2 executables, 3 shared libraries, and an archive library to link, while compiling with Meson only builds an executable that links with a shared library. From 14dd5a1c7adb4c5fb0998f5cdc79cb832dfbb340 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Tue, 7 May 2024 22:16:27 -0600 Subject: [PATCH 09/39] Updated README.md with Arch Linux install packages --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index def5519..0f94566 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,12 @@ The project uses the CMake or Meson build system and has been tested with GCC an * Doxygen (optional; to generate API docs) +Arch Linux users can simply install required libs through pacman: + +```bash +pacman -S base-devel fmt sqlite3 rapidjson cmake libzip curl +``` + After installing all necessary dependencies, build the project:: ```bash From 2e9da2582a195f7da8cea57b16aed48eaaf361b9 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Tue, 7 May 2024 22:17:46 -0600 Subject: [PATCH 10/39] Removed trunk related files --- .trunk/actions | 1 - .trunk/notifications | 1 - 2 files changed, 2 deletions(-) delete mode 120000 .trunk/actions delete mode 120000 .trunk/notifications diff --git a/.trunk/actions b/.trunk/actions deleted file mode 120000 index 2dc78ea..0000000 --- a/.trunk/actions +++ /dev/null @@ -1 +0,0 @@ -/home/david/.cache/trunk/repos/4c139ff7a07a0441c956056eef1736ac/actions \ No newline at end of file diff --git a/.trunk/notifications b/.trunk/notifications deleted file mode 120000 index 510975e..0000000 --- a/.trunk/notifications +++ /dev/null @@ -1 +0,0 @@ -/home/david/.cache/trunk/repos/4c139ff7a07a0441c956056eef1736ac/notifications \ No newline at end of file From 3eacaf1d727f3758b57438f83850dc9ba9350990 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Tue, 7 May 2024 22:22:38 -0600 Subject: [PATCH 11/39] Removed .trunk directory --- .trunk/.gitignore | 3 --- .trunk/trunk.yaml | 11 ----------- 2 files changed, 14 deletions(-) delete mode 100644 .trunk/.gitignore delete mode 100644 .trunk/trunk.yaml diff --git a/.trunk/.gitignore b/.trunk/.gitignore deleted file mode 100644 index 507283d..0000000 --- a/.trunk/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*out -*logs -external diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml deleted file mode 100644 index 9a42b42..0000000 --- a/.trunk/trunk.yaml +++ /dev/null @@ -1,11 +0,0 @@ -version: 0.1 -cli: - version: 1.2.1 -lint: - enabled: - - git-diff-check@SYSTEM - - gitleaks@8.9.0 - - markdownlint@0.32.1 - - prettier@2.7.1 - - shellcheck@0.8.0 - - shfmt@3.5.0 From 23b27bf27646dabfaafcf4269efc5d0240e9aad7 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Tue, 7 May 2024 22:36:49 -0600 Subject: [PATCH 12/39] Tidied README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0f94566..077ab92 100644 --- a/README.md +++ b/README.md @@ -378,12 +378,10 @@ $ gdpm config set username towk - [ ] Experimental dependency management. There is no way of handling dependencies using the Godot Asset API. This is a [hot topic](https://github.com/godotengine/godot-proposals/issues/142) and might change in the near future. ## Known Issues -* The code is currently still changing so API is unstable. - -* Logging doesn't write to file. +* Logging doesn't write to file yet. * Download progress bars are not showing when downloading archives. This is being reworked to display multiple bars dynamically to better show download status. ## License -See the LICENSE.md file. +See the `LICENSE.md` file. From 13da8c03f20d5a782e899b0609f70ac6d7ea1aec Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Tue, 7 May 2024 22:37:58 -0600 Subject: [PATCH 13/39] More README tidying --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 077ab92..aff82c9 100644 --- a/README.md +++ b/README.md @@ -373,6 +373,8 @@ $ gdpm config set username towk - [ ] Adapted to new Asset API. +- [ ] Unit tests. + - [ ] User interface. - [ ] Experimental dependency management. There is no way of handling dependencies using the Godot Asset API. This is a [hot topic](https://github.com/godotengine/godot-proposals/issues/142) and might change in the near future. From 846bc4932f8b33628f774140b733dc96afc1e6bb Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 9 Jun 2024 00:07:14 -0600 Subject: [PATCH 14/39] Updated README.md to include getting deps and linking headers --- README.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aff82c9..ea1fe28 100644 --- a/README.md +++ b/README.md @@ -118,19 +118,34 @@ The project uses the CMake or Meson build system and has been tested with GCC an * fmt (may be removed later in favor of C++20 std::format) -* SQLite 3 +* SQLite 3 and SQLite C++ wrapper + +* cxxopts * doctest (optional; for tests, but still WIP) * Doxygen (optional; to generate API docs) -Arch Linux users can simply install required libs through pacman: +Arch Linux users can simply install required libs through `pacman` and/or `yay`: ```bash -pacman -S base-devel fmt sqlite3 rapidjson cmake libzip curl +pacman -S base-devel fmt sqlite rapidjson cmake libzip curl catch2 cxxopts +yay -S sqlitecpp curlcpp ``` -After installing all necessary dependencies, build the project:: +After installing the packages, clone the submodules and link the headers: + +```bash +git submodule add https://github.com/p-ranav/argparse modules/argparse +git submodule add https://github.com/p-ranav/tabulate modules/tabulate +git submodule add https://github.com/p-ranav/indicators modules/indicators + +ln -s ../modules/argparse/include/argparse include/argparse +ln -s ../modules/tabulate/include/tabulate include/tabulate +ln -s ../modules/indicators/include/indicators include/indicators +``` + +And then build the project: ```bash # Start by cloning the repo, then... From e225312197e917a87fa5812c542f3f2b21724ff4 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 9 Jun 2024 00:09:20 -0600 Subject: [PATCH 15/39] Fixed curl C++ wrapper library from AUR --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea1fe28..9836a3f 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ Arch Linux users can simply install required libs through `pacman` and/or `yay`: ```bash pacman -S base-devel fmt sqlite rapidjson cmake libzip curl catch2 cxxopts -yay -S sqlitecpp curlcpp +yay -S sqlitecpp libcurlpp ``` After installing the packages, clone the submodules and link the headers: From 050b7a482bab9e60799ac2a9f77b2212b74cf2ea Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 9 Jun 2024 00:11:44 -0600 Subject: [PATCH 16/39] Added more needed dependencies --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9836a3f..bf4ce4b 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ The project uses the CMake or Meson build system and has been tested with GCC an Arch Linux users can simply install required libs through `pacman` and/or `yay`: ```bash -pacman -S base-devel fmt sqlite rapidjson cmake libzip curl catch2 cxxopts +pacman -S base-devel fmt sqlite rapidjson cmake libzip curl catch2 cxxopts doctest yay -S sqlitecpp libcurlpp ``` @@ -139,10 +139,12 @@ After installing the packages, clone the submodules and link the headers: git submodule add https://github.com/p-ranav/argparse modules/argparse git submodule add https://github.com/p-ranav/tabulate modules/tabulate git submodule add https://github.com/p-ranav/indicators modules/indicators +git submodule add https://github.com/p-ranav/csv2 modules/csv2 ln -s ../modules/argparse/include/argparse include/argparse ln -s ../modules/tabulate/include/tabulate include/tabulate ln -s ../modules/indicators/include/indicators include/indicators +ln -s ../modules/csv2/include/csv2 include/csv2 ``` And then build the project: From 113dee21947d6f3fd2d48282e374aad686ad59cf Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 9 Jun 2024 00:22:50 -0600 Subject: [PATCH 17/39] Added more useful info to README.md --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bf4ce4b..6dd6d1c 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,16 @@ GDPM is an attempt to make a simple, front-end, command-line, package manager de Common commands for searching, installing, listing, and removing assets. ```bash -gdpm search demo -gdpm install "Third Person Controller" --skip-prompt +# fetch updates local database if "no packages to install" error +gdpm fetch + +# search and install "Godot Jolt" globally +gdpm search jolt +gdpm install "Godot Jolt" --skip-prompt + +# list installed packages and remove gdpm list --style=table -gdpm remove "Third Person Controller" --clean +gdpm remove "Godot Jolt" --clean ``` Use `gdpm help` to see full list of commands. @@ -147,7 +153,7 @@ ln -s ../modules/indicators/include/indicators include/indicators ln -s ../modules/csv2/include/csv2 include/csv2 ``` -And then build the project: +And then build the binaries (check the "build" directory): ```bash # Start by cloning the repo, then... @@ -166,7 +172,7 @@ cd build cmake .. make -j$(nproc) -# Easy build using predefined `compile` script +# Easy build using predefined `compile` script ${project_root}/bin/compile.sh --all From 56adb85f4deb278c54f1d6a172fdf9ebe6c4a34e Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 14 Jul 2024 20:11:37 -0600 Subject: [PATCH 18/39] Updated Dockerfile --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index 75ad5c7..a263968 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,14 @@ FROM cgr.dev/chainguard/wolfi-base RUN apk add --no-cache tini +# run as nobody USER 65534:65534 + +# build the binary then copy into container +RUN bin/compile.sh --link +RUN bin/compile.sh --all + COPY build/gdpm.static /gdpm CMD ["/gdpm"] From c1ca0524f1fd685f86bcc7e7344a208bb9eb5802 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 14 Jul 2024 20:12:15 -0600 Subject: [PATCH 19/39] Updated compile script to fetch dependencies --- bin/compile.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/compile.sh b/bin/compile.sh index 43da9f6..01a94df 100755 --- a/bin/compile.sh +++ b/bin/compile.sh @@ -46,6 +46,16 @@ function link_all(){ link_exe $script_dir/../build/gdpm.tests $script_dir/../bin/$tests } +function get_deps() { + #git submodule init -f + #git submodule init -f + + # link the include headers + ln -s ../modules/indicators/include/indicators include/indicators + ln -s ../modules/tabulate/include/tabulate include/tabulate + ln -s ../modules/argparse/include/argparse include/argparse +} + function clean(){ rm ${script_dir}/../bin/$exe @@ -126,6 +136,7 @@ do --exe) build_exe shift;; --libs) build_libs shift;; --tests) build_tests shift;; + --deps) get_deps shift;; --sums) checksums shift;; -d|--docs) build_docs shift;; -c|--clean) clean shift;; From 5819c762897b4845ef4b08baecf028215e6e845a Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 14 Jul 2024 20:17:47 -0600 Subject: [PATCH 20/39] Tidied repository with other small changes --- include/argparse | 1 + include/cache.hpp | 1 + include/types.hpp | 1 + include/version.hpp | 2 +- modules/clipp | 1 - src/cache.cpp | 4 ++++ src/package.cpp | 2 +- src/utils.cpp | 2 +- submodules/indicators | 1 - 9 files changed, 10 insertions(+), 5 deletions(-) create mode 120000 include/argparse delete mode 160000 modules/clipp delete mode 160000 submodules/indicators diff --git a/include/argparse b/include/argparse new file mode 120000 index 0000000..5eb5bec --- /dev/null +++ b/include/argparse @@ -0,0 +1 @@ +../modules/argparse/include/argparse \ No newline at end of file diff --git a/include/cache.hpp b/include/cache.hpp index 75801e3..fdf1aea 100644 --- a/include/cache.hpp +++ b/include/cache.hpp @@ -16,6 +16,7 @@ namespace gdpm::cache { string table_name = GDPM_PACKAGE_CACHE_TABLENAME; }; + bool exists(const params& = params()); error create_package_database(bool overwrite = false, const params& = params()); error insert_package_info(const package::info_list& packages, const params& = params()); result_t get_package_info_by_id(const package::id_list& package_ids, const params& = params()); diff --git a/include/types.hpp b/include/types.hpp index 6896f0e..1ccc1bc 100644 --- a/include/types.hpp +++ b/include/types.hpp @@ -8,6 +8,7 @@ #include #include #include +#include namespace gdpm{ class error; diff --git a/include/version.hpp b/include/version.hpp index d267b2c..881646a 100644 --- a/include/version.hpp +++ b/include/version.hpp @@ -11,7 +11,7 @@ namespace gdpm::version{ int major = 0; int minor = 0; int patch = 0; - string commit = ""; + string description = ""; }; std::string to_string(const context& context); diff --git a/modules/clipp b/modules/clipp deleted file mode 160000 index 02783b6..0000000 --- a/modules/clipp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 02783b6782ebedbb2bebc2e6ceda738ee51c7df2 diff --git a/src/cache.cpp b/src/cache.cpp index 09b62a2..45546ad 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -17,6 +17,10 @@ namespace gdpm::cache{ return utils::replace_all(s, "'", "''"); } + bool exists(const params& params) { + return std::filesystem::exists(params.cache_path); + } + error create_package_database( bool overwrite, const params& params diff --git a/src/package.cpp b/src/package.cpp index 5fbd21a..d44d2cd 100644 --- a/src/package.cpp +++ b/src/package.cpp @@ -58,7 +58,7 @@ namespace gdpm::package{ if(p_cache.empty()){ return log::error_rc( ec::NOT_FOUND, /* TODO: change to PACKAGE_NOT_FOUND */ - "package::install(): no packages found to install." + "package::install(): no package(s) found to install." ); } diff --git a/src/utils.cpp b/src/utils.cpp index b71c2c2..3277f49 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -313,7 +313,7 @@ namespace gdpm::utils{ case 5: return s + " PB"; } return std::to_string(size); - } + } namespace json { string from_array( diff --git a/submodules/indicators b/submodules/indicators deleted file mode 160000 index ef71abd..0000000 --- a/submodules/indicators +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ef71abd9bc7254f7734fa84d5b1c336be2deb9f7 From defbc079cdd40cde7c165a22e76cb786115c4125 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 14 Jul 2024 21:26:43 -0600 Subject: [PATCH 21/39] Initial SConstruct build script --- SConstruct | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 SConstruct diff --git a/SConstruct b/SConstruct new file mode 100644 index 0000000..deadc3b --- /dev/null +++ b/SConstruct @@ -0,0 +1,24 @@ + +# set up variables and glob files +env = Environment( + CPPPATH = Glob('include/*.hpp'), + CPPDEFINES = [], + LIBS = [] +) +base_name = "gdpm" +include_files = Glob('include/*.hpp') +source_files = Glob('src/*.cpp') +test_files = Glob('tests/*.cpp') + +# build the main executable and tests +env.Program(f'{base_name}', source_files) +env.Program(f'{base_name}.tests', test_files) + +# build the static library +StaticLibrary(f'{base_name}-static') + +# build the shared libraries +SharedLibrary(f'{base_name}-shared') +SharedLibrary(f'{base_name}-static') +SharedLibrary(f'{base_name}-http') +SharedLibrary(f'{base_name}-restapi') From 1fe1f19891f84cad9607fa9d95cef6bc61498ec0 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Mon, 15 Jul 2024 20:43:02 -0600 Subject: [PATCH 22/39] Updated README.md with updating submodules --- .gitmodules | 3 +++ README.md | 6 ++++++ modules/indicators | 1 + 3 files changed, 10 insertions(+) create mode 160000 modules/indicators diff --git a/.gitmodules b/.gitmodules index 1efeb8d..45d6005 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "modules/argparse"] path = modules/argparse url = https://github.com/p-ranav/argparse +[submodule "modules/indicators"] + path = modules/indicators + url = https://github.com/p-ranav/indicators diff --git a/README.md b/README.md index 6dd6d1c..efa43dc 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,12 @@ ln -s ../modules/indicators/include/indicators include/indicators ln -s ../modules/csv2/include/csv2 include/csv2 ``` +Otherwise, you can just update the modules if they're already there and out-of-date: + +```bash +git submodule update --init --recursive +``` + And then build the binaries (check the "build" directory): ```bash diff --git a/modules/indicators b/modules/indicators new file mode 160000 index 0000000..222382c --- /dev/null +++ b/modules/indicators @@ -0,0 +1 @@ +Subproject commit 222382c3a6abbce32503792c59826063660ddb56 From adb80a7176deb715448c7f5a2ea827ff5173b018 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sat, 17 Aug 2024 21:28:02 -0600 Subject: [PATCH 23/39] Added initial SConstruct --- SConstruct | 1 + 1 file changed, 1 insertion(+) diff --git a/SConstruct b/SConstruct index deadc3b..7dac6ec 100644 --- a/SConstruct +++ b/SConstruct @@ -9,6 +9,7 @@ base_name = "gdpm" include_files = Glob('include/*.hpp') source_files = Glob('src/*.cpp') test_files = Glob('tests/*.cpp') +compile_flags = "" # build the main executable and tests env.Program(f'{base_name}', source_files) From 920d648a5113cee36306b555bb3de0dad6e0affe Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 18 Aug 2024 13:35:21 -0600 Subject: [PATCH 24/39] Added ignore_validation flag to config --- include/config.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/config.hpp b/include/config.hpp index 3d2a135..5fc0fba 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -31,6 +31,7 @@ namespace gdpm::config{ bool enable_sync = true; bool enable_cache = true; bool skip_prompt = false; + bool ignore_validation = false; bool enable_file_logging; bool clean_temporary; From 6ab1345cfe0bad02da93fcb787294ad8a5babba1 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 18 Aug 2024 13:35:51 -0600 Subject: [PATCH 25/39] Removed unused includes from main.cpp --- src/main.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5b73e29..e0c8bc6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,10 +1,7 @@ // Godot Package Manager (GPM) -#include "constants.hpp" -#include "log.hpp" -#include "config.hpp" + #include "package_manager.hpp" -#include "result.hpp" #include From ce347d9b5645345d490b1bd5e68c5a06fab92a79 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 18 Aug 2024 13:41:25 -0600 Subject: [PATCH 26/39] Added log prints in main.cpp --- src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index e0c8bc6..0891df9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,7 +10,13 @@ int main(int argc, char **argv){ using namespace gdpm::package_manager; error error = initialize(argc, argv); - parse_arguments(argc, argv); + if(error.has_occurred()) { + log::error(error); + } + error = parse_arguments(argc, argv); + if(error.has_occurred()) { + log::error(error); + } finalize(); return EXIT_SUCCESS; From c78cdd3da99804732de57a8f41852b041f0cb359 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 18 Aug 2024 13:42:02 -0600 Subject: [PATCH 27/39] Added ignore_validation flag check and CLI argument --- src/package_manager.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/package_manager.cpp b/src/package_manager.cpp index 924ff03..2713bd7 100644 --- a/src/package_manager.cpp +++ b/src/package_manager.cpp @@ -147,6 +147,13 @@ namespace gdpm::package_manager{ .help("set verbosity level") .nargs(nargs_pattern::optional); + program.add_argument("--ignore-validation") + .action([&](const auto&){ config.ignore_validation = true; }) + .default_value(false) + .implicit_value(true) + .help("ignore checking if current directory is a Godot project") + .nargs(0); + install_command.add_description("install package(s)"); install_command.add_argument("packages") .required() @@ -409,6 +416,13 @@ namespace gdpm::package_manager{ return log::error_rc(ec::ARGPARSE_ERROR, e.what()); } + /* Check if we're running in a directory with 'project.godot' file */ + if (!config.ignore_validation) { + if(!std::filesystem::exists("project.godot")){ + return error(ec::FILE_NOT_FOUND, "no 'project.godot' file found in current directory"); + } + } + if(program.is_subcommand_used(install_command)){ action = action_e::install; // if(install_command.is_used("packages")) From 6199486b6894785e301870c7e8db5a5a9d219d6b Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Mon, 15 Jul 2024 20:43:02 -0600 Subject: [PATCH 28/39] Updated README.md with updating submodules --- .gitmodules | 3 +++ README.md | 6 ++++++ modules/indicators | 1 + 3 files changed, 10 insertions(+) create mode 160000 modules/indicators diff --git a/.gitmodules b/.gitmodules index 1efeb8d..45d6005 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "modules/argparse"] path = modules/argparse url = https://github.com/p-ranav/argparse +[submodule "modules/indicators"] + path = modules/indicators + url = https://github.com/p-ranav/indicators diff --git a/README.md b/README.md index 6dd6d1c..efa43dc 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,12 @@ ln -s ../modules/indicators/include/indicators include/indicators ln -s ../modules/csv2/include/csv2 include/csv2 ``` +Otherwise, you can just update the modules if they're already there and out-of-date: + +```bash +git submodule update --init --recursive +``` + And then build the binaries (check the "build" directory): ```bash diff --git a/modules/indicators b/modules/indicators new file mode 160000 index 0000000..222382c --- /dev/null +++ b/modules/indicators @@ -0,0 +1 @@ +Subproject commit 222382c3a6abbce32503792c59826063660ddb56 From 2b5c838a4ffe51602356df35c2b71b33f8664fff Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 18 Aug 2024 13:35:21 -0600 Subject: [PATCH 29/39] Added ignore_validation flag to config --- include/config.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/config.hpp b/include/config.hpp index 3d2a135..5fc0fba 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -31,6 +31,7 @@ namespace gdpm::config{ bool enable_sync = true; bool enable_cache = true; bool skip_prompt = false; + bool ignore_validation = false; bool enable_file_logging; bool clean_temporary; From 1e92c16cdf009fe3b98e6a80dea91c51a6ab354c Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 18 Aug 2024 13:35:51 -0600 Subject: [PATCH 30/39] Removed unused includes from main.cpp --- src/main.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5b73e29..e0c8bc6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,10 +1,7 @@ // Godot Package Manager (GPM) -#include "constants.hpp" -#include "log.hpp" -#include "config.hpp" + #include "package_manager.hpp" -#include "result.hpp" #include From e8020aa0b0ccd87990e8287720fdbf9058b23c7c Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 18 Aug 2024 13:41:25 -0600 Subject: [PATCH 31/39] Added log prints in main.cpp --- src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index e0c8bc6..0891df9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,7 +10,13 @@ int main(int argc, char **argv){ using namespace gdpm::package_manager; error error = initialize(argc, argv); - parse_arguments(argc, argv); + if(error.has_occurred()) { + log::error(error); + } + error = parse_arguments(argc, argv); + if(error.has_occurred()) { + log::error(error); + } finalize(); return EXIT_SUCCESS; From a6635b1f0275df6ff6df2cb904840b6cb073619e Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 18 Aug 2024 13:42:02 -0600 Subject: [PATCH 32/39] Added ignore_validation flag check and CLI argument --- src/package_manager.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/package_manager.cpp b/src/package_manager.cpp index 924ff03..2713bd7 100644 --- a/src/package_manager.cpp +++ b/src/package_manager.cpp @@ -147,6 +147,13 @@ namespace gdpm::package_manager{ .help("set verbosity level") .nargs(nargs_pattern::optional); + program.add_argument("--ignore-validation") + .action([&](const auto&){ config.ignore_validation = true; }) + .default_value(false) + .implicit_value(true) + .help("ignore checking if current directory is a Godot project") + .nargs(0); + install_command.add_description("install package(s)"); install_command.add_argument("packages") .required() @@ -409,6 +416,13 @@ namespace gdpm::package_manager{ return log::error_rc(ec::ARGPARSE_ERROR, e.what()); } + /* Check if we're running in a directory with 'project.godot' file */ + if (!config.ignore_validation) { + if(!std::filesystem::exists("project.godot")){ + return error(ec::FILE_NOT_FOUND, "no 'project.godot' file found in current directory"); + } + } + if(program.is_subcommand_used(install_command)){ action = action_e::install; // if(install_command.is_used("packages")) From 9f56c0b8c7274ac400e4457b976754a44d3540c6 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Wed, 28 Aug 2024 23:20:04 -0600 Subject: [PATCH 33/39] Updated PKGBUILD to build from git 'main' --- PKGBUILD | 22 -------------------- dist/archlinux/PKGBUILD | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 22 deletions(-) delete mode 100644 PKGBUILD create mode 100644 dist/archlinux/PKGBUILD diff --git a/PKGBUILD b/PKGBUILD deleted file mode 100644 index 80f8cdb..0000000 --- a/PKGBUILD +++ /dev/null @@ -1,22 +0,0 @@ -# Maintainer: David J. Allen -pkgname=gdpm -pkgver=0.0.1 -pkgrel=1 -pkgdesc="CLI tool to automate managing Godot game engine assets from the command-line. This includes a pre-built, static binary." -arch=('x86_64') -url="https://github.com/davidallendj/gdpm" -license=('MIT') -#groups= -depends=('glibc') -makedepends=('cmake', 'make', 'clang') -source=("https://github.com/davidallendj/gdpm/releases/download/v$pkgver/$pkgname.static.$arch.linux.static") -sha256sums=('012e3c32511d6d762ac070808e8bcae7f68dd261bf1cad3dbf4607c97aa1bb3d') - -build () { - # shouldn't need to build anything with static binary... -} - -package() { - cd "$srcdir/$pkgname-$pkgver" - make DESTDIR="$pkgdir/" install -} \ No newline at end of file diff --git a/dist/archlinux/PKGBUILD b/dist/archlinux/PKGBUILD new file mode 100644 index 0000000..a4e49b6 --- /dev/null +++ b/dist/archlinux/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: David J. Allen +pkgname=gdpm-git +pkgver=r86.a6635b1 +pkgrel=1 +pkgdesc="CLI tool to automate managing Godot game engine assets from the command-line. This includes a pre-built, static binary." +arch=('x86_64') +url="https://github.com/davidallendj/gdpm" +license=('MIT') +depends=('glibc') +makedepends=('cmake' 'ninja' 'clang' 'gcc') +optdepends=('meson' 'make') +source=("$pkgname-$pkgver::git+https://github.com/davidallendj/gdpm") +sha256sums=('SKIP') + +pkgver() { + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "$srcdir/$pkgname-$pkgver" + + # update and initialize submodules + git submodule update --init modules/argparse + git submodule update --init modules/tabulate + git submodule update --init modules/indicators + git submodule update --init modules/csv2 + + # link module headers to include/* + ln -s ../modules/argparse/include/argparse include/argparse + ln -s ../modules/tabulate/include/tabulate include/tabulate + ln -s ../modules/indicators/include/indicators include/indicators + ln -s ../modules/csv2/include/csv2 include/csv2 +} + +build () { + cd "$srcdir/$pkgname-$pkgver" + bin/compile.sh --all +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + # install the binary to /usr/bin + mkdir -p "${pkgdir}/usr/bin" + install -m755 build/gdpm.static "${pkgdir}/usr/bin/gdpm" +} From 7570f48cad3d1c2290291b248abc5eeda4907e06 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Wed, 28 Aug 2024 23:29:49 -0600 Subject: [PATCH 34/39] Updated PKGBUILD to remove existing module links --- dist/archlinux/PKGBUILD | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dist/archlinux/PKGBUILD b/dist/archlinux/PKGBUILD index a4e49b6..0086697 100644 --- a/dist/archlinux/PKGBUILD +++ b/dist/archlinux/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: David J. Allen pkgname=gdpm-git -pkgver=r86.a6635b1 +pkgver=r94.341f075 pkgrel=1 pkgdesc="CLI tool to automate managing Godot game engine assets from the command-line. This includes a pre-built, static binary." arch=('x86_64') @@ -19,6 +19,12 @@ pkgver() { prepare() { cd "$srcdir/$pkgname-$pkgver" + # remove all links to modules + rm -f include/argparse + rm -f include/tabulate + rm -f include/indicators + rm -f include/csv2 + # update and initialize submodules git submodule update --init modules/argparse git submodule update --init modules/tabulate @@ -44,3 +50,7 @@ package() { mkdir -p "${pkgdir}/usr/bin" install -m755 build/gdpm.static "${pkgdir}/usr/bin/gdpm" } + +clean() { + rm -rf "$srcdir/$pkgname-$pkgver" +} From d50dbeb051f637c4b616621eead278cc5764c8ab Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Wed, 28 Aug 2024 23:31:15 -0600 Subject: [PATCH 35/39] Updated .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 7bdc498..2ca936e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ vgcore.* config.json *.txt actions-runner/ +**.tar.gz +**.tar.zst From aebd86b70ad0b8efebd70bdb6bd0819cd3d5f7ed Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Wed, 28 Aug 2024 23:36:25 -0600 Subject: [PATCH 36/39] Updated README.md to install on Arch Linux --- README.md | 50 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index efa43dc..d485d10 100644 --- a/README.md +++ b/README.md @@ -7,24 +7,26 @@ GDPM is an attempt to make a simple, front-end, command-line, package manager de \*GDPM has not been tested for Windows or Mac. -- [Quick Start](#quick-start) -- [Rational](#rationale) -- [How It Works](#how-it-works) -- [Features](#features) -- [Building from Source](#building-from-source) - - [Prerequisites](#prerequisites) - - [Macro Definitions](#macro-definitions) - - [API Documentation](#api-documentation) -- [How to use the CLI](#how-to-use-the-cli) - - [Installing, Removing, Updating, and Listing](#installing-removing-updating-and-listing) - - [Searching](#searching) - - [Linking and Cloning](#linking-and-cloning) - - [Cleaning Temporary Files](#cleaning-temporary-files) - - [Managing Remote Sources](#managing-remote-sources) - - [Managing Configuration Properties](#managing-configuration-properties) -- [Planned Features](#planned-features) -- [Known Issues](#known-issues) -- [License](#license) +- [Godot Package Manager (GDPM)](#godot-package-manager-gdpm) + - [Quick Start](#quick-start) + - [Rationale](#rationale) + - [How It Works](#how-it-works) + - [Features](#features) + - [Installing with Package Managers](#installing-with-package-managers) + - [Building from Source](#building-from-source) + - [Prerequisites](#prerequisites) + - [Macro Definitions](#macro-definitions) + - [API Documentation](#api-documentation) + - [How to use the CLI](#how-to-use-the-cli) + - [Installing, Removing, Updating, and Listing](#installing-removing-updating-and-listing) + - [Searching](#searching) + - [Linking and Cloning](#linking-and-cloning) + - [Cleaning Temporary Files](#cleaning-temporary-files) + - [Managing Remote Sources](#managing-remote-sources) + - [Managing Configuration Properties](#managing-configuration-properties) + - [Planned Features](#planned-features) + - [Known Issues](#known-issues) + - [License](#license) @@ -106,6 +108,18 @@ The local database stores all the information sent by the Asset API with additio * Parallel downloads using `libcurl`. + +## Installing with Package Managers + +Currently, `gdpm` can only be installed using `makepkg` on Arch Linux with plans of packaging for other distributions in the future. + +```bash +git clone https://github.com/davidallendj/gdpm && cd gdpm/dist/archlinux +makepkg -si +``` + +This should build the static binary from source and then install it in `/usr/bin/gdpm`. + ## Building from Source The project uses the CMake or Meson build system and has been tested with GCC and Clang on Arch/Manjaro Linux. CMake is preferred, but a `meson.build` script is provided and should work with some tweaking. Building on Windows or Mac has not been tested yet so it's not guaranteed to work. Compiling with CMake will build 2 executables, 3 shared libraries, and an archive library to link, while compiling with Meson only builds an executable that links with a shared library. From 62bb8fabdfbdb8c2a9076cae778a8cb73d96e2da Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Wed, 28 Aug 2024 23:42:08 -0600 Subject: [PATCH 37/39] Simplified README.md and added ninja build info --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d485d10..228ab32 100644 --- a/README.md +++ b/README.md @@ -177,17 +177,20 @@ And then build the binaries (check the "build" directory): ```bash # Start by cloning the repo, then... -git clone https://github.com/davidallendj/gdpm +git clone https://github.com/davidallendj/gdpm && cd gdpm cd gdpm -export project_root=${pwd} + +# ... if using CMake with Ninja instead (preferred and tested)... +cmake -B build -S . -D CMAKE_EXPORT_COMPILE_COMMANDS=1 -D CMAKE_BUILD_TYPE=Release -G Ninja +ninja -C build -j$(nproc) # ...if using Meson with Clang on Linux... meson build meson configure build # only needed if reconfiguring build meson compile -C build -j$(nproc) -CXX=clang++ meson compile -C build -j$(npoc) +CXX=clang++ meson compile -C build -j$(nproc) -# ...if using CMake on Linux (needs work!)... +# ...if using CMake with Make on Linux (needs work!)... cd build cmake .. make -j$(nproc) From 13487a1498feb18ad5a4005d690972489ae6ba50 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Wed, 28 Aug 2024 23:42:52 -0600 Subject: [PATCH 38/39] Removed extra line from README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 228ab32..22c64eb 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,6 @@ And then build the binaries (check the "build" directory): ```bash # Start by cloning the repo, then... git clone https://github.com/davidallendj/gdpm && cd gdpm -cd gdpm # ... if using CMake with Ninja instead (preferred and tested)... cmake -B build -S . -D CMAKE_EXPORT_COMPILE_COMMANDS=1 -D CMAKE_BUILD_TYPE=Release -G Ninja From f59319ad1654c23ff2c00dcb6ff9ed089f202aee Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Fri, 25 Oct 2024 21:27:56 -0600 Subject: [PATCH 39/39] removed curlpp includes causing build to fail --- src/rest_api.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/rest_api.cpp b/src/rest_api.cpp index 0691146..b73268f 100644 --- a/src/rest_api.cpp +++ b/src/rest_api.cpp @@ -12,10 +12,6 @@ #include #include -#include -#include -#include -#include namespace gdpm::rest_api{