Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
conf_data = configuration_data()
module_dir = ''
if get_option('buildtype') == 'debug'
module_dir = join_paths(meson.current_build_dir(), 'servers')
else
module_dir = join_paths(get_option('prefix'), get_option('libdir'), 'vsgi-@0@/servers'.format(api_version))
endif

conf_data.set('MODULE_DIR', module_dir)
vsgi_config_name = 'vsgi-config.vala'
vsgi_config = configure_file(
input: vsgi_config_name + '.in',
output: vsgi_config_name,
configuration: conf_data)

vsgi_sources = files(
'vsgi.vala',
'vsgi-application.vala',
Expand All @@ -16,16 +31,16 @@ vsgi_sources = files(
'vsgi-server-module.vala',
'vsgi-server.vala',
'vsgi-socket-server.vala',
'vsgi-tee-output-stream.vala')
'vsgi-tee-output-stream.vala',
join_paths(meson.current_build_dir(), vsgi_config_name))


vsgi_lib = library('vsgi-' + api_version, vsgi_sources,
dependencies: [glib, gobject, gio, gio_unix, gmodule, soup, libsystemd, openssl, posix],
vala_header: 'vsgi.h',
vala_gir: 'VSGI-@[email protected]'.format(api_version),
build_rpath: join_paths(meson.current_build_dir(), 'servers'),
link_args: ['-Wl,--disable-new-dtags'],
install: true,
install_dir: [true, 'include/vsgi-' + api_version, true, true],
install_rpath: join_paths(get_option('prefix'), get_option('libdir'), 'vsgi-@0@/servers'.format(api_version)))
install_dir: [true, 'include/vsgi-' + api_version, true, true])

install_data('vsgi-@[email protected]'.format(api_version),
install_dir: 'share/vala/vapi')
Expand Down
20 changes: 20 additions & 0 deletions src/vsgi-config.vala.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* This file is part of Valum.
*
* Valum is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Valum 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 Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Valum. If not, see <http://www.gnu.org/licenses/>.
*/

namespace VSGI.Config {
public const string MODULE_PATH_FALLBACK = "@MODULE_DIR@";
}
13 changes: 11 additions & 2 deletions src/vsgi-server-module.vala
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,17 @@ public class VSGI.ServerModule : TypeModule {
}

construct {
// trim the suffix from 'build_path'
path = Module.build_path (directory, "vsgi-%s".printf (name))[0:- Module.SUFFIX.length - 1];
string module_file_name = "vsgi-%s".printf (name);
string module_path = Module.build_path (directory, module_file_name);
File module_file = File.new_for_path (module_path);

if (module_file.query_exists ()) {
// trim the suffix from 'build_path'
path = module_path[0:- Module.SUFFIX.length - 1];
} else {
// trim the suffix from 'build_path'
path = Module.build_path (Config.MODULE_PATH_FALLBACK, module_file_name)[0:- Module.SUFFIX.length - 1];
}
}

public override bool load () {
Expand Down