Skip to content

Instantly share code, notes, and snippets.

@jD91mZM2
Last active May 4, 2020 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jD91mZM2/828e244ff327133a97b71ba5661d50cd to your computer and use it in GitHub Desktop.
Save jD91mZM2/828e244ff327133a97b71ba5661d50cd to your computer and use it in GitHub Desktop.
{
# Dependencies
stdenv, fetchFromGitHub, gettext, python3, lib, makeWrapper, sassc, glib,
gnome2, gnome3, wrapGAppsHook,
# Plugins
plugins ? import ./plugins.nix,
}:
rec {
plugins = {
oomox-gtk-theme = fetchFromGitHub {
owner = "themix-project";
repo = "oomox-gtk-theme";
rev = "1.12";
sha256 = "015yj9hl283dsgphkva441r1fr580wiyssm4s2x4xfjprqksxg8w";
};
};
oomox = stdenv.mkDerivation rec {
pname = "oomox";
version = "1.13.2.1";
src = fetchFromGitHub {
owner = "themix-project";
repo = pname;
rev = version;
sha256 = "1flixjkxffnbxyjd8nd8rqpqavcxnvi4rra5yzpgjg76w78i0jpf";
fetchSubmodules = true;
};
nativeBuildInputs = [ gettext makeWrapper wrapGAppsHook ];
buildInputs = [ gnome2.gdk_pixbuf gnome3.glib gnome3.gtkmm ];
doBuild = false;
preInstall = ''
pushd plugins/
${toString (builtins.map (key: ''
cp -pr "${plugins."${key}"}" "${key}"
'') (builtins.attrNames plugins))}
popd
'';
installPhase = let
python = python3.withPackages (p: with p; [
pygobject3
pystache
pyyaml
]);
runtimeDeps = lib.makeBinPath [ python sassc ];
in ''
make DESTDIR="$out" APPDIR="$out/opt" PREFIX="/usr" install
# $APPDIR gets placed relative to $DESTDIR, but is also assumed to be an
# absolute directory.
mv "$out/$out/opt" "$out/opt"
rm -r "$out/nix"
# Fixup phase is disabled, do fixups here
pushd "$out/usr/bin"
patchShebangs *
for f in *; do
wrapProgram "$(realpath "$f")" \
--prefix PATH : "${runtimeDeps}" \
"''${gappsWrapperArgs[@]}"
done
popd
'';
# Directory is too large so this is just very slow
dontFixup = true;
meta = with stdenv.lib; {
description = "Generate different color variations of different themes";
homepage = "https://github.com/themix-project/oomox";
license = licenses.gpl3;
platforms = with platforms; platforms.unix;
maintainers = with maintainers; [ jD91mZM2 ];
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment