2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
2022-10-30 15:09:59 +00:00
|
|
|
, stdenvNoCC
|
2021-08-05 21:33:18 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, glib
|
2022-06-16 17:23:12 +00:00
|
|
|
, gnome-shell
|
2021-08-05 21:33:18 +00:00
|
|
|
, gtk-engine-murrine
|
|
|
|
, gtk_engines
|
|
|
|
, inkscape
|
|
|
|
, jdupes
|
|
|
|
, optipng
|
|
|
|
, sassc
|
|
|
|
, which
|
2022-01-19 23:45:15 +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-06-16 17:23:12 +00:00
|
|
|
, gitUpdater
|
2021-08-05 21:33:18 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "mojave-gtk-theme";
|
2022-01-19 23:45:15 +00:00
|
|
|
in
|
|
|
|
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-30 15:09:59 +00:00
|
|
|
stdenvNoCC.mkDerivation rec {
|
2022-01-19 23:45:15 +00:00
|
|
|
inherit pname;
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2023-06-13";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
srcs = [
|
|
|
|
(fetchFromGitHub {
|
|
|
|
owner = "vinceliuice";
|
|
|
|
repo = pname;
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = version;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-0jb/VQ6Z0BGaEka57BWM0pBweP08cr4jfPRdEN/BJ1M=";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
2022-01-19 23:45:15 +00:00
|
|
|
]
|
|
|
|
++
|
|
|
|
lib.optional wallpapers
|
2023-07-15 17:15:38 +00:00
|
|
|
(fetchFromGitHub {
|
|
|
|
owner = "vinceliuice";
|
|
|
|
repo = pname;
|
|
|
|
rev = "0c4ae6ddff7e3fab4959469461c4d4042deb1b2f";
|
|
|
|
hash = "sha256-7LSZSsRt6zTVPLWzuBgwRC1q1MHp5pN/pMl3x2wR8Ow=";
|
|
|
|
name = "wallpapers";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
2022-01-19 23:45:15 +00:00
|
|
|
;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
sourceRoot = "source";
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
glib
|
2022-06-16 17:23:12 +00:00
|
|
|
gnome-shell
|
2021-08-05 21:33:18 +00:00
|
|
|
inkscape
|
|
|
|
jdupes
|
|
|
|
optipng
|
|
|
|
sassc
|
|
|
|
which
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
buildInputs = [
|
|
|
|
gtk_engines
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
propagatedUserEnvPkgs = [
|
|
|
|
gtk-engine-murrine
|
|
|
|
];
|
|
|
|
|
|
|
|
# These fixup steps are slow and unnecessary.
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontRewriteSymlinks = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2022-06-16 17:23:12 +00:00
|
|
|
patchShebangs \
|
|
|
|
install.sh \
|
|
|
|
src/main/gtk-3.0/make_gresource_xml.sh \
|
|
|
|
src/main/gtk-4.0/make_gresource_xml.sh
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +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-04-24 23:36:52 +00:00
|
|
|
do
|
2022-06-16 17:23:12 +00:00
|
|
|
patchShebangs $f
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace $f \
|
2020-09-25 04:45:31 +00:00
|
|
|
--replace /usr/bin/inkscape ${inkscape}/bin/inkscape \
|
2020-04-24 23:36:52 +00:00
|
|
|
--replace /usr/bin/optipng ${optipng}/bin/optipng
|
|
|
|
done
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
${lib.optionalString wallpapers ''
|
|
|
|
for f in ../wallpapers/Mojave{,-timed}.xml; do
|
|
|
|
substituteInPlace $f --replace /usr $out
|
|
|
|
done
|
|
|
|
''}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-08-05 21:33:18 +00:00
|
|
|
runHook preInstall
|
2022-01-19 23:45:15 +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} \
|
|
|
|
--dest $out/share/themes
|
|
|
|
|
|
|
|
${lib.optionalString wallpapers ''
|
2023-07-15 17:15:38 +00:00
|
|
|
mkdir -p $out/share/backgrounds/Mojave
|
|
|
|
mkdir -p $out/share/gnome-background-properties
|
|
|
|
cp -a ../wallpapers/Mojave*.jpeg $out/share/backgrounds/Mojave/
|
|
|
|
cp -a ../wallpapers/Mojave-timed.xml $out/share/backgrounds/Mojave/
|
|
|
|
cp -a ../wallpapers/Mojave.xml $out/share/gnome-background-properties/
|
2022-01-19 23:45:15 +00:00
|
|
|
''}
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
# Replace duplicate files with soft links to the first file in each
|
2022-01-19 23:45:15 +00:00
|
|
|
# set of duplicates, reducing the installed size in about 53%
|
2022-10-30 15:09:59 +00:00
|
|
|
jdupes --quiet --link-soft --recurse $out/share
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
passthru.updateScript = gitUpdater { };
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Mac OSX Mojave like theme for GTK based desktop environments";
|
|
|
|
homepage = "https://github.com/vinceliuice/Mojave-gtk-theme";
|
2021-08-05 21:33:18 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.romildo ];
|
|
|
|
};
|
|
|
|
}
|