fix(photoview): install model data, ui build info

This commit is contained in:
514fpv 2024-03-04 12:07:20 +08:00
parent 4d03d658ab
commit d3e0db8269
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw

View file

@ -11,6 +11,7 @@
, fetchFromGitHub
, buildGoModule
, buildNpmPackage
, runCommandLocal
, makeWrapper }: buildGoModule rec {
pname = "photoview";
version = "2.3.13";
@ -41,12 +42,19 @@
pname = "${pname}-ui";
inherit version;
src = source + "/ui";
#REACT_APP_API_ENDPOINT = "";
REACT_APP_BUILD_VERSION = version;
REACT_APP_BUILD_DATE = builtins.readFile (runCommandLocal "date" { } "date -uI > $out" );
REACT_APP_BUILD_COMMIT_SHA = "nix";
npmDepsHash = "sha256-31CyjyNd85hNg4MXIWctoQ3YgorGqCMz+wDAu/K1lWo=";
};
postInstall = ''
mv "$out/bin/api" "$out/bin/${pname}"
mkdir -p "$out/lib/${pname}"
mv "$out/bin/api" "$out/bin/${pname}"
wrapProgram $out/bin/${pname} \
--prefix PATH ":" "${lib.makeBinPath [
ffmpeg
@ -55,6 +63,9 @@
]}" \
--set PHOTOVIEW_SERVE_UI 1 \
--set PHOTOVIEW_UI_PATH "$out/lib/${pname}/ui"
cp -r \
"${src}/data/" \
"$out/lib/${pname}/data/"
cp -r \
"${ui}/lib/node_modules/photoview-ui/dist" \