Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend pkgconfig relocatization to cover exec_prefix too. #1351

Merged
merged 1 commit into from
Dec 10, 2024
Merged
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
8 changes: 4 additions & 4 deletions src/Auditor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ function audit(prefix::Prefix, src_name::AbstractString = "";
rm(f; force=true)
end

# Make sure that `prefix` in pkg-config files use a relative prefix
# Make sure that `(exec_)prefix` in pkg-config files use a relative prefix
pc_files = collect_files(prefix, endswith(".pc"))
pc_re = r"^prefix=(/.*)$"
for f in pc_files
for f in pc_files, var in ["prefix", "exec_prefix"]
pc_re = Regex("^$var=(/.*)\$")
# We want to replace every instance of `prefix=...` with
# `prefix=${pcfiledir}/../..`
changed = false
Expand All @@ -226,7 +226,7 @@ function audit(prefix::Prefix, src_name::AbstractString = "";
f_rel = relpath(f, prefix.path)
ndirs = count('/', f_rel)
prefix_rel = join([".." for _ in 1:ndirs], "/")
l = "prefix=\${pcfiledir}/$prefix_rel"
l = "$var=\${pcfiledir}/$prefix_rel"
changed = true
end
println(buf, l)
Expand Down
2 changes: 1 addition & 1 deletion test/build_tests/libfoo/libfoo.pc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
prefix=/workplace/destdir
exec_prefix=${prefix}
exec_prefix=/workplace/destdir
includedir=${prefix}/include
libdir=${exec_prefix}/lib

Expand Down
Loading