Move projects' versions in a separated file.

This way, versions can be imported by external scripts (ie travis)
This commit is contained in:
Matthieu Gautier 2018-02-23 15:24:47 +01:00
parent e8c220c17d
commit f0391a638b
3 changed files with 30 additions and 16 deletions

View File

@ -31,7 +31,6 @@ from utils import Remotefile, pj, SkipCommand, copy_tree, add_execution_right
class zlib(Dependency): class zlib(Dependency):
name = 'zlib' name = 'zlib'
version = '1.2.8'
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile('zlib-1.2.8.tar.gz', archive = Remotefile('zlib-1.2.8.tar.gz',
@ -78,7 +77,6 @@ class zlib(Dependency):
class lzma(Dependency): class lzma(Dependency):
name = 'lzma' name = 'lzma'
version = '5.0.4'
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile('xz-5.0.4.tar.bz2', archive = Remotefile('xz-5.0.4.tar.bz2',
@ -91,7 +89,6 @@ class lzma(Dependency):
class UUID(Dependency): class UUID(Dependency):
name = 'uuid' name = 'uuid'
version = "1.43.4"
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile('e2fsprogs-libs-1.43.4.tar.gz', archive = Remotefile('e2fsprogs-libs-1.43.4.tar.gz',
@ -110,7 +107,6 @@ class UUID(Dependency):
class Xapian(Dependency): class Xapian(Dependency):
name = "xapian-core" name = "xapian-core"
version = "1.4.5"
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile('xapian-core-1.4.5.tar.xz', archive = Remotefile('xapian-core-1.4.5.tar.xz',
@ -132,7 +128,6 @@ class Xapian(Dependency):
class CTPP2(Dependency): class CTPP2(Dependency):
name = "ctpp2" name = "ctpp2"
version = "2.8.3"
class Source(ReleaseDownload): class Source(ReleaseDownload):
name = "ctpp2" name = "ctpp2"
@ -175,7 +170,6 @@ class CTPP2C(CTPP2):
class Pugixml(Dependency): class Pugixml(Dependency):
name = "pugixml" name = "pugixml"
version = "1.2"
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile('pugixml-1.2.tar.gz', archive = Remotefile('pugixml-1.2.tar.gz',
@ -187,7 +181,6 @@ class Pugixml(Dependency):
class MicroHttpd(Dependency): class MicroHttpd(Dependency):
name = "libmicrohttpd" name = "libmicrohttpd"
version = "0.9.46"
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile('libmicrohttpd-0.9.46.tar.gz', archive = Remotefile('libmicrohttpd-0.9.46.tar.gz',
@ -200,7 +193,6 @@ class MicroHttpd(Dependency):
class Gumbo(Dependency): class Gumbo(Dependency):
name = "gumbo" name = "gumbo"
version = "0.10.1"
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile('gumbo-0.10.1.tar.gz', archive = Remotefile('gumbo-0.10.1.tar.gz',
@ -217,7 +209,6 @@ class Gumbo(Dependency):
class Icu(Dependency): class Icu(Dependency):
name = "icu4c" name = "icu4c"
version = "58.2"
class Source(SvnClone): class Source(SvnClone):
name = "icu4c" name = "icu4c"
@ -279,7 +270,6 @@ class Libzim(Dependency):
class Source(GitClone): class Source(GitClone):
git_remote = "https://github.com/openzim/libzim.git" git_remote = "https://github.com/openzim/libzim.git"
git_dir = "libzim" git_dir = "libzim"
release_git_ref = "3.0.0"
Builder = MesonBuilder Builder = MesonBuilder
@ -291,7 +281,6 @@ class ZimTools(Dependency):
class Source(GitClone): class Source(GitClone):
git_remote = "https://github.com/openzim/zim-tools.git" git_remote = "https://github.com/openzim/zim-tools.git"
git_dir = "zim-tools" git_dir = "zim-tools"
release_git_ref = "0.0.1"
class Builder(MesonBuilder): class Builder(MesonBuilder):
@property @property
@ -343,7 +332,6 @@ class Kiwixlib(Dependency):
class Source(GitClone): class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-lib.git" git_remote = "https://github.com/kiwix/kiwix-lib.git"
git_dir = "kiwix-lib" git_dir = "kiwix-lib"
release_git_ref = "1.0.2"
class Builder(MesonBuilder): class Builder(MesonBuilder):
@property @property
@ -367,7 +355,6 @@ class KiwixTools(Dependency):
class Source(GitClone): class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-tools.git" git_remote = "https://github.com/kiwix/kiwix-tools.git"
git_dir = "kiwix-tools" git_dir = "kiwix-tools"
release_git_ref = "0.3.0"
class Builder(MesonBuilder): class Builder(MesonBuilder):
@property @property
@ -379,7 +366,6 @@ class KiwixTools(Dependency):
class Gradle(Dependency): class Gradle(Dependency):
name = "Gradle" name = "Gradle"
version = "3.4"
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile('gradle-4.1-bin.zip', archive = Remotefile('gradle-4.1-bin.zip',

View File

@ -3,6 +3,7 @@ import os
import shutil import shutil
from utils import pj, Context, SkipCommand, extract_archive, Defaultdict, StopBuild from utils import pj, Context, SkipCommand, extract_archive, Defaultdict, StopBuild
from dependency_versions import main_project_versions, base_deps_versions
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
@ -20,7 +21,6 @@ class Dependency(metaclass=_MetaDependency):
all_deps = {} all_deps = {}
dependencies = [] dependencies = []
force_native_build = False force_native_build = False
version = None
def __init__(self, buildEnv): def __init__(self, buildEnv):
self.buildEnv = buildEnv self.buildEnv = buildEnv
@ -28,6 +28,10 @@ class Dependency(metaclass=_MetaDependency):
self.builder = self.Builder(self) self.builder = self.Builder(self)
self.skip = False self.skip = False
@property
def version(self):
return base_deps_versions.get(self.name, None)
@property @property
def full_name(self): def full_name(self):
if self.version: if self.version:
@ -124,7 +128,10 @@ class ReleaseDownload(Source):
class GitClone(Source): class GitClone(Source):
base_git_ref = "master" base_git_ref = "master"
release_git_ref = "master"
@property
def release_git_ref(self):
return main_project_versions.get(self.name, "master")
@property @property
def source_dir(self): def source_dir(self):

21
dependency_versions.py Normal file
View File

@ -0,0 +1,21 @@
main_project_versions = {
'kiwix-lib': '1.0.2',
'kiwix-tools': '0.3.0',
'libzim': '3.0.0',
'zim-tools': '0.0.1',
'zimwriterfs': '1.1',
}
base_deps_versions = {
'zlib' : '1.2.8',
'lzma' : '5.0.4',
'uuid' : '1.43.4',
'xapian-core' : '1.4.5',
'ctpp2' : '2.8.3',
'pugixml' : '1.2',
'libmicrohttpd' : '0.9.46',
'gumbo' : '0.10.1',
'icu4c' : '58.2',
'Gradle' : '3.4',
}