Skip to content

Commit 99dc7d7

Browse files
author
KristofferC
committed
bundle everything in libexec
1 parent e9ed047 commit 99dc7d7

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/PackageCompiler.jl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,24 +1655,29 @@ function bundle_julia_libraries(dest_dir, stdlibs)
16551655
end
16561656

16571657
function bundle_julia_libexec(ctx, dest_dir)
1658-
# We only bundle the `7z` executable at the moment
1659-
@assert ctx.env.manifest !== nothing
1660-
if !any(x -> x.name == "p7zip_jll", values(ctx.env.manifest))
1661-
return
1662-
end
1663-
1664-
# Use Julia-private `libexec` folder if it exsts
1658+
# Use Julia-private `libexec` folder if it exists
16651659
# (normpath is required in case `bin` does not exist in `dest_dir`)
16661660
libexecdir_rel = if isdefined(Base, :PRIVATE_LIBEXECDIR)
16671661
Base.PRIVATE_LIBEXECDIR
16681662
else
16691663
Base.LIBEXECDIR
16701664
end
1665+
1666+
source_libexec_dir = joinpath(Sys.BINDIR, libexecdir_rel)
1667+
if !isdir(source_libexec_dir)
1668+
return
1669+
end
1670+
16711671
bundle_libexec_dir = normpath(joinpath(dest_dir, "bin", libexecdir_rel))
16721672
mkpath(bundle_libexec_dir)
16731673

1674-
p7zip_exe = basename(p7zip_path)
1675-
cp(p7zip_path, joinpath(bundle_libexec_dir, p7zip_exe))
1674+
# Copy all files from the libexec directory (7z, dsymutil, lld, etc.)
1675+
for file in readdir(source_libexec_dir)
1676+
src_path = joinpath(source_libexec_dir, file)
1677+
if isfile(src_path)
1678+
cp(src_path, joinpath(bundle_libexec_dir, file); force=true)
1679+
end
1680+
end
16761681

16771682
return
16781683
end

0 commit comments

Comments
 (0)