-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
system76-wallpapers: init at 0-unstable-2024-04-26
(cherry picked from commit 2565eb3)
- Loading branch information
1 parent
f16fe69
commit b84e167
Showing
2 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
BACKGROUNDS=$(wildcard backgrounds/*) | ||
SCALED=$(sort $(patsubst backgrounds/%, scaled/%, $(BACKGROUNDS))) | ||
|
||
prefix ?= /usr | ||
datarootdir = $(prefix)/share | ||
datadir = $(datarootdir) | ||
|
||
.PHONY: all clean install uninstall | ||
|
||
all: $(SCALED) scaled/info.xml | ||
|
||
clean: | ||
rm -rf build scaled | ||
|
||
install: all | ||
for file in $(SCALED); do \ | ||
install -D -m 0644 "$$file" "$(DESTDIR)$(datadir)/backgrounds/system76/$$(basename "$$file")"; \ | ||
done | ||
install -D -m 0644 "scaled/info.xml" "$(DESTDIR)$(datadir)/gnome-background-properties/system76-wallpapers.xml" | ||
|
||
uninstall: | ||
for file in $(SCALED); do \ | ||
rm -f "$(DESTDIR)$(datadir)/backgrounds/system76/$$(basename "$$file")"; \ | ||
done | ||
rmdir --ignore-fail-on-non-empty "$(DESTDIR)$(datadir)/backgrounds/system76/" | ||
rm -f "$(DESTDIR)$(datadir)/gnome-background-properties/system76-wallpapers.xml" | ||
rmdir --ignore-fail-on-non-empty "$(DESTDIR)$(datadir)/gnome-background-properties/" | ||
|
||
scaled/%: backgrounds/% | ||
@mkdir -p build scaled | ||
magick "$<" -resize "3840x2160^" "build/$*" | ||
mv "build/$*" "$@" | ||
|
||
scaled/info.xml: $(SCALED) | ||
@mkdir -p build scaled | ||
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > "build/info.xml" | ||
echo "<!DOCTYPE wallpapers SYSTEM \"gnome-wp-list.dtd\">" >> "build/info.xml" | ||
echo "<wallpapers>" >> "build/info.xml" | ||
for file in $(SCALED); do \ | ||
filename="$$(basename "$$file")"; \ | ||
name="$${filename%.*}"; \ | ||
echo " <wallpaper>" >> "build/info.xml"; \ | ||
echo " <name>$$name</name>" >> "build/info.xml"; \ | ||
echo " <filename>/usr/share/backgrounds/system76/$$(basename "$$file")</filename>" >> "build/info.xml"; \ | ||
echo " <options>zoom</options>" >> "build/info.xml"; \ | ||
echo " <pcolor>#000000</pcolor>" >> "build/info.xml"; \ | ||
echo " <scolor>#000000</scolor>" >> "build/info.xml"; \ | ||
echo " <shade_type>solid</shade_type>" >> "build/info.xml"; \ | ||
echo " </wallpaper>" >> "build/info.xml"; \ | ||
done | ||
echo "</wallpapers>" >> "build/info.xml" | ||
mv "build/info.xml" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
lib, | ||
stdenvNoCC, | ||
fetchFromGitHub, | ||
fetchpatch, | ||
imagemagick, | ||
nix-update-script, | ||
}: | ||
|
||
stdenvNoCC.mkDerivation { | ||
pname = "system76-wallpapers"; | ||
version = "0-unstable-2024-04-26"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "pop-os"; | ||
repo = "system76-wallpapers"; | ||
rev = "ff1e25c79d10c699dfb695374d5ae7b3f8031b2b"; | ||
forceFetchGit = true; | ||
fetchLFS = true; | ||
hash = "sha256-5rddxbi/hRPy93DqswG54HzWK33Y5TteGB8SKjLXJZk="; | ||
}; | ||
|
||
prePatch = '' | ||
cp ${./Makefile} Makefile | ||
''; | ||
|
||
nativeBuildInputs = [ imagemagick ]; | ||
|
||
makeFlags = [ "prefix=$(out)" ]; | ||
|
||
passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; | ||
|
||
meta = { | ||
description = "Wallpapers for System76 products"; | ||
homepage = "https://system76.com/"; | ||
license = with lib.licenses; [ | ||
unfree # No license specified | ||
]; | ||
maintainers = with lib.maintainers; [ pandapip1 ]; | ||
platforms = lib.platforms.all; | ||
}; | ||
} |