From e361753cbb34d67482f1f9216eb2c1e564715c6a Mon Sep 17 00:00:00 2001 From: Scott Hamilton Date: Sat, 4 Jul 2020 14:29:03 +0200 Subject: [PATCH] Compton: Init at 0.1_beta2 --- pkgs/tools/X11/compton/default.nix | 44 +++++++++++++++ pkgs/tools/X11/compton/dont-build-doc.patch | 62 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 108 insertions(+) create mode 100644 pkgs/tools/X11/compton/default.nix create mode 100644 pkgs/tools/X11/compton/dont-build-doc.patch diff --git a/pkgs/tools/X11/compton/default.nix b/pkgs/tools/X11/compton/default.nix new file mode 100644 index 0000000000000..ea41aff09f88e --- /dev/null +++ b/pkgs/tools/X11/compton/default.nix @@ -0,0 +1,44 @@ +{ lib +, stdenv +, fetchFromGitHub +, gnumake +, dbus +, pkg-config +, libconfig +, pcre +, libdrm +, xorg +, libglvnd +, linuxHeaders +}: +stdenv.mkDerivation rec { + + pname = "Compton"; + version = "0.1_beta2"; + + src = fetchFromGitHub { + owner = "tryone144"; + repo = "compton"; + rev = "v${version}"; + sha256 = "0v65viilhnd2xgvmdpzc1srxszcg8kj1vhi5gy9292j48w0s2fx1"; + }; + + patches = [ ./dont-build-doc.patch ]; + + postPatch = '' + substituteInPlace Makefile \ + --replace "PREFIX ?= /usr" "PREFIX ?= $out" + rm -rf man + ''; + + nativeBuildInputs = [ gnumake pkg-config ]; + buildInputs = with xorg; map lib.getDev [ libX11 libXcomposite libXdamage libXrender libXext libXrandr libXinerama libconfig dbus libglvnd libdrm pcre ]; + + meta = with lib; { + description = "Compositor for X11"; + license = licenses.mit; + homepage = "https://github.com/tryone144/compton"; + maintainers = with maintainers; [ shamilton ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/tools/X11/compton/dont-build-doc.patch b/pkgs/tools/X11/compton/dont-build-doc.patch new file mode 100644 index 0000000000000..91df22ac7f331 --- /dev/null +++ b/pkgs/tools/X11/compton/dont-build-doc.patch @@ -0,0 +1,62 @@ +diff -ur a/Makefile b/Makefile +--- a/Makefile 2013-10-21 16:17:01.000000000 +0200 ++++ b/Makefile 2020-07-03 21:01:26.684818543 +0200 +@@ -5,7 +5,6 @@ + + PREFIX ?= /usr + BINDIR ?= $(PREFIX)/bin +-MANDIR ?= $(PREFIX)/share/man/man1 + APPDIR ?= $(PREFIX)/share/applications + + PACKAGES = x11 xcomposite xfixes xdamage xrender xext xrandr +@@ -102,8 +101,6 @@ + CFLAGS += -Wall + + BINS = compton bin/compton-trans +-MANPAGES = man/compton.1 man/compton-trans.1 +-MANPAGES_HTML = $(addsuffix .html,$(MANPAGES)) + + # === Recipes === + .DEFAULT_GOAL := compton +@@ -117,37 +114,19 @@ + compton: $(OBJS) + $(CC) $(CFG) $(CPPFLAGS) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS) + +-man/%.1: man/%.1.asciidoc +- a2x --format manpage $< +- +-man/%.1.html: man/%.1.asciidoc +- asciidoc $< +- +-docs: $(MANPAGES) $(MANPAGES_HTML) +- +-install: $(BINS) docs +- @install -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(MANDIR)" "$(DESTDIR)$(APPDIR)" ++install: $(BINS) ++ @install -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(APPDIR)" + @install -m755 $(BINS) "$(DESTDIR)$(BINDIR)"/ +- @install -m644 $(MANPAGES) "$(DESTDIR)$(MANDIR)"/ + @install -m644 compton.desktop "$(DESTDIR)$(APPDIR)"/ +-ifneq "$(DOCDIR)" "" +- @install -d "$(DESTDIR)$(DOCDIR)" +- @install -m644 README.md compton.sample.conf "$(DESTDIR)$(DOCDIR)"/ +- @install -m755 dbus-examples/cdbus-driver.sh "$(DESTDIR)$(DOCDIR)"/ +-endif + + uninstall: + @rm -f "$(DESTDIR)$(BINDIR)/compton" "$(DESTDIR)$(BINDIR)/compton-trans" +- @rm -f $(addprefix "$(DESTDIR)$(MANDIR)"/, compton.1 compton-trans.1) + @rm -f "$(DESTDIR)$(APPDIR)/compton.desktop" +-ifneq "$(DOCDIR)" "" +- @rm -f $(addprefix "$(DESTDIR)$(DOCDIR)"/, README.md compton.sample.conf cdbus-driver.sh) +-endif + + clean: +- @rm -f $(OBJS) compton $(MANPAGES) $(MANPAGES_HTML) .clang_complete ++ @rm -f $(OBJS) compton .clang_complete + + version: + @echo "$(COMPTON_VERSION)" + +-.PHONY: uninstall clean docs version ++.PHONY: uninstall clean version diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 078d5f6517dc3..dd04afb42d4f2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2770,6 +2770,8 @@ in compass = callPackage ../development/tools/compass { }; + compton = callPackage ../tools/X11/compton { }; + conda = callPackage ../tools/package-management/conda { }; convmv = callPackage ../tools/misc/convmv { };