jellyfin: fix reproducibility of build timestamp leaking into output (#531151)
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
jellyfin-web,
|
||||
sqlite,
|
||||
versionCheckHook,
|
||||
jq,
|
||||
}:
|
||||
|
||||
buildDotnetModule (finalAttrs: {
|
||||
@@ -23,6 +24,10 @@ buildDotnetModule (finalAttrs: {
|
||||
hash = "sha256-HCs4ZsutVoVH+bBZANjpPeMyV8e63Yemjg9DSr0R9zg=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
jq
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ sqlite ];
|
||||
|
||||
projectFile = "Jellyfin.Server/Jellyfin.Server.csproj";
|
||||
@@ -44,6 +49,17 @@ buildDotnetModule (finalAttrs: {
|
||||
"--webdir=${jellyfin-web}/share/jellyfin-web"
|
||||
];
|
||||
|
||||
# Impurity with time. Injects the build date into this file
|
||||
postFixup = ''
|
||||
timestamp="$(TZ=GMT date -d "@$SOURCE_DATE_EPOCH" '+%a, %d %b %Y %X GMT')"
|
||||
|
||||
cat "$out/lib/jellyfin/jellyfin.staticwebassets.endpoints.json" \
|
||||
| jq --arg timestamp "$timestamp" '.Endpoints[].ResponseHeaders[] |= if (.Name == "Last-Modified") then .Value = $timestamp else . end' \
|
||||
> jellyfin.staticwebassets.endpoints.json.new
|
||||
|
||||
mv "jellyfin.staticwebassets.endpoints.json.new" "$out/lib/jellyfin/jellyfin.staticwebassets.endpoints.json"
|
||||
'';
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user