aboutsummaryrefslogtreecommitdiff
#! @PYTHON@
# -*- mode: python -*-

import glob
import os
import sys
import warnings

def __renpy_files(directory):
    for pattern in ['*.rpa', '*.rpyc', '*.rpy']:
        for file in glob.iglob(pattern, root_dir=directory):
            yield file

def path_to_gamedir(basedir, name):
    candidates = [name, 'game', 'data', 'launcher/game']

    if __renpy_files(basedir):
        return basedir

    for candidate in candidates:
        gamedir = os.path.join(basedir, candidate)
        if __renpy_files(gamedir):
            return gamedir

    return basedir

def path_to_common(renpy_base):
    return renpy_base + "/common"

def path_to_saves(gamedir, save_directory=None):
    import renpy

    if save_directory is None:
        save_directory = renpy.config.save_directory
        save_directory = renpy.exports.fsencode(save_directory)

    if not save_directory:
        return gamedir + "/saves"

    prefix = os.environ.get("RENPY_PATH_TO_SAVES",
                            os.path.expanduser("~/.renpy"))

    return os.path.join(prefix, save_directory)

def path_to_logdir(basedir):
    return basedir

def predefined_searchpath(commondir):
    import renpy

    # The default gamedir, in private.
    searchpath = [ renpy.config.gamedir ]

    if env_searchpath := os.environ.get("RENPY_SEARCHPATH"):
        searchpath.extend(env_searchpath.split("::"))

    if commondir and os.path.isdir(commondir):
        searchpath.append(commondir)

    return searchpath

def main():
    try:
        import renpy.bootstrap
        import renpy.arguments
    except ImportError:
        print("""Could not import renpy.bootstrap.
Please ensure you decompressed Ren'py correctly, preserving the directory
structure.""", file=sys.stderr)
        raise

    args = renpy.arguments.bootstrap()
    if not args.basedir:
        print("""This Ren'py requires a basedir to launch.
The basedir is the directory, in which .rpy source files or compiled .rpyc files
live -- usually the 'game' subdirectory of a game packaged by Ren'py.

If you want the Ren'py launcher, use \"renpy-launcher\" instead.""",
              file=sys.stderr)
        sys.exit()

    renpy.bootstrap.bootstrap("@RENPY_BASE@")

if __name__ == "__main__":
    main()
a href='/guix/commit/gnu/home.scm?id=5df8f7802e8b45855e8f84830677001dc631e4f7'>home: Add 'home-generation-base'....* gnu/home.scm (%profile-generation-rx): New variable. (home-generation-base): New procedure. Ludovic Courtès 2021-12-19home: Add gexp-compiler for home-environments....* gnu/home.scm (home-environment-compiler): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Andrew Tropin 2021-10-09Move (gnu home-services) to (gnu home services)....* gnu/home-services.scm (%guix-home-root-directory): Replace gnu/home-services.scm with "gnu/home/services.scm". Rename to gnu/home/services.scm. * gnu/local.mk (GNU_SYSTEM_MODULES): Rename gnu/home-services.scm to gnu/home/services.scm. * doc/he-config-bare-bones.scm: Replace (gnu home-services) with (gnu home services). * gnu/home.scm: Same. * gnu/home/services/fontutils.scm: Same. * gnu/home/services/mcron.scm: Same. * gnu/home/services/shells.scm: Same. * gnu/home/services/shepherd.scm: Same. * gnu/home/services/symlink-manager.scm: Same. * gnu/home/services/xdg.scm: Same. * guix/scripts/home.scm: Same. * guix/self.scm: Same. Oleg Pykhalov 2021-10-08gnu: Move (gnu home-services) to (gnu home services)....* gnu/home-services/configuration.scm: Move the content ... * gnu/home/services/configuration.scm: ... here. * doc/guix.texi: Replace (gnu home-services mcron) with (gnu home services mcron). Replace (gnu home-services) with (gnu home services). * gnu/home.scm: Replace (gnu home-services fontutils) with (gnu services fontutils). Replace (gnu home-services shells) with (gnu home services shells). Replace (gnu home-services symlink-manager) with (gnu home services symlink-manager). Replace (gnu home-services xdg) with (gnu home services xdg). * gnu/home-services/fontutils.scm: Rename to gnu/services/fontutils.scm. * gnu/home-services/mcron.scm: Move to gnu/home/services/mcron.scm. Replace (gnu home-services shepherd) with (gnu home services shepherd). * gnu/home-services.scm (%service-type-path): Search home services in "gnu/services". * gnu/home-services/shells.scm: Replace (gnu home-services configuration) with (gnu home services configuration). Rename to gnu/home/services/shells.scm. Replace (gnu home-services utils) with (gnu home services utils). * gnu/home-services/shepherd.scm: Move to gnu/home/services/shepherd.scm. * gnu/home-services/symlink-manager.scm: Rename to gnu/home/services/symlink-manager.scm. * gnu/home-services/utils.scm: Rename to gnu/home/services/utils.scm. * gnu/home-services/xdg.scm: Rename to gnu/home/services/xdg.scm. * guix/scripts/home/import.scm: Replace (gnu home-services bash) with (gnu home services bash). * gnu/home-services.scm: Update documentation string. * doc/he-config-bare-bones.scm: Apply new (gnu home-services ...) modules location. * gnu/local.mk (GNU_SYSTEM_MODULES): Same. Oleg Pykhalov 2021-09-09gnu: home: Add doc comment about the module....Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com> Andrew Tropin 2021-09-09home: Add home-environment....* gnu/home.scm (home-environment, home-environment?, this-home-environment) (home-environment-derivation, home-environment-user-services) (home-environment-essential-services, home-environment-services) (home-environment-location, home-environment-with-provenance): New variables. * gnu/local.mk (GNU_SYSTEM_MODULES): Add home.scm. Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com> Andrew Tropin