nixpkgs/pkgs/servers/photofield/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
1.5 KiB
Nix
Raw Normal View History

2023-05-31 22:41:34 +02:00
{ lib
, fetchFromGitHub
, buildGoModule
, buildNpmPackage
, makeWrapper
, exiftool
, ffmpeg
2023-11-23 13:11:19 +01:00
, testers
, photofield
2023-05-31 22:41:34 +02:00
}:
let
pname = "photofield-ui";
version = "0.13.0";
2023-05-31 22:41:34 +02:00
src = fetchFromGitHub {
owner = "SmilyOrg";
repo = "photofield";
rev = "refs/tags/v${version}";
hash = "sha256-6pJvOn3sN6zfjt2dVZ/xH6pSXM0WgbG7au9tSVUGYys=";
2023-05-31 22:41:34 +02:00
};
webui = buildNpmPackage {
inherit src version;
pname = "photofield-ui";
sourceRoot = "${src.name}/ui";
2023-05-31 22:41:34 +02:00
npmDepsHash = "sha256-trKcNuhRdiabFKMafOLtPg8x1bQHLOif6Hm4k5bTAYc=";
2023-05-31 22:41:34 +02:00
installPhase = ''
mkdir -p $out/share
mv dist $out/share/photofield-ui
'';
};
in
buildGoModule rec {
pname = "photofield";
inherit version src;
vendorHash = "sha256-4JFP3vs/Z8iSKgcwfxpdnQpO9kTF68XQArFHYP8IoDQ=";
2023-05-31 22:41:34 +02:00
preBuild = ''
cp -r ${webui}/share/photofield-ui ui/dist
'';
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
"-X main.builtBy=Nix"
];
tags = [ "embedui" ];
2023-05-31 22:41:34 +02:00
doCheck = false; # tries to modify filesytem
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
wrapProgram $out/bin/photofield \
--prefix PATH : "${lib.makeBinPath [exiftool ffmpeg]}"
'';
2023-11-23 13:11:19 +01:00
passthru.tests.version = testers.testVersion {
package = photofield;
command = "photofield -version";
};
2023-05-31 22:41:34 +02:00
meta = with lib; {
description = "Experimental fast photo viewer";
homepage = "https://github.com/SmilyOrg/photofield";
license = licenses.mit;
2023-11-23 13:11:31 +01:00
mainProgram = "photofield";
2023-05-31 22:41:34 +02:00
maintainers = with maintainers; [ dit7ya ];
};
}