Commit e0cb4795 by Jessica Hawkwell

fixing build system

1 parent 51bf7aa2
......@@ -51,6 +51,7 @@ It's easy to build Nitrogen Desktop Experience.
```console
$ git clone https://felinewith.me/LadySerenaKitty/nitrogen.git
$ cd nitrogen
$ git submodule update
```
**Prep for build**
......
cmake_minimum_required (VERSION 3.10)
execute_process(COMMAND sh apply-patches.sh WORKING_DIRECTORY deps)
#execute_process(COMMAND sh apply-patches.sh WORKING_DIRECTORY deps)
find_library(RESVG resvg)
if(NOT ${RESVG} OR NOT EXISTS ${RESVG})
......@@ -7,10 +7,10 @@ if(NOT ${RESVG} OR NOT EXISTS ${RESVG})
include(ExternalProject)
ExternalProject_Add(resvg-build
GIT_SUBMODULES resvg
SOURCE_DIR resvg/capi
PATCH_COMMAND sh ../patch-resvg.sh WORKING DIRECTORY deps
SOURCE_DIR resvg
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${CARGO} update
CONFIGURE_COMMAND "" #${CARGO} update
BUILD_COMMAND ${CARGO} build --release --features=cairo-backend
INSTALL_COMMAND ""
)
......
#!/bin/sh
if [ ! -f resvg-patched ]; then
patch -ts resvg/capi/include/resvg.h patches/resvg-FreeBSD.diff
patch -ts capi/include/resvg.h ../patches/resvg-FreeBSD.diff
touch resvg-patched
echo "ReSVG patched!"
else
......
......@@ -33,8 +33,29 @@
#include "SettingsManager.h"
#include <stdlib.h>
#include <regex>
namespace nitrogen {
SettingsManager::SettingsManager() {
paths = new (UseGC) std::vector<std::string*>();
paths->insert(paths->end(), std::string("{home}/.local/etc/nitrogen"));
paths->insert(paths->end(), std::string("{home}/.local/share/nitrogen"));
paths->insert(paths->end(), std::string("/usr/local/etc/nitrogen"));
paths->insert(paths->end(), std::string("/usr/local/share/nitrogen"));
for (std::vector<std::string>::iterator i = paths->begin(); i != paths->end(); i++) {
dereference(i);
}
}
void SettingsManager::dereference(std::string* input) {
std::regex r("/\\{([^\\}]+)\\}/g");
for (std::regex_iterator i = std::regex_iterator(input->begin(), input->end(), r); i != std::regex_iterator(); i++) {
std::smatch m = *i;
input->replace("{" + m.str() + "}", getenv(m.str()));
}
}
}
......@@ -36,13 +36,19 @@
#include <nde.h>
#include <jsoncpp/json/json.h>
#include <vector>
namespace nitrogen {
class SettingsManager : public gc {
public:
SettingsManager();
private:
std::vector<std::string*>* paths;
std::string* dereference(std::string* input);
};
}
#endif /* SETTINGSMANAGER_H */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!