Skip to content

Commit 2565eb3

Browse files
committed
system76-wallpapers: init at 0-unstable-2024-04-26
1 parent a3f3012 commit 2565eb3

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
BACKGROUNDS=$(wildcard backgrounds/*)
2+
SCALED=$(sort $(patsubst backgrounds/%, scaled/%, $(BACKGROUNDS)))
3+
4+
prefix ?= /usr
5+
datarootdir = $(prefix)/share
6+
datadir = $(datarootdir)
7+
8+
.PHONY: all clean install uninstall
9+
10+
all: $(SCALED) scaled/info.xml
11+
12+
clean:
13+
rm -rf build scaled
14+
15+
install: all
16+
for file in $(SCALED); do \
17+
install -D -m 0644 "$$file" "$(DESTDIR)$(datadir)/backgrounds/system76/$$(basename "$$file")"; \
18+
done
19+
install -D -m 0644 "scaled/info.xml" "$(DESTDIR)$(datadir)/gnome-background-properties/system76-wallpapers.xml"
20+
21+
uninstall:
22+
for file in $(SCALED); do \
23+
rm -f "$(DESTDIR)$(datadir)/backgrounds/system76/$$(basename "$$file")"; \
24+
done
25+
rmdir --ignore-fail-on-non-empty "$(DESTDIR)$(datadir)/backgrounds/system76/"
26+
rm -f "$(DESTDIR)$(datadir)/gnome-background-properties/system76-wallpapers.xml"
27+
rmdir --ignore-fail-on-non-empty "$(DESTDIR)$(datadir)/gnome-background-properties/"
28+
29+
scaled/%: backgrounds/%
30+
@mkdir -p build scaled
31+
magick "$<" -resize "3840x2160^" "build/$*"
32+
mv "build/$*" "$@"
33+
34+
scaled/info.xml: $(SCALED)
35+
@mkdir -p build scaled
36+
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > "build/info.xml"
37+
echo "<!DOCTYPE wallpapers SYSTEM \"gnome-wp-list.dtd\">" >> "build/info.xml"
38+
echo "<wallpapers>" >> "build/info.xml"
39+
for file in $(SCALED); do \
40+
filename="$$(basename "$$file")"; \
41+
name="$${filename%.*}"; \
42+
echo " <wallpaper>" >> "build/info.xml"; \
43+
echo " <name>$$name</name>" >> "build/info.xml"; \
44+
echo " <filename>/usr/share/backgrounds/system76/$$(basename "$$file")</filename>" >> "build/info.xml"; \
45+
echo " <options>zoom</options>" >> "build/info.xml"; \
46+
echo " <pcolor>#000000</pcolor>" >> "build/info.xml"; \
47+
echo " <scolor>#000000</scolor>" >> "build/info.xml"; \
48+
echo " <shade_type>solid</shade_type>" >> "build/info.xml"; \
49+
echo " </wallpaper>" >> "build/info.xml"; \
50+
done
51+
echo "</wallpapers>" >> "build/info.xml"
52+
mv "build/info.xml" "$@"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
lib,
3+
stdenvNoCC,
4+
fetchFromGitHub,
5+
fetchpatch,
6+
imagemagick,
7+
nix-update-script,
8+
}:
9+
10+
stdenvNoCC.mkDerivation {
11+
pname = "system76-wallpapers";
12+
version = "0-unstable-2024-04-26";
13+
14+
src = fetchFromGitHub {
15+
owner = "pop-os";
16+
repo = "system76-wallpapers";
17+
rev = "ff1e25c79d10c699dfb695374d5ae7b3f8031b2b";
18+
forceFetchGit = true;
19+
fetchLFS = true;
20+
hash = "sha256-5rddxbi/hRPy93DqswG54HzWK33Y5TteGB8SKjLXJZk=";
21+
};
22+
23+
prePatch = ''
24+
cp ${./Makefile} Makefile
25+
'';
26+
27+
nativeBuildInputs = [ imagemagick ];
28+
29+
makeFlags = [ "prefix=$(out)" ];
30+
31+
passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
32+
33+
meta = {
34+
description = "Wallpapers for System76 products";
35+
homepage = "https://system76.com/";
36+
license = with lib.licenses; [
37+
unfree # No license specified
38+
];
39+
maintainers = with lib.maintainers; [ pandapip1 ];
40+
platforms = lib.platforms.all;
41+
};
42+
}

0 commit comments

Comments
 (0)