mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
synapse-admin: source build
* Now it's possible to deploy custom patches to the project more easily. * Force a default homeserver url (which only works via injecting it via `process.env` on build-time).
This commit is contained in:
parent
72f17cca89
commit
5c15250962
@ -1,26 +1,59 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchzip
|
||||
, mkYarnPackage
|
||||
, baseUrl ? null
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
mkYarnPackage rec {
|
||||
pname = "synapse-admin";
|
||||
version = "0.8.5";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://github.com/Awesome-Technologies/synapse-admin/releases/download/${version}/synapse-admin-${version}.tar.gz";
|
||||
hash = "sha256-5wMKRaLMVJer6W2q2WuofgzVwr8Myi90DQ8tBVAoUX4=";
|
||||
src = fetchFromGitHub {
|
||||
owner = "Awesome-Technologies";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-0miHtEJ5e8MaqGc4ezPvwhGjoCZyOE7md0DUCC/ZOfk=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
cp -r . $out
|
||||
yarnNix = ./yarn.nix;
|
||||
yarnLock = ./yarn.lock;
|
||||
packageJSON = ./package.json;
|
||||
|
||||
NODE_ENV = "production";
|
||||
${if baseUrl != null then "REACT_APP_SERVER" else null} = baseUrl;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
export HOME=$(mktemp -d)
|
||||
pushd deps/synapse-admin
|
||||
mv node_modules node_modules.bak
|
||||
cp -r $(readlink -f node_modules.bak) node_modules
|
||||
chmod +w node_modules
|
||||
yarn --offline run build
|
||||
popd
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
distPhase = ''
|
||||
runHook preDist
|
||||
|
||||
mkdir -p $out
|
||||
cp -r deps/synapse-admin/build/* $out
|
||||
|
||||
runHook postDist
|
||||
'';
|
||||
|
||||
dontFixup = true;
|
||||
dontInstall = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Admin UI for Synapse Homeservers";
|
||||
homepage = "https://github.com/Awesome-Technologies/synapse-admin";
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ mkg20001 ];
|
||||
maintainers = with maintainers; [ mkg20001 ma27 ];
|
||||
};
|
||||
}
|
||||
|
61
pkgs/tools/admin/synapse-admin/package.json
Normal file
61
pkgs/tools/admin/synapse-admin/package.json
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"name": "synapse-admin",
|
||||
"version": "0.8.5",
|
||||
"description": "Admin GUI for the Matrix.org server Synapse",
|
||||
"author": "Awesome Technologies Innovationslabor GmbH",
|
||||
"license": "Apache-2.0",
|
||||
"homepage": ".",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Awesome-Technologies/synapse-admin"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/jest-dom": "^5.1.1",
|
||||
"@testing-library/react": "^11.2.6",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
"eslint": "^7.25.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^3.1.2",
|
||||
"jest-fetch-mock": "^3.0.3",
|
||||
"prettier": "^2.2.0",
|
||||
"ra-test": "^3.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"papaparse": "^5.2.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"ra-language-chinese": "^2.0.10",
|
||||
"ra-language-german": "^3.13.4",
|
||||
"react": "^17.0.0",
|
||||
"react-admin": "^3.19.7",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-scripts": "^4.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "REACT_APP_VERSION=$(git describe --tags) react-scripts start",
|
||||
"build": "REACT_APP_VERSION=$(git describe --tags) react-scripts build",
|
||||
"fix:other": "yarn prettier --write",
|
||||
"fix:code": "yarn test:lint --fix",
|
||||
"fix": "yarn fix:code && yarn fix:other",
|
||||
"prettier": "prettier --ignore-path .gitignore \"**/*.{js,jsx,json,md,scss,yaml,yml}\"",
|
||||
"test:code": "react-scripts test",
|
||||
"test:lint": "eslint --ignore-path .gitignore --ext .js,.jsx .",
|
||||
"test:style": "yarn prettier --list-different",
|
||||
"test": "yarn test:style && yarn test:lint && yarn test:code",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
}
|
12141
pkgs/tools/admin/synapse-admin/yarn.lock
Normal file
12141
pkgs/tools/admin/synapse-admin/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
12589
pkgs/tools/admin/synapse-admin/yarn.nix
Normal file
12589
pkgs/tools/admin/synapse-admin/yarn.nix
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user