forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
factoriolab: init at 3.8.1 (NixOS#358014)
- Loading branch information
1 parent
f3a31ba
commit 2affc0e
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
buildNpmPackage, | ||
fetchFromGitHub, | ||
vips, | ||
lib, | ||
pkg-config, | ||
jq, | ||
makeWrapper, | ||
nix-update-script, | ||
}: | ||
buildNpmPackage rec { | ||
pname = "factoriolab"; | ||
version = "3.8.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "factoriolab"; | ||
repo = "factoriolab"; | ||
rev = "refs/tags/v${version}"; | ||
hash = "sha256-ZI7nit+DBc1ULGDpGlee7v+NrHc5JhS7sgACGG5fB7I="; | ||
}; | ||
buildInputs = [ vips ]; | ||
nativeBuildInputs = [ | ||
pkg-config | ||
makeWrapper | ||
]; | ||
|
||
npmDepsHash = "sha256-FX9zxq3kIQ5nxEPW57X53novtCFBPV5w9jg882EC2Lo="; | ||
# By default angular tries to optimize fonts by inlining them | ||
# which needs internet access during building to download said fonts. | ||
# Internet access during build would necessitate turning this into a fixed output derivation | ||
# which is difficult as said fonts are not actually stable. | ||
# This disables font inlining completely in which case the fonts will be loaded on demand by your browser | ||
postPatch = '' | ||
${lib.getExe jq} '.projects.factoriolab.architect.build.options += { "optimization": {"fonts": false } }' ./angular.json > angular.json.new | ||
mv -f angular.json.new angular.json | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/share | ||
cp -r dist/browser $out/share/factoriolab | ||
runHook postInstall | ||
''; | ||
passthru.updateScript = nix-update-script { }; | ||
|
||
meta = { | ||
homepage = "https://github.com/factoriolab/factoriolab"; | ||
changelog = "https://github.com/factoriolab/factoriolab/releases/tag/${version}"; | ||
description = "Angular-based calculator for factory games like Factorio and Dyson Sphere Program"; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ patrickdag ]; | ||
}; | ||
} |