forked from lutris/lutris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed setup.py script and removed dependency on distutils-extra
- Loading branch information
Mathieu Comandon
committed
Nov 9, 2012
1 parent
904ff84
commit 1c94f60
Showing
6 changed files
with
55 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
recursive-include lutris *.py | ||
recursive-include data/media * | ||
recursive-include data/ui * | ||
include bin/lutris | ||
include LICENSE | ||
include AUTHORS | ||
include MANIFEST.in | ||
include README | ||
graft debian | ||
prune tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,46 +17,37 @@ | |
# | ||
|
||
import os | ||
import lutris.constants | ||
|
||
try: | ||
import DistUtilsExtra.auto | ||
except ImportError: | ||
import sys | ||
print >> sys.stderr, 'To build lutris you need https://launchpad.net/python-distutils-extra' | ||
sys.exit(1) | ||
|
||
assert DistUtilsExtra.auto.__version__ >= '2.10', 'needs DistUtilsExtra.auto >= 2.10' | ||
import sys | ||
from distutils.core import setup | ||
|
||
|
||
def update_data_path(prefix, oldvalue=None): | ||
|
||
try: | ||
fin = file('lutris/lutrisconfig.py', 'r') | ||
fout = file(fin.name + '.new', 'w') | ||
|
||
for line in fin: | ||
fields = line.split(' = ') # Separate variable from value | ||
fields = line.split(' = ') # Separate variable from value | ||
if fields[0] == '__lutris_data_directory__': | ||
# update to prefix, store oldvalue | ||
if not oldvalue: | ||
oldvalue = fields[1] | ||
line = "%s = '%s'\n" % (fields[0], prefix) | ||
else: # restore oldvalue | ||
else: # restore oldvalue | ||
line = "%s = %s" % (fields[0], oldvalue) | ||
fout.write(line) | ||
|
||
fout.flush() | ||
fout.close() | ||
fin.close() | ||
os.rename(fout.name, fin.name) | ||
except (OSError, IOError), e: | ||
except (OSError, IOError): | ||
print ("ERROR: Can't find lutris/lutrisconfig.py") | ||
sys.exit(1) | ||
return oldvalue | ||
|
||
def update_desktop_file(datadir): | ||
|
||
def update_desktop_file(datadir): | ||
try: | ||
fin = file('lutris.desktop.in', 'r') | ||
fout = file(fin.name + '.new', 'w') | ||
|
@@ -69,34 +60,45 @@ def update_desktop_file(datadir): | |
fout.close() | ||
fin.close() | ||
os.rename(fout.name, fin.name) | ||
except (OSError, IOError), e: | ||
except (OSError, IOError): | ||
print ("ERROR: Can't find lutris.desktop.in") | ||
sys.exit(1) | ||
|
||
class InstallAndUpdateDataDirectory(DistUtilsExtra.auto.install_auto): | ||
def run(self): | ||
if self.root or self.home: | ||
print "WARNING: You don't use a standard --prefix installation, take care that you eventually " \ | ||
"need to update quickly/quicklyconfig.py file to adjust __quickly_data_directory__. You can " \ | ||
"ignore this warning if you are packaging and uses --prefix." | ||
previous_value = update_data_path(self.prefix + '/share/lutris/') | ||
update_desktop_file(self.prefix + '/share/lutris/') | ||
DistUtilsExtra.auto.install_auto.run(self) | ||
update_data_path(self.prefix, previous_value) | ||
data_files = [] | ||
|
||
for directory, _, filenames in os.walk(u'data'): | ||
dest = directory[5:] | ||
if filenames: | ||
files = [] | ||
for filename in filenames: | ||
filename = os.path.join(directory, filename) | ||
files.append(filename) | ||
data_files.append((os.path.join('share/lutris', dest), files)) | ||
data_files.append(('share/icons', ['data/media/lutris.svg'])) | ||
data_files.append(('share/applications', ['lutris.desktop'])) | ||
|
||
DistUtilsExtra.auto.setup( | ||
setup( | ||
name='lutris', | ||
version=lutris.constants.version, | ||
version='0.2.7', | ||
license='GPL-3', | ||
author='Mathieu Comandon', | ||
author_email='[email protected]', | ||
author_email='[email protected]', | ||
packages=['lutris', 'lutris.gui', 'lutris.util', 'lutris.runners'], | ||
scripts=['bin/lutris'], | ||
data_files=data_files, | ||
#install_requires=['PyYAML'], | ||
url='http://lutris.net', | ||
description='Install and play any video game on Linux', | ||
long_description = """Lutris is a gaming platform for GNU/Linux. It's goal is to make | ||
gaming on Linux as easy as possible by taking care of installing | ||
and setting up the game for the user. The only thing you have to | ||
do is play the game. It aims to support every game that is playable | ||
on Linux.""", | ||
url='https://launchpad.net/lutris', | ||
cmdclass={'install': InstallAndUpdateDataDirectory} | ||
) | ||
long_description="""Lutris is a gaming platform for GNU/Linux. It's goal is | ||
to make gaming on Linux as easy as possible by taking care of installing | ||
and setting up the game for the user. The only thing you have to do is play | ||
the game. It aims to support every game that is playable on Linux.""", | ||
classifiers=[ | ||
'Development Status :: 3 - Alpha', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: GPLv3', | ||
'Programming Language :: Python', | ||
'Operating System :: Linux', | ||
'Topic :: Games' | ||
], | ||
) |