-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup_old.py
executable file
·102 lines (91 loc) · 3.86 KB
/
setup_old.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# setup_old.py for Pygenda
#
# Copyright (C) 2022,2023 Matthew Lewis
#
# This file is part of Pygenda.
#
# Pygenda is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# Pygenda is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Pygenda. If not, see <https://www.gnu.org/licenses/>.
#
# This is an old setup script for those who need it.
# Example usage:
# ./setup.py install [--user]
# ./setup.py develop [--user]
# ./setup.py sdist
# ./setup.py bdist_wheel --plat-name=[linux-x86_64|linux-aarch64]
from setuptools import setup
from setuptools.command.bdist_egg import bdist_egg
from sys import platform
import subprocess
from os import path as ospath
# Subclass Egg installer to handle building clipboard library from C source
class PygendaEggInstall(bdist_egg):
def run(self):
# Override run() method of parent class
self.make_clipboard_library()
super().run() # continue with standard parent run() method
@staticmethod
def make_clipboard_library():
# Only know how to do this on Linux - needs fixing for other platforms
if platform == 'linux':
print("Compiling clipboard library...")
cdir = '{:s}/csrc'.format(ospath.dirname(__file__))
subprocess.run(['cmake','.'], cwd=cdir)
subprocess.run(['make','clean'], cwd=cdir)
subprocess.run(['make'], cwd=cdir)
print("Copying clipboard library...")
subprocess.run(['make','cp'], cwd=cdir)
else:
print("Don't know how to build clipboard library on this platform.\nSkipping.")
# Grab version number from source code, so it only needs updating
# in one location.
pygenda_version = None
with open('pygenda/pygenda_version.py') as f:
for line in f:
if line.startswith('__version__'):
pygenda_version = line.split('=')[1].replace('\'','').replace('"','').strip()
break
assert pygenda_version is not None
setup(
name = "pygenda",
version = pygenda_version,
url = "https://github.com/semiprime/pygenda",
author = "Matthew Lewis",
author_email = "[email protected]",
description = "An agenda application inspired by Agenda programs on Psion PDAs.",
long_description = "Pygenda is a calendar/agenda application written in Python3/GTK3. The UI is inspired by the Agenda programs on the Psion Series 3 and Series 5 range of keyboard PDAs, with the aim of being suitable for devices such as Planet Computers' Gemini (running Linux).\n\nFor more information/latest source, see https://github.com/semiprime/pygenda",
packages = ["pygenda"],
cmdclass = {'bdist_egg': PygendaEggInstall}, # use custom install above
package_data = {'': ['ui/*.ui', 'css/*.css', 'css/*.svg', 'libpygenda_clipboard.so', 'locale/*/LC_MESSAGES/pygenda.mo', 'app/pygenda.desktop']}, # files for bdists
license = "GPLv3 only",
python_requires = ">=3.5",
install_requires = [
"PyGObject",
"pycairo",
"python-dateutil",
"icalendar",
"tzlocal!=2.*", # Gemian on GeminiPDA does not work with tzlocal 2.x
"num2words",
],
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Handhelds/PDA's",
"Environment :: X11 Applications :: GTK",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Office/Business :: Scheduling",
],
)