mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-03 17:18:12 +08:00
Update CEF
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
deps,
|
||||
self,
|
||||
system,
|
||||
...
|
||||
@@ -33,7 +34,7 @@ let
|
||||
cp -r ${graphite}/share out/share
|
||||
mkdir -p out/lib/cef
|
||||
mkdir -p ./cef
|
||||
tar -xvf ${pkgs.cef-binary.src} -C ./cef --strip-components=1
|
||||
tar -xvf ${self.packages.${system}.graphite-cef.src} -C ./cef --strip-components=1
|
||||
cp -r ./cef/Release/* out/lib/cef/
|
||||
cp -r ./cef/Resources/* out/lib/cef/
|
||||
find "out/lib/cef/locales" -type f ! -name 'en-US*' -delete
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
versionFile = builtins.fromJSON (builtins.readFile ./version.json);
|
||||
|
||||
version = versionFile.version;
|
||||
hash = selectSystem versionFile.hashes;
|
||||
|
||||
selectSystem =
|
||||
attrs:
|
||||
attrs.${pkgs.stdenv.hostPlatform.system}
|
||||
or (throw "Unsupported system ${pkgs.stdenv.hostPlatform.system}");
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://cef-builds.spotifycdn.com/cef_binary_${version}_${
|
||||
selectSystem {
|
||||
aarch64-linux = "linuxarm64";
|
||||
x86_64-linux = "linux64";
|
||||
}
|
||||
}_minimal.tar.bz2";
|
||||
hash = hash;
|
||||
};
|
||||
in
|
||||
pkgs.cef-binary.overrideAttrs (finalAttrs: {
|
||||
version = builtins.head (builtins.split "\\+" version);
|
||||
inherit src;
|
||||
postInstall = ''
|
||||
rm -r $out/* $out/.* || true
|
||||
strip ./Release/*.so*
|
||||
mv ./Release/* $out/
|
||||
find "./Resources/locales" -maxdepth 1 -type f ! -name 'en-US.pak' -delete
|
||||
mv ./Resources/* $out/
|
||||
mv ./include $out/
|
||||
|
||||
cat ./CREDITS.html | ${pkgs.xz}/bin/xz -9 -e -c > $out/CREDITS.html.xz
|
||||
|
||||
echo '${
|
||||
builtins.toJSON {
|
||||
type = "minimal";
|
||||
name = builtins.baseNameOf finalAttrs.src.url;
|
||||
sha1 = "";
|
||||
}
|
||||
}' > $out/archive.json
|
||||
'';
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": "146.0.12+g6214c8e+chromium-146.0.7680.179",
|
||||
"hashes": {
|
||||
"aarch64-linux": "sha256-pi3fV3O31YMHcOh+/lnk2gWI6/MaSNAiUgFhD09d7u0=",
|
||||
"x86_64-linux": "sha256-b2HKaSEEXkZsnsBw9bL2JGmKWwRN5l2wu/O1DxfhAgE="
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ let
|
||||
pkgs.pkg-config
|
||||
pkgs.lld
|
||||
];
|
||||
env = deps.cef.env;
|
||||
env.CEF_PATH = self.packages.${system}.graphite-cef;
|
||||
buildPhase =
|
||||
let
|
||||
profile = if dev then "dev" else "release";
|
||||
@@ -97,10 +97,11 @@ deps.crane.lib.buildPackage (
|
||||
npmConfigScript = "setup";
|
||||
makeCacheWritable = true;
|
||||
|
||||
env = deps.cef.env // {
|
||||
env = {
|
||||
RASTER_NODES_SHADER_PATH = self.packages.${system}.graphite-raster-nodes-shaders;
|
||||
GRAPHITE_GIT_COMMIT_HASH = self.rev or "unknown";
|
||||
GRAPHITE_GIT_COMMIT_DATE = self.lastModified or "unknown";
|
||||
CEF_PATH = self.packages.${system}.graphite-cef;
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
@@ -149,7 +150,7 @@ deps.crane.lib.buildPackage (
|
||||
remove-references-to -t "${common.cargoVendorDir}" $out/bin/graphite
|
||||
|
||||
patchelf \
|
||||
--set-rpath "${pkgs.lib.makeLibraryPath libs}:${deps.cef.env.CEF_PATH}" \
|
||||
--set-rpath "${pkgs.lib.makeLibraryPath libs}:${self.packages.${system}.graphite-cef}" \
|
||||
--add-needed libGL.so \
|
||||
$out/bin/graphite
|
||||
'';
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
info,
|
||||
deps,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cargoVendorDir = deps.crane.lib.vendorCargoDeps { inherit (info) src; };
|
||||
common = {
|
||||
pname = "third-party-licenses";
|
||||
inherit (info) version src;
|
||||
inherit cargoVendorDir;
|
||||
nativeBuildInputs = [ pkgs.pkg-config ];
|
||||
buildInputs = [ pkgs.openssl ];
|
||||
strictDeps = true;
|
||||
env = deps.cef.env // {
|
||||
CARGO_PROFILE = "dev";
|
||||
};
|
||||
cargoExtraArgs = "-p third-party-licenses --features desktop";
|
||||
doCheck = false;
|
||||
};
|
||||
in
|
||||
deps.crane.lib.buildPackage (
|
||||
common
|
||||
// {
|
||||
inherit cargoVendorDir;
|
||||
cargoArtifacts = deps.crane.lib.buildDepsOnly common;
|
||||
meta.mainProgram = "third-party-licenses";
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user