diff options
author | Michael Serajnik | 2021-08-05 19:04:02 +0200 |
---|---|---|
committer | Michael Serajnik | 2021-08-05 19:04:02 +0200 |
commit | 10a3646256b28eab4aa3b41be100a4af4fabbfec (patch) | |
tree | b127135777aaad934778f3f87290370f2e0a0494 /paths-in-opt.patch | |
download | aur-10a3646256b28eab4aa3b41be100a4af4fabbfec.tar.gz |
Add initial version
Diffstat (limited to 'paths-in-opt.patch')
-rw-r--r-- | paths-in-opt.patch | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/paths-in-opt.patch b/paths-in-opt.patch new file mode 100644 index 000000000000..64ec3007c32a --- /dev/null +++ b/paths-in-opt.patch @@ -0,0 +1,93 @@ +diff --git a/hydrus/client/gui/ClientGUI.py b/hydrus/client/gui/ClientGUI.py +index 418c93e..91e2683 100644 +--- a/hydrus/client/gui/ClientGUI.py ++++ b/hydrus/client/gui/ClientGUI.py +@@ -4133,7 +4133,7 @@ class FrameGUI( ClientGUITopLevelWindows.MainFrameThatResizes ): + python_executable = python_executable.replace( 'pythonw', 'python' ) + + +- server_script_path = os.path.join( HC.BASE_DIR, 'server.py' ) ++ server_script_path = '/opt/hydrus/server.py' + + cmd = [ python_executable, server_script_path, db_param ] + +diff --git a/hydrus/core/HydrusConstants.py b/hydrus/core/HydrusConstants.py +index db6a88b..49e5fdb 100644 +--- a/hydrus/core/HydrusConstants.py ++++ b/hydrus/core/HydrusConstants.py +@@ -5,33 +5,9 @@ import typing + # old method of getting frozen dir, doesn't work for symlinks looks like: + # BASE_DIR = getattr( sys, '_MEIPASS', None ) + +-RUNNING_FROM_FROZEN_BUILD = getattr( sys, 'frozen', False ) +- +-if RUNNING_FROM_FROZEN_BUILD: +- +- real_exe_path = os.path.realpath( sys.executable ) +- +- BASE_DIR = os.path.dirname( real_exe_path ) +- +-else: +- +- try: +- +- hc_realpath_dir = os.path.dirname( os.path.realpath( __file__ ) ) +- +- HYDRUS_MODULE_DIR = os.path.split( hc_realpath_dir )[0] +- +- BASE_DIR = os.path.split( HYDRUS_MODULE_DIR )[0] +- +- except NameError: # if __file__ is not defined due to some weird OS +- +- BASE_DIR = os.path.realpath( sys.path[0] ) +- +- +- if BASE_DIR == '': +- +- BASE_DIR = os.getcwd() +- ++RUNNING_FROM_FROZEN_BUILD = False ++HYDRUS_MODULE_DIR = '/opt/hydrus/hydrus' ++BASE_DIR = os.path.expanduser("~/.local/share/hydrus") + + muh_platform = sys.platform.lower() + +@@ -43,32 +19,16 @@ PLATFORM_HAIKU = muh_platform == 'haiku1' + RUNNING_FROM_SOURCE = sys.argv[0].endswith( '.py' ) or sys.argv[0].endswith( '.pyw' ) + RUNNING_FROM_MACOS_APP = os.path.exists( os.path.join( BASE_DIR, 'running_from_app' ) ) + +-BIN_DIR = os.path.join( BASE_DIR, 'bin' ) +-HELP_DIR = os.path.join( BASE_DIR, 'help' ) +-INCLUDE_DIR = os.path.join( BASE_DIR, 'include' ) +-STATIC_DIR = os.path.join( BASE_DIR, 'static' ) ++BIN_DIR = "/opt/hydrus/bin" ++HELP_DIR = "/opt/hydrus/help" ++INCLUDE_DIR = "/opt/hydrus/include" ++STATIC_DIR = "/opt/hydrus/static" + + DEFAULT_DB_DIR = os.path.join( BASE_DIR, 'db' ) + +-if PLATFORM_MACOS: +- +- desired_userpath_db_dir = os.path.join( '~', 'Library', 'Hydrus' ) +- +-else: +- +- desired_userpath_db_dir = os.path.join( '~', 'Hydrus' ) +- +- +-USERPATH_DB_DIR = os.path.expanduser( desired_userpath_db_dir ) +- +-if USERPATH_DB_DIR == desired_userpath_db_dir: +- +- # could not figure it out, probably a crazy user situation atm +- +- USERPATH_DB_DIR = None +- ++USERPATH_DB_DIR = DEFAULT_DB_DIR + +-LICENSE_PATH = os.path.join( BASE_DIR, 'license.txt' ) ++LICENSE_PATH = "/usr/share/licenses/hydrus/license.txt" + + # + |