-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
81 lines (72 loc) · 2.98 KB
/
conanfile.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
import os
from conans import AutoToolsBuildEnvironment, ConanFile, Meson, tools
class EmacsConan(ConanFile):
name = "emacs"
version = tools.get_env("GIT_TAG", "26.3")
description = "The chosen editor"
license = "GPL3"
settings = "os", "arch", "compiler", "build_type"
options = {
"web": [True, False],
"nativecomp": [True, False],
}
default_options = ("web=True", "nativecomp=False")
def build_requirements(self):
if self.options.web:
self.build_requires("meson/[>=0.51.2]@%s/stable" % self.user)
else:
self.build_requires("generators/1.0.0@%s/stable" % self.user)
self.build_requires("make/[>=3.4.0]@%s/stable" % self.user)
self.build_requires("autoconf/[>=2.69]@%s/stable" % self.user)
self.build_requires("automake/[>=1.16.1]@%s/stable" % self.user)
self.build_requires("texinfo/[>=6.6]@%s/stable" % self.user)
def requirements(self):
if self.options.web:
self.requires("generators/1.0.0@%s/stable" % self.user)
elif self.options.nativecomp:
self.requires("gcc/9.3.0-jit@%s/stable" % self.user)
else:
self.requires("cc/1.0.0@%s/stable" % self.user)
if not self.options.web:
self.requires("ncurses/6.1@%s/stable" % self.user)
self.requires("gtk3/3.24.11@%s/stable" % self.user)
self.requires("libxpm/3.5.13@%s/stable" % self.user)
self.requires("giflib/5.2.1@%s/stable" % self.user)
self.requires("libtiff/4.1.0@%s/stable" % self.user)
self.requires("gnutls/3.6.12@%s/stable" % self.user)
def source(self):
if self.options.web:
branch = "feature/web-frontend"
elif self.options.nativecomp:
branch = "feature/native-comp"
else:
branch = "emacs-" + self.version
git = tools.Git("emacs")
git.clone("[email protected]:noverby/emacs.git", branch, shallow=True)
def build(self):
args = []
if self.options.web:
args.append("--with-web")
args.append("--without-x")
args.append("--without-xpm")
args.append("--without-gif")
args.append("--without-tiff")
args.append("--without-sound")
args.append("--without-dbus")
args.append("--without-selinux")
args.append("--without-xml2")
args.append("--without-gnutls")
args.append("--without-libgmp")
elif self.options.nativecomp:
args.append("--with-nativecomp")
else:
args.append("--with-x-toolkit=gtk3")
if self.options.web:
meson = Meson(self)
meson.configure(source_folder="emacs")
else:
with tools.chdir("emacs"):
self.run("sh autogen.sh")
autotools = AutoToolsBuildEnvironment(self)
autotools.configure(args=args)
autotools.make()