Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build using conventional paths instead of /opt/ #34

Open
fpesari opened this issue Sep 11, 2019 · 0 comments
Open

Build using conventional paths instead of /opt/ #34

fpesari opened this issue Sep 11, 2019 · 0 comments

Comments

@fpesari
Copy link

fpesari commented Sep 11, 2019

Right now zyn-fusion builds in /opt/ but it'd be nice if it used the traditional paths (such as /usr/bin, /usr/lib and /usr/share) instead of /opt/ (which I know is also in the FHS, but is very uncommon outside of nonfree software).

Basically, this concerns the directories created in package/ when make pack is run (except completions), which are:

  • font
  • qml
  • schema

I poked around zest a bit and I noticed that some functions use a search parameter or something along those lines to allow a different path than the current directory, for example,

# font/
def init_font
        search   = @search_path
        search ||= ""
        font_error = false
        sans = [search + "font/Roboto-Regular.ttf", "deps/nanovg/example/Roboto-Regular.ttf"]
...
# qml/
def loadIR(search=nil)
    l = Parser.new
    qml_data = nil
    if(search.nil?)
        qml_data = [
            Dir.glob("../mruby-zest/mrblib/*.qml"),
            Dir.glob("../mruby-zest/qml/*.qml"),
            Dir.glob("../mruby-zest/test/*.qml"),
            Dir.glob("../mruby-qml-spawn/test/*.qml"),
            Dir.glob("../mruby-zest/example/*.qml"),
            Dir.glob("src/mruby-zest/mrblib/*.qml"),
            Dir.glob("src/mruby-zest/qml/*.qml"),
            Dir.glob("src/mruby-zest/test/*.qml"),
            Dir.glob("src/mruby-qml-spawn/test/*.qml"),
            Dir.glob("src/mruby-zest/example/*.qml"),
            Dir.glob("qml/*.qml")
        ].flatten
    else
        qml_data = [Dir.glob(search+"qml/*.qml")].flatten
...
// schema/
void parse_schema(const char *json, schema_t *sch);
schema_t br_get_schema(bridge_t *br, uri_t uri)
{
    (void) uri;
    schema_t sch;

    //printf("[debug] loading json file\n");
    FILE *f = fopen("schema/test.json", "r");
    if(!f && br->search_path) {
        char tmp[256];
        snprintf(tmp, sizeof(tmp), "%s%s", br->search_path, "schema/test.json");
        f = fopen(tmp, "r");
    }
...

it'd be nice to be able to pass a variable to make which sets the path to one specified by the user, or to use $XDG_DATA_HOME by default (since all of those are architecture-independent files).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant