Commit e0cb4795 by Jessica Hawkwell

fixing build system

1 parent 51bf7aa2
...@@ -51,6 +51,7 @@ It's easy to build Nitrogen Desktop Experience. ...@@ -51,6 +51,7 @@ It's easy to build Nitrogen Desktop Experience.
```console ```console
$ git clone https://felinewith.me/LadySerenaKitty/nitrogen.git $ git clone https://felinewith.me/LadySerenaKitty/nitrogen.git
$ cd nitrogen $ cd nitrogen
$ git submodule update
``` ```
**Prep for build** **Prep for build**
......
cmake_minimum_required (VERSION 3.10) 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) find_library(RESVG resvg)
if(NOT ${RESVG} OR NOT EXISTS ${RESVG}) if(NOT ${RESVG} OR NOT EXISTS ${RESVG})
...@@ -7,10 +7,10 @@ if(NOT ${RESVG} OR NOT EXISTS ${RESVG}) ...@@ -7,10 +7,10 @@ if(NOT ${RESVG} OR NOT EXISTS ${RESVG})
include(ExternalProject) include(ExternalProject)
ExternalProject_Add(resvg-build ExternalProject_Add(resvg-build
GIT_SUBMODULES resvg PATCH_COMMAND sh ../patch-resvg.sh WORKING DIRECTORY deps
SOURCE_DIR resvg/capi SOURCE_DIR resvg
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${CARGO} update CONFIGURE_COMMAND "" #${CARGO} update
BUILD_COMMAND ${CARGO} build --release --features=cairo-backend BUILD_COMMAND ${CARGO} build --release --features=cairo-backend
INSTALL_COMMAND "" INSTALL_COMMAND ""
) )
......
#!/bin/sh #!/bin/sh
if [ ! -f resvg-patched ]; then 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 touch resvg-patched
echo "ReSVG patched!" echo "ReSVG patched!"
else else
......
...@@ -33,8 +33,29 @@ ...@@ -33,8 +33,29 @@
#include "SettingsManager.h" #include "SettingsManager.h"
#include <stdlib.h>
#include <regex>
namespace nitrogen { namespace nitrogen {
SettingsManager::SettingsManager() { 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 @@ ...@@ -36,13 +36,19 @@
#include <nde.h> #include <nde.h>
#include <jsoncpp/json/json.h>
#include <vector>
namespace nitrogen { namespace nitrogen {
class SettingsManager : public gc { class SettingsManager : public gc {
public: public:
SettingsManager(); SettingsManager();
private: private:
std::vector<std::string*>* paths;
std::string* dereference(std::string* input);
}; };
} }
#endif /* SETTINGSMANAGER_H */ #endif /* SETTINGSMANAGER_H */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!