This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSConstruct
123 lines (99 loc) · 3.56 KB
/
SConstruct
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Setup
import os
env = Environment(ENV = os.environ)
try:
env.Tool('config', toolpath = [os.environ.get('CBANG_HOME')])
except Exception, e:
raise Exception, 'CBANG_HOME not set?\n' + str(e)
env.CBLoadTools('compiler cbang dist fah-client-version fah-viewer ' +
'packager')
# Override mostly_static to default True
env.CBAddVariables(
BoolVariable('mostly_static', 'Link most libraries statically', 1))
conf = env.CBConfigure()
# Version
version = env.FAHClientVersion()
# Config vars
env.Replace(BUILD_INFO_NS = 'FAH::BuildInfo')
win32 = env['PLATFORM'] == 'win32' or int(env.get('cross_mingw', 0))
if not env.GetOption('clean'):
conf.CBConfig('compiler')
conf.CBConfig('fah-viewer')
env.CBDefine('GLEW_STATIC')
env.CBDefine('USING_CBANG') # Using CBANG macro namespace
# Win32
if win32:
conf.CBRequireLib('scrnsave')
conf.CBRequireLib('comctl32')
else: # X
conf.CBRequireHeader('X11/X.h')
conf.CBRequireHeader('X11/Xlib.h')
conf.CBRequireLib('X11')
env.Append(PREFER_DYNAMIC = 'bz2 z m GLU glut X11'.split())
env.CBConfConsole() # Build console app on Windows
conf.Finish()
# Main program
Export('env win32')
prog, lib = \
SConscript('src/FAHScreensaver.scons', variant_dir = 'build', duplicate = 0)
Default(prog)
# Clean
Clean(prog, ['build', 'config.log'])
# Dist
docs = ['README.md', 'AUTHORS', 'CHANGELOG.md', 'copyright']
distfiles = docs + [prog, 'src', 'SConstruct']
tar = env.TarBZ2Dist('FAHScreensaver', distfiles)
Alias('dist', tar)
AlwaysBuild(tar)
# Package
description = \
'''Folding@home is a distributed computing project using volunteered
computer resources.
This package contains the 3D screensaver. It can connect to
local or remote FAHClients and visualize the running simulations.'''
if 'package' in COMMAND_LINE_TARGETS:
# Don't package Windows here
if win32:
f = open('package.txt', 'w');
f.write('none');
f.close()
Exit(0)
# Package
pkg = env.Packager(
'FAHScreensaver',
version = version,
maintainer = 'Joseph Coffland <[email protected]>',
vendor = 'Folding@home',
url = 'https://foldingathome.org/',
license = 'copyright',
bug_url = 'https://apps.foldingathome.org/bugs',
summary = 'Folding@home 3D Screensaver',
description = description,
prefix = '/usr',
copyright = 'Copyright 2010-2018, foldingathome.org',
documents = docs,
programs = [str(prog[0])],
changelog = 'CHANGELOG.md',
deb_directory = 'debian',
deb_section = 'science',
deb_depends = \
'libx11-6, libc6, bzip2, zlib1g, libexpat1, libgl1-mesa-glx, ' \
'libglu1, freeglut3, xscreensaver',
deb_priority = 'optional',
deb_recommends = 'fahclient (=%s), fahcontrol (=%s), fahviewer (=%s)' \
% (version, version, version),
rpm_license = 'GPL+2',
rpm_group = 'Applications/Multimedia',
rpm_requires = 'libX11, mesa-libGL, expat, bzip2-libs, freeglut, ' + \
'mesa-libGLU, xscreensaver',
rpm_build = 'rpm/build',
app_id = 'org.foldingathome.fahscreensaver',
app_resources = [['osx/Resources/', '.']],
pkg_resources = [['osx/Resources/', '.']],
app_signature = '????',
app_other_info = {'CFBundleIconFile': 'FAHScreensaver.icns'},
app_programs = [str(prog[0])],
pkg_files = [['osx/FAHScreensaver', 'usr/bin/', 0755]],
)
AlwaysBuild(pkg)
env.Alias('package', pkg)