mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
91
.nix/pkgs/graphite-bundle.nix
Normal file
91
.nix/pkgs/graphite-bundle.nix
Normal file
@@ -0,0 +1,91 @@
|
||||
{
|
||||
pkgs,
|
||||
graphite,
|
||||
}:
|
||||
let
|
||||
bundle =
|
||||
{
|
||||
pkgs,
|
||||
graphite,
|
||||
archive ? false,
|
||||
compression ? null,
|
||||
passthru ? {},
|
||||
}:
|
||||
(
|
||||
let
|
||||
tar = if compression == null then archive else true;
|
||||
nameArchiveSuffix = if tar then ".tar" else "";
|
||||
nameCompressionSuffix = if compression == null then "" else "." + compression;
|
||||
name = "graphite-bundle${nameArchiveSuffix}${nameCompressionSuffix}";
|
||||
build = ''
|
||||
mkdir -p out
|
||||
mkdir -p out/bin
|
||||
cp ${graphite}/bin/.graphite-wrapped out/bin/graphite
|
||||
chmod -v +w out/bin/graphite
|
||||
patchelf --set-rpath '$ORIGIN/../lib:$ORIGIN/../lib/cef' --set-interpreter '/lib64/ld-linux-x86-64.so.2' out/bin/graphite
|
||||
mkdir -p out/lib/cef
|
||||
mkdir -p ./cef
|
||||
tar -xvf ${pkgs.cef-binary.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
|
||||
${pkgs.bintools}/bin/strip out/lib/cef/*.so*
|
||||
cp -r ${graphite}/share out/share
|
||||
'';
|
||||
install =
|
||||
if tar then
|
||||
''
|
||||
cd out
|
||||
tar -c \
|
||||
--sort=name \
|
||||
--mtime='@1' --clamp-mtime \
|
||||
--owner=0 --group=0 --numeric-owner \
|
||||
--mode='u=rwX,go=rX' \
|
||||
--format=posix \
|
||||
--pax-option=delete=atime,delete=ctime \
|
||||
--no-acls --no-xattrs --no-selinux \
|
||||
* ${
|
||||
if compression == "xz" then
|
||||
"| xz "
|
||||
else if compression == "gz" then
|
||||
"| gzip -n "
|
||||
else
|
||||
""
|
||||
}> $out
|
||||
''
|
||||
else
|
||||
''
|
||||
mkdir -p $out
|
||||
cp -r out/* $out/
|
||||
'';
|
||||
in
|
||||
|
||||
pkgs.runCommand name
|
||||
{
|
||||
inherit passthru;
|
||||
}
|
||||
''
|
||||
${build}
|
||||
${install}
|
||||
''
|
||||
);
|
||||
in
|
||||
bundle {
|
||||
inherit pkgs graphite;
|
||||
passthru = {
|
||||
tar = bundle {
|
||||
inherit pkgs graphite;
|
||||
archive = true;
|
||||
passthru = {
|
||||
gz = bundle {
|
||||
inherit pkgs graphite;
|
||||
compression = "gz";
|
||||
};
|
||||
xz = bundle {
|
||||
inherit pkgs graphite;
|
||||
compression = "xz";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
37
.nix/pkgs/graphite-flatpak-manifest.nix
Normal file
37
.nix/pkgs/graphite-flatpak-manifest.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
pkgs,
|
||||
archive,
|
||||
}:
|
||||
|
||||
(pkgs.formats.json { }).generate "art.graphite.Graphite.json" {
|
||||
app-id = "art.graphite.Graphite";
|
||||
runtime = "org.freedesktop.Platform";
|
||||
runtime-version = "25.08";
|
||||
sdk = "org.freedesktop.Sdk";
|
||||
command = "graphite";
|
||||
finish-args = [
|
||||
"--device=dri"
|
||||
"--share=ipc"
|
||||
"--socket=wayland"
|
||||
"--socket=fallback-x11"
|
||||
"--share=network"
|
||||
];
|
||||
modules = [
|
||||
{
|
||||
name = "app";
|
||||
buildsystem = "simple";
|
||||
build-commands = [
|
||||
"mkdir -p /app"
|
||||
"cp -r ./* /app/"
|
||||
"chmod +x /app/bin/*"
|
||||
];
|
||||
sources = [
|
||||
{
|
||||
type = "archive";
|
||||
path = archive;
|
||||
strip-components = 0;
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -124,7 +124,7 @@ deps.crane.lib.buildPackage (
|
||||
cp $src/desktop/assets/*.desktop $out/share/applications/
|
||||
|
||||
mkdir -p $out/share/icons/hicolor/scalable/apps
|
||||
cp ${branding}/app-icons/graphite.svg $out/share/icons/hicolor/scalable/apps/
|
||||
cp ${branding}/app-icons/graphite.svg $out/share/icons/hicolor/scalable/apps/art.graphite.Graphite.svg
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
|
||||
Reference in New Issue
Block a user