nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at netboot-syslinux-multiplatform 62 lines 1.8 kB view raw
1{ yarn2nix-moretea 2, fetchFromGitHub, applyPatches 3}: 4 5yarn2nix-moretea.mkYarnPackage rec { 6 pname = "gotify-ui"; 7 8 packageJSON = ./package.json; 9 yarnNix = ./yarndeps.nix; 10 11 version = import ./version.nix; 12 13 src_all = applyPatches { 14 src = fetchFromGitHub { 15 owner = "gotify"; 16 repo = "server"; 17 rev = "v${version}"; 18 sha256 = import ./source-sha.nix; 19 }; 20 postPatch = '' 21 substituteInPlace ui/yarn.lock \ 22 --replace \ 23 "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001237.tgz" \ 24 "https___registry.npmjs.org_caniuse_lite___caniuse_lite_1.0.30001237.tgz" 25 ''; 26 }; 27 src = "${src_all}/ui"; 28 29 buildPhase = '' 30 export HOME=$(mktemp -d) 31 export WRITABLE_NODE_MODULES="$(pwd)/tmp" 32 export NODE_OPTIONS=--openssl-legacy-provider 33 mkdir -p "$WRITABLE_NODE_MODULES" 34 35 # react-scripts requires a writable node_modules/.cache, so we have to copy the symlink's contents back 36 # into `node_modules/`. 37 # See https://github.com/facebook/create-react-app/issues/11263 38 cd deps/gotify-ui 39 node_modules="$(readlink node_modules)" 40 rm node_modules 41 mkdir -p "$WRITABLE_NODE_MODULES"/.cache 42 cp -r $node_modules/* "$WRITABLE_NODE_MODULES" 43 44 # In `node_modules/.bin` are relative symlinks that would be broken after copying them over, 45 # so we take care of them here. 46 mkdir -p "$WRITABLE_NODE_MODULES"/.bin 47 for x in "$node_modules"/.bin/*; do 48 ln -sfv "$node_modules"/.bin/"$(readlink "$x")" "$WRITABLE_NODE_MODULES"/.bin/"$(basename "$x")" 49 done 50 51 ln -sfv "$WRITABLE_NODE_MODULES" node_modules 52 cd ../.. 53 54 yarn build 55 56 cd deps/gotify-ui 57 rm -rf node_modules 58 ln -sf $node_modules node_modules 59 cd ../.. 60 ''; 61 62}