-
Notifications
You must be signed in to change notification settings - Fork 14
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
Being built from source, gourmet cannot be started #107
Comments
I think that's not really the issue. During installation the import os.path
import sys
# The following lines are modified at installation time by setup.py so they
# point to the actual data files installation paths.
base_dir = '/usr/local/share'
lib_dir = '/usr/local/lib/python3.8/site-packages/'
data_dir = '/usr/local/share/gourmet'
ui_base = os.path.join(base_dir, 'ui')
doc_base = '/usr/local/share/doc/gourmet'
locale_base = '/usr/local/share/locale'
plugin_base = data_dir
# Apologies for the formatting -- something in the build process is
# getting rid of indentations in this file which throws a syntax error
# on install
base_dir = '/usr/local/share'
icon_base = '/usr/local/share/icons/hicolor' The original file looks like this: import os.path
import sys
# The following lines are modified at installation time by setup.py so they
# point to the actual data files installation paths.
base_dir = os.path.join(os.path.dirname(__file__), '..')
lib_dir = os.path.join(base_dir, 'gourmet')
data_dir = os.path.join(base_dir, 'data')
ui_base = os.path.join(base_dir, 'ui')
doc_base = os.path.join(base_dir)
locale_base = os.path.join(base_dir, 'build', 'mo')
plugin_base = os.path.join(base_dir, 'build', 'share', 'gourmet')
# Apologies for the formatting -- something in the build process is
# getting rid of indentations in this file which throws a syntax error
# on install
if getattr(sys, 'frozen', False): base_dir = os.path.dirname(sys.executable); data_dir = base_dir; ui_base = os.path.join(base_dir, 'ui'); doc_base = os.path.join(base_dir, 'doc'); locale_base = os.path.join(base_dir, 'locale'); plugin_base = os.path.join(base_dir)
icon_base = os.path.join(data_dir, 'icons') So it seems the rewriting process during setup is completely borked. |
Here is the rewriting process which completely changes the relative paths: https://github.com/kirienko/gourmet/blob/master/setup.py#L264-L291 But the comment mentions
#!/usr/bin/python3
# PYTHON_ARGCOMPLETE_OK
# Copyright (c) 2004, 2005, 2006, 2007 Tom Hinkle
# You may use and distribute this software under the terms of the
# GNU General Public License, version 2 or later
import sys
# The following line is modified at installation time by setup.py so it
# points to the actual modules installation path.
lib_dir = '/usr/local/lib/python3.8/site-packages/'
if lib_dir not in sys.path:
sys.path.insert(0, lib_dir)
from gourmet import GourmetRecipeManager
GourmetRecipeManager.startGUI() I don't know whether this is correct but I guess not. The original version has |
Okay, I commented out all the rewriting stuff (the lines I referenced), deleted the
I don't really get it though. I tried to print the paths in the It is completely borked. You can pick it up from here :D |
Continuing the discussion from #110:
The static There is an alternative approach: instead of having one path for each type of file, define a search path of different places to look, and have it keep looking until it finds the files it wants. The
It looks like it's imported in |
When I deleted the file there was no error. So it seemed like when removing all the rewriting, the original source directory somehow got added to the path and I was running gourmet from the source directory and not from the install directory (only the bin from the install but not the lib). |
I am not sure if it is feasible, since I am a beginner at python still, but can't /gourmet just be added staticly to the end of the base directory? When I modified the installed settings.py at .../lib/python3.7/site-packages/gourmet at line 7 to: |
When this issue is fixed, .github/workflows/flatpak.yaml needs to be edited to remove the workaround in comments at the end of the file. |
Added Pyglet Player to dependencies to get rid of a terminal error, and added Ubuntu 20.04 specific instructions including a workaround for issue kirienko#107. I also added a note at the beginning that this fork is still under development.
If we clone
gourmet
from Github and dopython setup.py install [--user]
, then it cannot be started.The problem is that the path in
uifile
is incorrect. It looks like that's becausebase_dir
which is currently set insettings.py
aspoints one level up, which is correct for development, but it breaks execution for regular users.
It might be the case that this way of installation was not foreseen and had never been tested.
The text was updated successfully, but these errors were encountered: