Skip to content

Commit 9712843

Browse files
.pc file modification before moving.
1 parent 8529300 commit 9712843

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

brew.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,19 @@ pipeline:
5454
set -x
5555
mkdir -p ${{targets.destdir}}/home/linuxbrew/.linuxbrew/
5656
cp -a ./brew/bin/ ./brew/Library/ ./brew/package/ ${{targets.destdir}}/home/linuxbrew/.linuxbrew/
57-
58-
# Relocate .pc files to /usr/lib/pkgconfig and create symlinks
59-
mkdir -p ${{targets.destdir}}/usr/lib/pkgconfig/
60-
find ${{targets.destdir}}/home/linuxbrew -name "*.pc" | while read pc_file; do
61-
if [ ! -L "$pc_file" ]; then
62-
mv "$pc_file" "${{targets.destdir}}/usr/lib/pkgconfig/$(basename "$pc_file")"
63-
ln -s "${{targets.destdir}}/usr/lib/pkgconfig/$(basename "$pc_file")" "$pc_file"
57+
58+
# Relocate .pc files to /usr/lib/pkgconfig
59+
mkdir -p "${{targets.destdir}}"/usr/lib/pkgconfig/
60+
61+
find ${{targets.destdir}}/home/linuxbrew -type f -name "*.pc" | while read -r pc_file; do
62+
dname=$(printf "${pc_file}" | sed -e "s,${{targets.destdir}},,")
63+
dname=$(dirname "${dname}")
64+
# Adjust "pcfiledir" so that it reflects the right location of each .pc file.
65+
if grep -q "pcfiledir" "${pc_file}"; then
66+
sed -i -e "s,\${pcfiledir},${dname}," "${pc_file}"
6467
fi
68+
# Move the .pc file to /usr/lib/pkgconfig/
69+
mv "${pc_file}" "${{targets.destdir}}"/usr/lib/pkgconfig/
6570
done
6671
6772
# Create profile.d script

0 commit comments

Comments
 (0)