File tree Expand file tree Collapse file tree 13 files changed +225
-122
lines changed
Expand file tree Collapse file tree 13 files changed +225
-122
lines changed Original file line number Diff line number Diff line change 1+ name : Build Linux Bundle
2+
3+ on :
4+ workflow_dispatch : {}
5+ push :
6+ branches :
7+ - main
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : read
14+ steps :
15+ - uses : actions/checkout@v4
16+ - uses : DeterminateSystems/nix-installer-action@main
17+ - uses : DeterminateSystems/magic-nix-cache-action@main
18+
19+ - name : Free disk space
20+ run : sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
21+
22+ - name : Build Linux Bundle
23+ run : nix build .nix#graphite-bundle.tar.xz && cp ./result ./graphite-bundle.tar.xz
24+
25+ - name : Upload Linux Bundle
26+ uses : actions/upload-artifact@v4
27+ with :
28+ path : graphite-bundle.tar.xz
Original file line number Diff line number Diff line change 11branding /
22target /
33result /
4+ .flatpak-builder /
45* .spv
56* .exrc
67perf.data *
Original file line number Diff line number Diff line change 11{ pkgs , inputs , ... } :
22
33let
4- cef = pkgs . cef-binary . overrideAttrs ( _ : _ : {
4+ cef = pkgs . cef-binary . overrideAttrs {
55 postInstall = ''
66 strip $out/Release/*.so*
77 '' ;
8- } ) ;
8+ } ;
99
10- cefPath = pkgs . runCommand "cef-path" { } ''
10+ cefPath = pkgs . runCommand "cef-path" { } ''
1111 mkdir -p $out
1212
1313 ln -s ${ cef } /include $out/include
1414 find ${ cef } /Release -name "*" -type f -exec ln -s {} $out/ \;
1515 find ${ cef } /Resources -name "*" -maxdepth 1 -exec ln -s {} $out/ \;
1616
17- echo '${ builtins . toJSON {
18- type = "minimal" ;
19- name = builtins . baseNameOf cef . src . url ;
20- sha1 = "" ;
21- } } ' > $out/archive.json
17+ echo '${
18+ builtins . toJSON {
19+ type = "minimal" ;
20+ name = builtins . baseNameOf cef . src . url ;
21+ sha1 = "" ;
22+ }
23+ } ' > $out/archive.json
2224 '' ;
2325in
2426{
Original file line number Diff line number Diff line change 3333 info = {
3434 pname = "graphite" ;
3535 version = "unstable" ;
36- src = ./.. ;
36+ src = pkgs . lib . cleanSourceWith {
37+ src = ./.. ;
38+ filter = path : type : ! ( type == "directory" && builtins . baseNameOf path == ".nix" ) ;
39+ } ;
3740 } ;
3841
3942 pkgs = import inputs . nixpkgs {
129132 embeddedResources = false ;
130133 dev = true ;
131134 } ;
135+ graphite-bundle = import ./pkgs/graphite-bundle.nix {
136+ inherit pkgs graphite ;
137+ } ;
138+ graphite-flatpak-manifest = import ./pkgs/graphite-flatpak-manifest.nix {
139+ inherit pkgs ;
140+ archive = graphite-bundle . tar ;
141+ } ;
132142 #TODO: graphene-cli = import ./pkgs/graphene-cli.nix { inherit info pkgs inputs deps libs tools; };
133143 raster-nodes-shaders = import ./pkgs/raster-nodes-shaders.nix {
134144 inherit
Original file line number Diff line number Diff line change 1+ {
2+ pkgs ,
3+ graphite ,
4+ } :
5+ let
6+ bundle =
7+ {
8+ pkgs ,
9+ graphite ,
10+ archive ? false ,
11+ compression ? null ,
12+ passthru ? { } ,
13+ } :
14+ (
15+ let
16+ tar = if compression == null then archive else true ;
17+ nameArchiveSuffix = if tar then ".tar" else "" ;
18+ nameCompressionSuffix = if compression == null then "" else "." + compression ;
19+ name = "graphite-bundle${ nameArchiveSuffix } ${ nameCompressionSuffix } " ;
20+ build = ''
21+ mkdir -p out
22+ mkdir -p out/bin
23+ cp ${ graphite } /bin/.graphite-wrapped out/bin/graphite
24+ chmod -v +w out/bin/graphite
25+ patchelf --set-rpath '$ORIGIN/../lib:$ORIGIN/../lib/cef' --set-interpreter '/lib64/ld-linux-x86-64.so.2' out/bin/graphite
26+ mkdir -p out/lib/cef
27+ mkdir -p ./cef
28+ tar -xvf ${ pkgs . cef-binary . src } -C ./cef --strip-components=1
29+ cp -r ./cef/Release/* out/lib/cef/
30+ cp -r ./cef/Resources/* out/lib/cef/
31+ find "out/lib/cef/locales" -type f ! -name 'en-US*' -delete
32+ ${ pkgs . bintools } /bin/strip out/lib/cef/*.so*
33+ cp -r ${ graphite } /share out/share
34+ '' ;
35+ install =
36+ if tar then
37+ ''
38+ cd out
39+ tar -c \
40+ --sort=name \
41+ --mtime='@1' --clamp-mtime \
42+ --owner=0 --group=0 --numeric-owner \
43+ --mode='u=rwX,go=rX' \
44+ --format=posix \
45+ --pax-option=delete=atime,delete=ctime \
46+ --no-acls --no-xattrs --no-selinux \
47+ * ${
48+ if compression == "xz" then
49+ "| xz "
50+ else if compression == "gz" then
51+ "| gzip -n "
52+ else
53+ ""
54+ } > $out
55+ ''
56+ else
57+ ''
58+ mkdir -p $out
59+ cp -r out/* $out/
60+ '' ;
61+ in
62+
63+ pkgs . runCommand name
64+ {
65+ inherit passthru ;
66+ }
67+ ''
68+ ${ build }
69+ ${ install }
70+ ''
71+ ) ;
72+ in
73+ bundle {
74+ inherit pkgs graphite ;
75+ passthru = {
76+ tar = bundle {
77+ inherit pkgs graphite ;
78+ archive = true ;
79+ passthru = {
80+ gz = bundle {
81+ inherit pkgs graphite ;
82+ compression = "gz" ;
83+ } ;
84+ xz = bundle {
85+ inherit pkgs graphite ;
86+ compression = "xz" ;
87+ } ;
88+ } ;
89+ } ;
90+ } ;
91+ }
Original file line number Diff line number Diff line change 1+ {
2+ pkgs ,
3+ archive ,
4+ } :
5+
6+ ( pkgs . formats . json { } ) . generate "art.graphite.Graphite.json" {
7+ app-id = "art.graphite.Graphite" ;
8+ runtime = "org.freedesktop.Platform" ;
9+ runtime-version = "25.08" ;
10+ sdk = "org.freedesktop.Sdk" ;
11+ command = "graphite" ;
12+ finish-args = [
13+ "--device=dri"
14+ "--share=ipc"
15+ "--socket=wayland"
16+ "--socket=fallback-x11"
17+ "--share=network"
18+ ] ;
19+ modules = [
20+ {
21+ name = "app" ;
22+ buildsystem = "simple" ;
23+ build-commands = [
24+ "mkdir -p /app"
25+ "cp -r ./* /app/"
26+ "chmod +x /app/bin/*"
27+ ] ;
28+ sources = [
29+ {
30+ type = "archive" ;
31+ path = archive ;
32+ strip-components = 0 ;
33+ }
34+ ] ;
35+ }
36+ ] ;
37+ }
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ deps.crane.lib.buildPackage (
124124 cp $src/desktop/assets/*.desktop $out/share/applications/
125125
126126 mkdir -p $out/share/icons/hicolor/scalable/apps
127- cp ${ branding } /app-icons/graphite.svg $out/share/icons/hicolor/scalable/apps/
127+ cp ${ branding } /app-icons/graphite.svg $out/share/icons/hicolor/scalable/apps/art.graphite.Graphite.svg
128128 '' ;
129129
130130 postFixup = ''
You can’t perform that action at this time.
0 commit comments