Skip to content

Commit 8dfb223

Browse files
committed
build: Respect VALAC setting everywhere
This fixes some places where the VALAC setting was not respected
1 parent 19ff271 commit 8dfb223

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
VALAC = valac
22
PACKAGES ?= --all
33
GENERATOR_OPTS ?= --disable-devhelp --skip-existing
4-
VALAC_VERSION := $(shell vala --api-version | awk -F. '{ print "0."$$2 }')
5-
VAPIDIR := $(shell pkg-config --variable vapidir libvala-$(VALAC_VERSION))
6-
VALAFLAGS = -g -X -w
4+
VALAC_VERSION := $(shell $(VALAC) --api-version | awk -F. '{ print "0."$$2 }')
5+
VAPIDIRS := --vapidir $(shell pkg-config --variable vapidir libvala-$(VALAC_VERSION)) --vapidir $(shell pkg-config --variable vapidir valadoc-$(VALAC_VERSION))
6+
VALAFLAGS = -g -X -w $(VAPIDIRS)
77
PREFIX = "stable"
88

99
default: generator libdoclet.so update-girs configgen valadoc-example-gen valadoc-example-tester
@@ -104,7 +104,6 @@ build-data:
104104
build-docs: default
105105
$(RM) -r tmp/
106106
./generator \
107-
--vapidir $(VAPIDIR) \
108107
--vapidir "extra-vapis/" --vapidir "girs/vala/vapi/" \
109108
--prefix $(PREFIX) \
110109
--target-glib 2.98 \

src/generator.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class Valadoc.IndexGenerator : Valadoc.ValadocOrgDoclet {
5858

5959
// Unversioned vapi directory:
6060
try {
61-
Process.spawn_command_line_sync ("pkg-config --variable=vapidir vapigen", out standard_output, out standard_error, out exit_status);
61+
Process.spawn_command_line_sync ("pkg-config --variable=vapidir vapigen-%s".printf (Vala.API_VERSION), out standard_output, out standard_error, out exit_status);
6262
if (exit_status == 0) {
6363
paths += standard_output.strip ();
6464
}

src/valadoc-example-tester.vala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public class ExampleTester : ExampleParser {
6060
protected override void compile (string str) throws MarkupError {
6161
string cmnd = str.strip ();
6262

63-
bool is_valac_call = str.has_prefix ("valac ");
63+
const string VALAC_PREFIX = "valac ";
64+
bool is_valac_call = str.has_prefix (VALAC_PREFIX);
6465
bool is_schema_call = str.has_prefix ("glib-compile-schemas");
6566

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

7273
if (is_valac_call) {
74+
cmnd = Environment.get_variable ("VALAC") + " " +
75+
cmnd.substring (VALAC_PREFIX.length);
7376
cmnd += " --fatal-warnings";
7477
if (example_deprecated == true) {
7578
cmnd += " --enable-deprecated";

0 commit comments

Comments
 (0)