diff --git a/pkgs/data/misc/fedora-backgrounds/default.nix b/pkgs/data/misc/fedora-backgrounds/default.nix new file mode 100644 index 000000000000..31bc28a9f9c1 --- /dev/null +++ b/pkgs/data/misc/fedora-backgrounds/default.nix @@ -0,0 +1,23 @@ +{ callPackage, lib, fetchurl }: + +let + fedoraBackground = callPackage ./generic.nix { }; +in { + f32 = fedoraBackground rec { + version = "32.2.2"; + src = fetchurl { + url = "https://github.com/fedoradesign/backgrounds/releases/download/v${version}/f${lib.versions.major version}-backgrounds-${version}.tar.xz"; + hash = "sha256-1F75aae7Jj7M2IPn/vWKcUF+O5mZ0Yey7hWuFj/4Fhg="; + }; + }; + + f33 = fedoraBackground rec { + version = "33.0.7"; + src = fetchurl { + url = "https://github.com/fedoradesign/backgrounds/releases/download/v${version}/f${lib.versions.major version}-backgrounds-${version}.tar.xz"; + hash = "sha256-lAn5diEYebCo2ZJCOn9rD87rOasUU0qnSOr0EnZKW4o="; + }; + # Fix broken symlinks in the Xfce background directory. + patches = [ ./f33-fix-xfce-path.patch ]; + }; +} diff --git a/pkgs/data/misc/fedora-backgrounds/f33-fix-xfce-path.patch b/pkgs/data/misc/fedora-backgrounds/f33-fix-xfce-path.patch new file mode 100644 index 000000000000..eabdacddaa53 --- /dev/null +++ b/pkgs/data/misc/fedora-backgrounds/f33-fix-xfce-path.patch @@ -0,0 +1,15 @@ +diff --git a/default/Makefile b/default/Makefile +index ec8095a..9391f8f 100644 +--- a/default/Makefile ++++ b/default/Makefile +@@ -48,8 +48,8 @@ install: + + #~ XFCE background + $(MKDIR) $(XFCE_BG_DIR) +- $(LN_S) ../default/$(WP_NAME)-02-day.png \ ++ $(LN_S) ../../backgrounds/$(WP_NAME)/default/$(WP_NAME)-02-day.png \ + $(XFCE_BG_DIR)/$(WP_NAME).png + for tod in 01-dawn 03-dusk 04-night; do \ +- $(LN_S) ../default/$(WP_NAME)-$${tod}.png $(XFCE_BG_DIR)/$(WP_NAME)-$${tod}.png; \ ++ $(LN_S) ../../backgrounds/$(WP_NAME)/default/$(WP_NAME)-$${tod}.png $(XFCE_BG_DIR)/$(WP_NAME)-$${tod}.png; \ + done; diff --git a/pkgs/data/misc/fedora-backgrounds/generic.nix b/pkgs/data/misc/fedora-backgrounds/generic.nix new file mode 100644 index 000000000000..25043c34e5d9 --- /dev/null +++ b/pkgs/data/misc/fedora-backgrounds/generic.nix @@ -0,0 +1,42 @@ +{ stdenv +, coreutils +}: + +{ version +, src +, patches ? [ ] +}: + +stdenv.mkDerivation { + inherit patches src version; + + pname = "fedora${stdenv.lib.versions.major version}-backgrounds"; + + dontBuild = true; + + postPatch = '' + for f in default/Makefile extras/Makefile; do + substituteInPlace $f \ + --replace "usr/share" "share" \ + --replace "/usr/bin/" "" \ + --replace "/bin/" "" + done + + for f in $(find . -name '*.xml'); do + substituteInPlace $f \ + --replace "/usr/share" "$out/share" + done; + ''; + + installFlags = [ + "DESTDIR=$(out)" + ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/fedoradesign/backgrounds"; + description = "A set of default and supplemental wallpapers for Fedora"; + license = licenses.cc-by-sa-40; + platforms = platforms.unix; + maintainers = with maintainers; [ danieldk ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9f1c9c47b3ec..0fc1b9d97a5d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1056,6 +1056,8 @@ in container-linux-config-transpiler = callPackage ../development/tools/container-linux-config-transpiler { }; + fedora-backgrounds = callPackage ../data/misc/fedora-backgrounds { }; + fedora-coreos-config-transpiler = callPackage ../development/tools/fedora-coreos-config-transpiler { }; ccextractor = callPackage ../applications/video/ccextractor { };