2021-07-22 23:01:41 +00:00
|
|
|
{ lib
|
2022-10-21 09:48:53 +00:00
|
|
|
, stdenvNoCC
|
2021-07-22 23:01:41 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, glib
|
2022-06-14 20:30:39 +00:00
|
|
|
, gnome-shell
|
2021-07-22 23:01:41 +00:00
|
|
|
, gtk-engine-murrine
|
|
|
|
, gtk_engines
|
|
|
|
, inkscape
|
|
|
|
, jdupes
|
|
|
|
, optipng
|
|
|
|
, sassc
|
|
|
|
, which
|
2022-01-13 13:56:01 +00:00
|
|
|
, buttonSizeVariants ? [] # default to standard
|
|
|
|
, buttonVariants ? [] # default to all
|
|
|
|
, colorVariants ? [] # default to all
|
|
|
|
, opacityVariants ? [] # default to all
|
|
|
|
, themeVariants ? [] # default to MacOS blue
|
|
|
|
, wallpapers ? false
|
2022-05-12 20:55:47 +00:00
|
|
|
, gitUpdater
|
2021-07-22 23:01:41 +00:00
|
|
|
}:
|
2019-01-02 22:23:49 +00:00
|
|
|
|
2022-01-13 13:56:01 +00:00
|
|
|
let
|
2023-07-25 13:29:10 +00:00
|
|
|
|
2019-01-02 22:23:49 +00:00
|
|
|
pname = "mojave-gtk-theme";
|
2023-11-03 13:17:58 +00:00
|
|
|
version = "2023-08-04";
|
2023-07-25 13:29:10 +00:00
|
|
|
|
|
|
|
main_src = fetchFromGitHub {
|
|
|
|
owner = "vinceliuice";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-11-03 13:17:58 +00:00
|
|
|
hash = "sha256-boS/GPjuJV5lZjyHW7tG74T6a3SASQVGnSz++5HkCuw=";
|
2023-07-25 13:29:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
wallpapers_src = fetchFromGitHub {
|
|
|
|
owner = "vinceliuice";
|
|
|
|
repo = pname;
|
2023-11-03 13:17:58 +00:00
|
|
|
rev = "1dc23c2b45d7e073e080cfb02f43aab0e59b6b2c";
|
|
|
|
hash = "sha256-nkw8gXYx8fN1yn0A5M2fWwOvfUQ6izynxRw5JA61InM=";
|
2023-07-25 13:29:10 +00:00
|
|
|
name = "wallpapers";
|
|
|
|
};
|
|
|
|
|
2022-01-13 13:56:01 +00:00
|
|
|
in
|
2023-07-25 13:29:10 +00:00
|
|
|
|
2022-01-13 13:56:01 +00:00
|
|
|
lib.checkListOfEnum "${pname}: button size variants" [ "standard" "small" ] buttonSizeVariants
|
|
|
|
lib.checkListOfEnum "${pname}: button variants" [ "standard" "alt" ] buttonVariants
|
|
|
|
lib.checkListOfEnum "${pname}: color variants" [ "light" "dark" ] colorVariants
|
|
|
|
lib.checkListOfEnum "${pname}: opacity variants" [ "standard" "solid" ] opacityVariants
|
|
|
|
lib.checkListOfEnum "${pname}: theme variants" [ "default" "blue" "purple" "pink" "red" "orange" "yellow" "green" "grey" "all" ] themeVariants
|
|
|
|
|
2022-10-21 09:48:53 +00:00
|
|
|
stdenvNoCC.mkDerivation rec {
|
2023-07-25 13:29:10 +00:00
|
|
|
inherit pname version;
|
2019-01-02 22:23:49 +00:00
|
|
|
|
2023-07-25 13:29:10 +00:00
|
|
|
srcs = [ main_src ] ++ lib.optional wallpapers wallpapers_src;
|
2019-12-13 12:57:14 +00:00
|
|
|
|
2023-07-25 13:29:10 +00:00
|
|
|
sourceRoot = main_src.name;
|
2019-01-02 22:23:49 +00:00
|
|
|
|
2021-07-22 23:01:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
glib
|
2022-06-14 20:30:39 +00:00
|
|
|
gnome-shell
|
2021-07-22 23:01:41 +00:00
|
|
|
inkscape
|
|
|
|
jdupes
|
|
|
|
optipng
|
|
|
|
sassc
|
|
|
|
which
|
|
|
|
];
|
2020-03-19 11:51:48 +00:00
|
|
|
|
2021-07-22 23:01:41 +00:00
|
|
|
buildInputs = [
|
|
|
|
gtk_engines
|
|
|
|
];
|
2019-01-02 22:23:49 +00:00
|
|
|
|
2021-07-22 23:01:41 +00:00
|
|
|
propagatedUserEnvPkgs = [
|
|
|
|
gtk-engine-murrine
|
|
|
|
];
|
|
|
|
|
|
|
|
# These fixup steps are slow and unnecessary.
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontRewriteSymlinks = true;
|
2019-01-02 22:23:49 +00:00
|
|
|
|
2020-03-19 11:51:48 +00:00
|
|
|
postPatch = ''
|
2022-06-14 20:30:39 +00:00
|
|
|
patchShebangs \
|
|
|
|
install.sh \
|
|
|
|
src/main/gtk-3.0/make_gresource_xml.sh \
|
|
|
|
src/main/gtk-4.0/make_gresource_xml.sh
|
2020-03-19 11:51:48 +00:00
|
|
|
|
2021-07-22 23:01:41 +00:00
|
|
|
for f in \
|
|
|
|
render-assets.sh \
|
|
|
|
src/assets/cinnamon/thumbnails/render-thumbnails.sh \
|
|
|
|
src/assets/gtk-2.0/render-assets.sh \
|
|
|
|
src/assets/gtk/common-assets/render-assets.sh \
|
|
|
|
src/assets/gtk/thumbnails/render-thumbnails.sh \
|
|
|
|
src/assets/gtk/windows-assets/render-alt-assets.sh \
|
|
|
|
src/assets/gtk/windows-assets/render-alt-small-assets.sh \
|
|
|
|
src/assets/gtk/windows-assets/render-assets.sh \
|
|
|
|
src/assets/gtk/windows-assets/render-small-assets.sh \
|
|
|
|
src/assets/metacity-1/render-assets.sh \
|
|
|
|
src/assets/xfwm4/render-assets.sh
|
2020-03-19 11:51:48 +00:00
|
|
|
do
|
2022-06-14 20:30:39 +00:00
|
|
|
patchShebangs $f
|
2020-03-19 11:51:48 +00:00
|
|
|
substituteInPlace $f \
|
2020-09-10 18:38:25 +00:00
|
|
|
--replace /usr/bin/inkscape ${inkscape}/bin/inkscape \
|
2020-03-19 11:51:48 +00:00
|
|
|
--replace /usr/bin/optipng ${optipng}/bin/optipng
|
|
|
|
done
|
2023-06-13 15:13:35 +00:00
|
|
|
|
|
|
|
${lib.optionalString wallpapers ''
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 17:18:01 +00:00
|
|
|
for f in ../${wallpapers_src.name}/Mojave{,-timed}.xml; do
|
2023-06-13 15:13:35 +00:00
|
|
|
substituteInPlace $f --replace /usr $out
|
|
|
|
done
|
|
|
|
''}
|
2020-03-19 11:51:48 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-07-22 23:01:41 +00:00
|
|
|
runHook preInstall
|
2022-01-13 12:59:55 +00:00
|
|
|
|
2022-01-13 13:56:01 +00:00
|
|
|
name= ./install.sh \
|
|
|
|
${lib.optionalString (buttonSizeVariants != []) "--small " + builtins.toString buttonSizeVariants} \
|
|
|
|
${lib.optionalString (buttonVariants != []) "--alt " + builtins.toString buttonVariants} \
|
|
|
|
${lib.optionalString (colorVariants != []) "--color " + builtins.toString colorVariants} \
|
|
|
|
${lib.optionalString (opacityVariants != []) "--opacity " + builtins.toString opacityVariants} \
|
|
|
|
${lib.optionalString (themeVariants != []) "--theme " + builtins.toString themeVariants} \
|
2023-11-03 13:17:58 +00:00
|
|
|
--icon nixos \
|
2022-01-13 13:56:01 +00:00
|
|
|
--dest $out/share/themes
|
2022-01-13 12:59:55 +00:00
|
|
|
|
2022-01-13 13:56:01 +00:00
|
|
|
${lib.optionalString wallpapers ''
|
2023-06-13 15:13:35 +00:00
|
|
|
mkdir -p $out/share/backgrounds/Mojave
|
|
|
|
mkdir -p $out/share/gnome-background-properties
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 17:18:01 +00:00
|
|
|
cp -a ../${wallpapers_src.name}/Mojave*.jpeg $out/share/backgrounds/Mojave/
|
|
|
|
cp -a ../${wallpapers_src.name}/Mojave-timed.xml $out/share/backgrounds/Mojave/
|
|
|
|
cp -a ../${wallpapers_src.name}/Mojave.xml $out/share/gnome-background-properties/
|
2022-01-13 13:56:01 +00:00
|
|
|
''}
|
2022-01-13 12:59:55 +00:00
|
|
|
|
2022-10-21 09:48:53 +00:00
|
|
|
# Replace duplicate files with soft links to the first file in each
|
2022-01-13 12:59:55 +00:00
|
|
|
# set of duplicates, reducing the installed size in about 53%
|
2022-10-21 09:48:53 +00:00
|
|
|
jdupes --quiet --link-soft --recurse $out/share
|
2022-01-13 12:59:55 +00:00
|
|
|
|
2021-07-22 23:01:41 +00:00
|
|
|
runHook postInstall
|
2019-01-02 22:23:49 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-27 21:12:05 +00:00
|
|
|
passthru.updateScript = gitUpdater { };
|
2022-05-12 20:55:47 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-01-02 22:23:49 +00:00
|
|
|
description = "Mac OSX Mojave like theme for GTK based desktop environments";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/vinceliuice/Mojave-gtk-theme";
|
2021-07-22 23:01:41 +00:00
|
|
|
license = licenses.gpl3Only;
|
2019-01-02 22:23:49 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.romildo ];
|
|
|
|
};
|
|
|
|
}
|