2023-07-20 01:05:54 +03:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, mkYarnPackage
|
|
|
|
, fetchYarnDeps
|
|
|
|
, fixup_yarn_lock
|
|
|
|
, npins
|
|
|
|
, pins
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pins) excalidraw;
|
|
|
|
|
|
|
|
app = mkYarnPackage rec {
|
|
|
|
pname = "excalidraw";
|
|
|
|
version = "0.0.0+${builtins.substring 0 7 excalidraw.revision}";
|
|
|
|
|
|
|
|
REACT_APP_DISABLE_SENTRY = "true";
|
|
|
|
REACT_APP_FIREBASE_CONFIG = "";
|
|
|
|
REACT_APP_GOOGLE_ANALYTICS_ID = "";
|
|
|
|
|
|
|
|
src = npins.mkSource excalidraw;
|
|
|
|
|
|
|
|
packageJSON = "${excalidraw}/package.json";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ fixup_yarn_lock ];
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
name = "excalidraw-yarn-cache-${builtins.hashString "sha256" (builtins.readFile "${excalidraw}/yarn.lock")}";
|
|
|
|
yarnLock = src + "/yarn.lock";
|
2024-07-01 00:03:57 +03:00
|
|
|
hash = "sha256-iEk6yh+2sQkm/oucAGj16x/SpKc1WqXYtYTos82R0bQ=";
|
2023-07-20 01:05:54 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
export HOME="$TMPDIR"
|
|
|
|
yarn config --offline set yarn-offline-mirror "$offlineCache"
|
|
|
|
fixup_yarn_lock yarn.lock
|
|
|
|
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
|
|
|
|
patchShebangs node_modules/
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
yarn --offline build:app
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
distRoot=$out/share/www
|
|
|
|
dist=$distRoot/excalidraw
|
|
|
|
mkdir -p $distRoot
|
2024-07-01 00:03:57 +03:00
|
|
|
mv excalidraw-app/build $dist
|
2023-07-20 01:05:54 +03:00
|
|
|
find $dist -type f -name "*.map" -delete
|
|
|
|
'';
|
|
|
|
|
|
|
|
doDist = false;
|
|
|
|
|
|
|
|
passthru.webroot = "${app}/share/www/excalidraw";
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Virtual whiteboard for sketching hand-drawn like diagrams";
|
|
|
|
homepage = "https://github.com/excalidraw/excalidraw";
|
|
|
|
changelog = "https://github.com/excalidraw/excalidraw/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in app
|