Gui tool works when installed now.

pull/15/head
Jussi Pakkanen 11 years ago
parent 8d90739ed7
commit 5d2bdc16aa
  1. 7
      install_meson.py
  2. 4
      mesongui.py

@ -50,13 +50,15 @@ else:
script_dir = os.path.join(install_root, 'share/meson-' + version) script_dir = os.path.join(install_root, 'share/meson-' + version)
bin_dir = os.path.join(install_root, 'bin') bin_dir = os.path.join(install_root, 'bin')
bin_script = os.path.join(script_dir, 'meson.py') bin_script = os.path.join(script_dir, 'meson.py')
gui_script = os.path.join(script_dir, 'mesongui.py')
bin_name = os.path.join(bin_dir, 'meson') bin_name = os.path.join(bin_dir, 'meson')
gui_name = os.path.join(bin_dir, 'mesongui')
man_dir = os.path.join(install_root, 'share/man/man1') man_dir = os.path.join(install_root, 'share/man/man1')
in_manfile = 'man/meson.1' in_manfile = 'man/meson.1'
out_manfile = os.path.join(man_dir, 'meson.1.gz') out_manfile = os.path.join(man_dir, 'meson.1.gz')
symlink_value = os.path.relpath(bin_script, os.path.dirname(bin_name)) symlink_value = os.path.relpath(bin_script, os.path.dirname(bin_name))
guisymlink_value = os.path.relpath(gui_script, os.path.dirname(gui_name))
files = glob.glob('*.py') files = glob.glob('*.py')
files += glob.glob('*.ui') files += glob.glob('*.ui')
@ -77,7 +79,8 @@ try:
os.remove(bin_name) os.remove(bin_name)
except OSError: except OSError:
pass pass
print('Creating symlink %s.' % bin_name) print('Creating symlinks %s and %s.' % (bin_name, gui_name))
os.symlink(symlink_value, bin_name) os.symlink(symlink_value, bin_name)
os.symlink(guisymlink_value, gui_name)
print('Installing manfile to %s.' % man_dir) print('Installing manfile to %s.' % man_dir)
open(out_manfile, 'wb').write(gzip.compress(open(in_manfile, 'rb').read())) open(out_manfile, 'wb').write(gzip.compress(open(in_manfile, 'rb').read()))

@ -23,7 +23,7 @@ from PyQt5.QtCore import QAbstractItemModel, QModelIndex, QVariant, QTimer
import PyQt5.QtCore import PyQt5.QtCore
import PyQt5.QtWidgets import PyQt5.QtWidgets
priv_dir = os.path.split(os.path.abspath(__file__))[0] priv_dir = os.path.split(os.path.abspath(os.path.realpath(__file__)))[0]
class PathModel(QAbstractItemModel): class PathModel(QAbstractItemModel):
def __init__(self, coredata): def __init__(self, coredata):
@ -318,7 +318,7 @@ class MesonGui():
self.coredata_file = os.path.join(build_dir, 'meson-private/coredata.dat') self.coredata_file = os.path.join(build_dir, 'meson-private/coredata.dat')
self.build_file = os.path.join(build_dir, 'meson-private/build.dat') self.build_file = os.path.join(build_dir, 'meson-private/build.dat')
if not os.path.exists(self.coredata_file): if not os.path.exists(self.coredata_file):
printf("Argument is not build directory.") print("Argument is not build directory.")
sys.exit(1) sys.exit(1)
self.coredata = pickle.load(open(self.coredata_file, 'rb')) self.coredata = pickle.load(open(self.coredata_file, 'rb'))
self.build = pickle.load(open(self.build_file, 'rb')) self.build = pickle.load(open(self.build_file, 'rb'))

Loading…
Cancel
Save