Merge pull request #201889 from BeneSim/photoprism-change-tests

photoprism: add valid passthru test
This commit is contained in:
Andreas Rammhold 2022-11-19 16:12:07 +01:00 committed by GitHub
commit bf337d217d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 15 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, lib, stdenv, fetchFromGitHub, fetchzip, darktable, rawtherapee, ffmpeg, libheif, exiftool, nixosTests, makeWrapper }:
{ pkgs, lib, stdenv, fetchFromGitHub, fetchzip, darktable, rawtherapee, ffmpeg, libheif, exiftool, makeWrapper, testers }:
let
version = "221102-905925b4d";
@ -74,7 +74,7 @@ stdenv.mkDerivation {
runHook postInstall
'';
passthru.tests.photoprism = nixosTests.photoprism;
passthru.tests.version = testers.testVersion { package = pkgs.photoprism; };
meta = with lib; {
homepage = "https://photoprism.app";

View file

@ -15,12 +15,14 @@ stdenv.mkDerivation rec {
aarch64-linux = "sha256-qnj4vhSWgrk8SIjzIH1/4waMxMsxMUvqdYZPaSaUJRk=";
}.${system};
url = let
url =
let
systemName = {
x86_64-linux = "amd64";
aarch64-linux = "arm64";
}.${system};
in "https://dl.photoprism.app/tensorflow/${systemName}/libtensorflow-${systemName}-${version}.tar.gz";
in
"https://dl.photoprism.app/tensorflow/${systemName}/libtensorflow-${systemName}-${version}.tar.gz";
})
# Upstream tensorflow tarball (with .h's photoprism's tarball is missing)
(fetchurl {
@ -49,9 +51,11 @@ stdenv.mkDerivation rec {
'';
# Patch library to use our libc, libstdc++ and others
patchPhase = let
patchPhase =
let
rpath = lib.makeLibraryPath [ stdenv.cc.libc stdenv.cc.cc.lib ];
in ''
in
''
chmod -R +w lib
patchelf --set-rpath "${rpath}:$out/lib" lib/libtensorflow.so
patchelf --set-rpath "${rpath}" lib/libtensorflow_framework.so