mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-28 07:38:11 +08:00
Separate branded assets from monorepo (#3406)
* remove branded files * use branding repo * include favicons * nixpkg fixup * win fix ico path * fix fmt * skip licensenses for dev builds * review fixup * test * test * ci test * ci test * ci test * fix ci
This commit is contained in:
+30
-3
@@ -14,6 +14,22 @@
|
||||
}:
|
||||
|
||||
let
|
||||
brandingTar = pkgs.fetchurl (
|
||||
let
|
||||
lockContent = builtins.readFile "${info.src}/.branding";
|
||||
lines = builtins.filter (s: s != [ ]) (builtins.split "\n" lockContent);
|
||||
url = builtins.elemAt lines 0;
|
||||
hash = builtins.elemAt lines 1;
|
||||
in
|
||||
{
|
||||
url = url;
|
||||
sha256 = hash;
|
||||
}
|
||||
);
|
||||
branding = pkgs.runCommand "${info.pname}-branding" { } ''
|
||||
mkdir -p $out
|
||||
tar -xvf ${brandingTar} -C $out --strip-components 1
|
||||
'';
|
||||
resourcesCommon = {
|
||||
pname = "${info.pname}-resources";
|
||||
inherit (info) version src;
|
||||
@@ -32,7 +48,7 @@ let
|
||||
npmDeps = pkgs.fetchNpmDeps {
|
||||
inherit (info) pname version;
|
||||
src = "${info.src}/frontend";
|
||||
hash = "sha256-UWuJpKNYj2Xn34rpMDZ75pzMYUOLQjPeGuJ/QlPbX9A=";
|
||||
hash = "sha256-D8VCNK+Ca3gxO+5wriBn8FszG8/x8n/zM6/MPo9E2j4=";
|
||||
};
|
||||
|
||||
npmRoot = "frontend";
|
||||
@@ -41,11 +57,17 @@ let
|
||||
|
||||
nativeBuildInputs = tools.frontend ++ [ pkgs.npmHooks.npmConfigHook ];
|
||||
|
||||
prePatch = ''
|
||||
mkdir branding
|
||||
cp -r ${branding}/* branding
|
||||
cp ${info.src}/.branding branding/.branding
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
export HOME="$TMPDIR"
|
||||
|
||||
pushd frontend
|
||||
npm run build-native${if dev then "-dev" else ""}
|
||||
npm run native:build-${if dev then "dev" else "production"}
|
||||
popd
|
||||
'';
|
||||
|
||||
@@ -89,6 +111,11 @@ deps.crane.lib.buildPackage (
|
||||
{ }
|
||||
);
|
||||
|
||||
postUnpack = ''
|
||||
mkdir ./branding
|
||||
cp -r ${branding}/* ./branding
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp target/${if dev then "debug" else "release"}/graphite $out/bin/graphite
|
||||
@@ -97,7 +124,7 @@ deps.crane.lib.buildPackage (
|
||||
cp $src/desktop/assets/*.desktop $out/share/applications/
|
||||
|
||||
mkdir -p $out/share/icons/hicolor/scalable/apps
|
||||
cp $src/desktop/assets/graphite-icon-color.svg $out/share/icons/hicolor/scalable/apps/
|
||||
cp ${branding}/app-icons/graphite.svg $out/share/icons/hicolor/scalable/apps/
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
|
||||
Reference in New Issue
Block a user