photoprism: use buildNpmPackage for frontend

This commit is contained in:
Benjamin Isbarn 2023-01-16 19:58:26 +01:00
parent 58c8eddd9d
commit 08e2d7d147
No known key found for this signature in database
GPG key ID: 48E0C7E5DE3B336C
4 changed files with 7 additions and 154 deletions

View file

@ -249,7 +249,6 @@
, "patch-package"
, "peerflix"
, "peerflix-server"
, {"photoprism-frontend": "../../servers/photoprism"}
, "pkg"
, "pm2"
, "pnpm"

View file

@ -361,10 +361,6 @@ final: prev: {
'';
};
photoprism-frontend = prev."photoprism-frontend-../../servers/photoprism".override {
meta.broken = true; # use the top-level package instead
};
pnpm = prev.pnpm.override {
nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];

View file

@ -1,39 +1,20 @@
{ lib, nodePackages, nodejs-14_x, stdenv, src, version, ... }:
{ lib, buildNpmPackage, src, version }:
let
nodeDependencies = nodePackages.photoprism-frontend.override {
inherit version;
name = "photoprism-frontend-dependencies";
# Workaround for lack of sourceRoot option in buildNodePackage.
src = "${src}/frontend";
meta.broken = false;
};
in
stdenv.mkDerivation {
buildNpmPackage {
inherit src version;
pname = "photoprism-frontend";
buildInputs = [ nodejs-14_x ];
buildPhase = ''
runHook preBuild
pushd frontend
ln -s ${nodeDependencies}/lib/node_modules/photoprism/node_modules ./node_modules
export PATH="${nodeDependencies}/lib/node_modules/photoprism/node_modules/.bin:$PATH"
NODE_ENV=production npm run build
popd
runHook postBuild
postPatch = ''
cd frontend
'';
npmDepsHash = "sha256-NAtZ85WjiQn9w0B9Y78XL+tSsshHlaXS8+WtojFJmGg=";
installPhase = ''
runHook preInstall
mkdir $out
cp -r assets $out/
cp -r ../assets $out/
runHook postInstall
'';

View file

@ -1,123 +0,0 @@
{
"name": "photoprism",
"version": "1.0.0",
"description": "AI-Powered Photos App",
"author": "PhotoPrism UG",
"license": "AGPL-3.0",
"private": true,
"scripts": {
"watch": "webpack --watch",
"build": "webpack --node-env=production",
"trace": "webpack --stats-children",
"debug": "webpack --stats-error-details",
"lint": "eslint --cache src/ *.js",
"fmt": "eslint --cache --fix src/ *.js .eslintrc.js",
"test": "karma start",
"upgrade": "npm --depth 10 update && npm audit fix",
"testcafe": "testcafe",
"acceptance-local": "testcafe chromium --selector-timeout 5000 -S -s tests/acceptance/screenshots tests/acceptance",
"gettext-extract": "gettext-extract --output src/locales/translations.pot $(find ${SRC:-src} -type f \\( -iname \\*.vue -o -iname \\*.js \\) -not -path src/common/vm.js)",
"gettext-compile": "gettext-compile --output src/locales/translations.json src/locales/*.po"
},
"dependencies": {
"@babel/cli": "^7.19.3",
"@babel/core": "^7.19.3",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.19.4",
"@babel/plugin-transform-runtime": "^7.19.1",
"@babel/preset-env": "^7.19.4",
"@babel/register": "^7.18.9",
"@babel/runtime": "^7.19.4",
"@lcdp/offline-plugin": "^5.1.1",
"@vvo/tzdb": "^6.71.0",
"axios": "^0.27.2",
"axios-mock-adapter": "^1.21.2",
"babel-loader": "^8.2.5",
"babel-plugin-istanbul": "^6.1.1",
"browserslist": "^4.21.4",
"chai": "^4.3.6",
"cheerio": "1.0.0-rc.10",
"chrome-finder": "^1.0.7",
"core-js": "^3.25.5",
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"cssnano": "^5.1.13",
"easygettext": "^2.17.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-formatter-pretty": "^4.1.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier-vue": "^4.2.0",
"eslint-plugin-promise": "^6.1.0",
"eslint-plugin-vue": "^9.6.0",
"eslint-webpack-plugin": "^3.2.0",
"eventsource-polyfill": "^0.9.6",
"file-loader": "^6.2.0",
"file-saver": "^2.0.5",
"hls.js": "^1.2.4",
"i": "^0.3.7",
"karma": "^6.4.1",
"karma-chrome-launcher": "^3.1.1",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-htmlfile-reporter": "^0.3.8",
"karma-mocha": "^2.0.1",
"karma-verbose-reporter": "^0.0.8",
"karma-webpack": "^5.0.0",
"luxon": "^3.0.4",
"maplibre-gl": "^2.4.0",
"memoize-one": "^6.0.0",
"mini-css-extract-plugin": "^2.6.1",
"minimist": ">=1.2.5",
"mocha": "^10.1.0",
"node-storage-shim": "^2.0.1",
"photoswipe": "^4.1.3",
"postcss": "^8.4.18",
"postcss-import": "^15.0.0",
"postcss-loader": "^7.0.1",
"postcss-preset-env": "^7.8.2",
"postcss-reporter": "^7.0.5",
"postcss-url": "^10.1.3",
"prettier": "^2.7.1",
"pubsub-js": "^1.9.4",
"regenerator-runtime": "^0.13.10",
"resolve-url-loader": "^5.0.0",
"sass": "^1.55.0",
"sass-loader": "^13.1.0",
"server": "^1.0.37",
"sockette": "^2.0.6",
"style-loader": "^3.3.1",
"svg-url-loader": "^8.0.0",
"tar": "^6.1.11",
"url-loader": "^4.1.1",
"util": "^0.12.5",
"vue": "^2.6.14",
"vue-fullscreen": "^2.5.2",
"vue-gettext": "^2.1.12",
"vue-infinite-scroll": "^2.0.2",
"vue-loader": "^15.9.8",
"vue-loader-plugin": "^1.3.0",
"vue-luxon": "^0.10.0",
"vue-router": "^3.5.2",
"vue-style-loader": "^4.1.3",
"vue-template-compiler": "^2.7.10",
"vue2-filters": "^0.14.0",
"vuetify": "^1.5.24",
"webpack": "^5.74.0",
"webpack-bundle-analyzer": "^4.6.1",
"webpack-cli": "^4.10.0",
"webpack-hot-middleware": "^2.25.2",
"webpack-manifest-plugin": "^5.0.0",
"webpack-md5-hash": "^0.0.6",
"webpack-merge": "^5.8.0"
},
"engines": {
"node": ">= 16.0.0",
"npm": ">= 8.0.0",
"yarn": "please use npm"
},
"browserslist": ">0.25% and last 2 years"
}