1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-05 19:42:04 +02:00

Merge pull request #332 from flub/soversion

Version the libdeltachat.so file
This commit is contained in:
björn petersen 2018-10-04 09:26:39 +02:00 committed by GitHub
commit cf5de87d11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 14 deletions

View file

@ -1,10 +1,37 @@
project(
'deltachat-core', 'c',
license: 'GPLv3',
version: '0.0.0', # Dummy, see below.
subproject_dir: 'libs',
meson_version: '>=0.47.2',
)
## Figure out the version, use this instead of meson.project_version()
# The version schema is:
# - X.Y.Z for tagged releases.
# - X.Y.Z990N for dev releases.
# Where N is the number of commits since the last tag.
version = meson.project_version()
git = find_program('git', required: false)
if git.found()
git_desc = run_command(git, 'describe', '--tags')
if git_desc.returncode() == 0
git_desc_parts = git_desc.stdout().strip().split('-')
version = git_desc_parts[0].split('v')[1]
if git_desc_parts.length() > 1
version_parts = version.split('.')
version = '.'.join([version_parts[0],
version_parts[1],
version_parts[2] + '990' + git_desc_parts[1]])
endif
endif
endif
if version == meson.project_version()
warning('Git version not found, using (dummy) project version')
endif
# pthreads is not a real dependency
pthreads = dependency('threads')
@ -73,17 +100,3 @@ subdir('src')
# Build the binaries.
subdir('cmdline')
version = run_command('git', 'describe', '--tags')
if version.returncode() != 0
message('git version not found, pkg-config will not be generated')
else
pkg = import('pkgconfig')
pkg.generate(libraries : lib,
version : version.stdout().strip(),
subdirs : ['deltachat'],
name : 'libdeltachat',
filebase : 'deltachat',
description : ' Create your own, email-compatible messenger.')
endif

View file

@ -46,12 +46,23 @@ lib = library(
'deltachat', lib_src,
dependencies: lib_deps,
include_directories: lib_inc,
version: version,
install: true,
)
dep = declare_dependency(
include_directories: lib_inc,
dependencies: lib_deps,
link_with: [lib],
version: version,
)
install_headers(['deltachat.h'],
subdir: 'deltachat')
pkg = import('pkgconfig')
pkg.generate(libraries : lib,
version : version,
subdirs : ['deltachat'],
name : 'libdeltachat',
filebase : 'deltachat',
description : 'Create your own, email-compatible messenger.')