Skip to content

Commit

Permalink
build: Respect VALAC setting everywhere
Browse files Browse the repository at this point in the history
This fixes some places where the VALAC setting was not respected
  • Loading branch information
rrthomas committed Mar 31, 2022
1 parent 4c19db5 commit 7a9db39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
VALAC = valac
PACKAGES ?= --all
GENERATOR_OPTS ?= --disable-devhelp --skip-existing
VALAC_VERSION := $(shell vala --api-version | awk -F. '{ print "0."$$2 }')
VAPIDIR := $(shell pkg-config --variable vapidir libvala-$(VALAC_VERSION))
VALAFLAGS = -g -X -w
VALAC_VERSION := $(shell $(VALAC) --api-version | awk -F. '{ print "0."$$2 }')
VAPIDIRS := --vapidir $(shell pkg-config --variable vapidir libvala-$(VALAC_VERSION)) --vapidir $(shell pkg-config --variable vapidir valadoc-$(VALAC_VERSION))
VALAFLAGS = -g -X -w $(VAPIDIRS)
PREFIX = "stable"

default: generator libdoclet.so update-girs configgen valadoc-example-gen valadoc-example-tester
Expand Down Expand Up @@ -104,7 +104,6 @@ build-data:
build-docs: default
$(RM) -r tmp/
./generator \
--vapidir $(VAPIDIR) \
--vapidir "extra-vapis/" --vapidir "girs/vala/vapi/" \
--prefix $(PREFIX) \
--target-glib 2.98 \
Expand Down
6 changes: 3 additions & 3 deletions src/generator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class Valadoc.IndexGenerator : Valadoc.ValadocOrgDoclet {

// Unversioned vapi directory:
try {
Process.spawn_command_line_sync ("pkg-config --variable=vapidir vapigen", out standard_output, out standard_error, out exit_status);
Process.spawn_command_line_sync ("pkg-config --variable=vapidir vapigen-%s".printf (Vala.API_VERSION), out standard_output, out standard_error, out exit_status);
if (exit_status == 0) {
paths += standard_output.strip ();
}
Expand Down Expand Up @@ -828,8 +828,8 @@ public class Valadoc.IndexGenerator : Valadoc.ValadocOrgDoclet {


StringBuilder builder = new StringBuilder ();
builder.append_printf ("valadoc --target-glib %s --importdir girs --doclet \"%s\" -o \"tmp/%s\" \"%s\" --vapidir \"%s\" --girdir \"%s\" %s --use-svg-images",
target_glib, docletpath, pkg.name, pkg.get_vapi_path (vapidirs), Path.get_dirname (pkg.get_vapi_path (vapidirs)), girdir, pkg.flags);
builder.append_printf ("valadoc-%s --target-glib %s --importdir girs --doclet \"%s\" -o \"tmp/%s\" \"%s\" --vapidir \"%s\" --girdir \"%s\" %s --use-svg-images",
Vala.API_VERSION, target_glib, docletpath, pkg.name, pkg.get_vapi_path (vapidirs), Path.get_dirname (pkg.get_vapi_path (vapidirs)), girdir, pkg.flags);

if (disable_devhelp == true) {
builder.append (" -X --disable-devhelp");
Expand Down
5 changes: 4 additions & 1 deletion src/valadoc-example-tester.vala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public class ExampleTester : ExampleParser {
protected override void compile (string str) throws MarkupError {
string cmnd = str.strip ();

bool is_valac_call = str.has_prefix ("valac ");
const string VALAC_PREFIX = "valac ";
bool is_valac_call = str.has_prefix (VALAC_PREFIX);
bool is_schema_call = str.has_prefix ("glib-compile-schemas");

// We only check for sanity, not for safety
Expand All @@ -70,6 +71,8 @@ public class ExampleTester : ExampleParser {
}

if (is_valac_call) {
cmnd = Environment.get_variable ("VALAC") + " " +
cmnd.substring (VALAC_PREFIX.length);
cmnd += " --fatal-warnings";
if (example_deprecated == true) {
cmnd += " --enable-deprecated";
Expand Down

0 comments on commit 7a9db39

Please sign in to comment.