Skip to content

Commit 5931e81

Browse files
committed
fix: add staging directory and tarball creation for asset packaging
This probably fixes CI build failling
1 parent 91b2946 commit 5931e81

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

flake.nix

+33-12
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@
9595
];
9696
}
9797
''
98+
# Create staging directory
99+
staging="$TMPDIR/staging"
100+
mkdir -p "$staging"
101+
102+
# Define asset files
98103
filenames=(
99104
"data/assets/colloid-morghulis-system-hibernate-symbolic.svg"
100105
"data/assets/colloid-morghulis-system-lock-screen-symbolic.svg"
@@ -104,13 +109,26 @@
104109
"data/desktop/com.github.ARKye03.morghulis.desktop.in"
105110
"data/desktop/com.github.ARKye03.morghulis.png"
106111
)
107-
mkdir -p $out
108-
cp ${fhs-morghulis}/bin/${appName} $out/
109-
cp ${fhs-morghulis}/bin/${cliAppName} $out/
112+
113+
# Copy binaries to staging
114+
cp ${fhs-morghulis}/bin/${appName} "$staging/"
115+
cp ${fhs-morghulis}/bin/${cliAppName} "$staging/"
116+
117+
# Copy assets to staging with directory structure
110118
for filename in "''${filenames[@]}"; do
111-
cp -r $src/$filename $out/
119+
mkdir -p "$staging/$(dirname "$filename")"
120+
cp "$src/$filename" "$staging/$filename"
112121
done
113-
tar -cJf $out/morghulis-${version}.tar.xz -C $out .
122+
123+
# Create output directory
124+
mkdir -p $out
125+
126+
# Create tarball from staging directory
127+
cd "$staging"
128+
tar --sort=name \
129+
--owner=0 --group=0 \
130+
--mtime='1970-01-01 00:00:00' \
131+
-cJf "$out/morghulis-${version}.tar.xz" .
114132
'';
115133
gtk-utils = with pkgs; [
116134
gtk4
@@ -168,13 +186,16 @@
168186
++ compiler-utils
169187
++ build-utils
170188
++ astal-libs;
171-
buildInputs = with pkgs; [
172-
pkg-config
173-
networkmanager
174-
glib
175-
gdk-pixbuf
176-
json-glib
177-
] ++ gstPlugins;
189+
buildInputs =
190+
with pkgs;
191+
[
192+
pkg-config
193+
networkmanager
194+
glib
195+
gdk-pixbuf
196+
json-glib
197+
]
198+
++ gstPlugins;
178199
GTK_THEME = "adw-gtk3:dark";
179200
XCURSOR_THEME = "Bibata-Modern-Classic";
180201
XCURSOR_SIZE = "20";

0 commit comments

Comments
 (0)