Skip to content

Commit 94bb4a6

Browse files
Update FreeBSD packaging script
We need to make two changes: - First, the package e2fsprogs-libuuid is no longer shipped and the standard libuuid is used instead. We should therefore update the package manifest to reflect this change in the dependencies. - Second, hard-coding package versions into the script is not very scaleable and will be a maintainence burden. Instead, we should ensure that the minimum package version required is whatever the build machine running this script has.
1 parent 6fb75f2 commit 94bb4a6

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

platforms/FreeBSD/makePackage

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,23 @@ cd "$CURRENT_DIRECTORY"
7878
SWIFT_VERSION="$("$SWIFT_TOOLCHAIN_HOME/bin/swift" --version | grep -Eo 'version [0-9.]+' | sed 's/version //')"
7979
echo "Swift version being packaged is $SWIFT_VERSION"
8080

81+
# Get the currently installed version for all of the packages that we need.
82+
# This script assumes that it was run on the build machine and therefore
83+
# that the packages on this machine correspond to those Swift was built
84+
# against.
85+
get_package_version()
86+
{
87+
echo "$(pkg info "$1" | grep Version | sed 's/Version.*: //')"
88+
}
89+
90+
LIBUUID_PKG_VERSION=$(get_package_version libuuid)
91+
LIBFFI_PKG_VERSION=$(get_package_version libffi)
92+
LIBXML2_PKG_VERSION=$(get_package_version libxml2)
93+
MPDECIMAL_PKG_VERSION=$(get_package_version mpdecimal)
94+
PYTHON_PKG_VERSION=$(get_package_version python311)
95+
READLINE_PKG_VERSION=$(get_package_version readline)
96+
SQLITE3_PKG_VERSION=$(get_package_version sqlite3)
97+
8198
# Create the manifest file. All fields below are required. pkg_create(3)
8299
# will add additional fields as part of generating the package.
83100
echo "Generating manifest..."
@@ -93,32 +110,32 @@ cat > "$METADATA_STAGING/manifest" <<EOF
93110
"maintainer": "[email protected]",
94111
"www": "https://www.swift.org",
95112
"deps": {
96-
"e2fsprogs-libuuid": {
97-
"version": "1.47.1",
98-
"origin": "misc/e2fsprogs-libuuid"
113+
"libuuid": {
114+
"version": "$LIBUUID_PKG_VERSION",
115+
"origin": "misc/libuuid"
99116
},
100117
"libffi": {
101-
"version": "3.4.6",
118+
"version": "$LIBFFI_PKG_VERSION",
102119
"origin": "devel/libffi"
103120
},
104121
"libxml2": {
105-
"version": "2.11.9",
122+
"version": "$LIBXML2_PKG_VERSION",
106123
"origin": "textproc/libxml2"
107124
},
108125
"mpdecimal": {
109-
"version": "4.0.0",
126+
"version": "$MPDECIMAL_PKG_VERSION",
110127
"origin": "math/mpdecimal",
111128
},
112129
"python311": {
113-
"version": "3.11.11",
130+
"version": "$PYTHON_PKG_VERSION",
114131
"origin": "lang/python311"
115132
},
116133
"readline": {
117-
"version": "8.2.13_2",
134+
"version": "$READLINE_PKG_VERSION",
118135
"origin": "devel/readline"
119136
},
120137
"sqlite3": {
121-
"version": "3.46.1_1,1",
138+
"version": "$SQLITE3_PKG_VERSION",
122139
"origin": "databases/sqlite3"
123140
}
124141
}

0 commit comments

Comments
 (0)