feat(photoview): package photoview
This commit is contained in:
parent
130fe96561
commit
4d03d658ab
63
package/photoview/default.nix
Normal file
63
package/photoview/default.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{ lib
|
||||
, pkg-config
|
||||
, libjpeg_turbo
|
||||
, libheif
|
||||
, lapack
|
||||
, dlib
|
||||
, blas
|
||||
, ffmpeg
|
||||
, exiftool
|
||||
, darktable
|
||||
, fetchFromGitHub
|
||||
, buildGoModule
|
||||
, buildNpmPackage
|
||||
, makeWrapper }: buildGoModule rec {
|
||||
pname = "photoview";
|
||||
version = "2.3.13";
|
||||
|
||||
source = fetchFromGitHub {
|
||||
name = "${pname}-src";
|
||||
owner = pname;
|
||||
repo = pname;
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-O6k5nbiWTsuOi8YLX0rsZJ9dOIo5d6pdwjhFZrdwI0E=";
|
||||
};
|
||||
|
||||
src = source + "/api";
|
||||
vendorHash = "sha256-0SWywy9YdPtgvxRhwKhKvspPmhbnibSuhvzhsjIQvZk=";
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
makeWrapper
|
||||
];
|
||||
buildInputs = [
|
||||
libjpeg_turbo
|
||||
libheif
|
||||
lapack
|
||||
dlib
|
||||
blas
|
||||
];
|
||||
|
||||
ui = buildNpmPackage {
|
||||
pname = "${pname}-ui";
|
||||
inherit version;
|
||||
src = source + "/ui";
|
||||
npmDepsHash = "sha256-31CyjyNd85hNg4MXIWctoQ3YgorGqCMz+wDAu/K1lWo=";
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
mv "$out/bin/api" "$out/bin/${pname}"
|
||||
mkdir -p "$out/lib/${pname}"
|
||||
wrapProgram $out/bin/${pname} \
|
||||
--prefix PATH ":" "${lib.makeBinPath [
|
||||
ffmpeg
|
||||
exiftool
|
||||
darktable
|
||||
]}" \
|
||||
--set PHOTOVIEW_SERVE_UI 1 \
|
||||
--set PHOTOVIEW_UI_PATH "$out/lib/${pname}/ui"
|
||||
|
||||
cp -r \
|
||||
"${ui}/lib/node_modules/photoview-ui/dist" \
|
||||
"$out/lib/${pname}/ui"
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue