libstrangle: init at 2017-02-22

This commit is contained in:
Kirill Boltaev 2019-07-15 21:11:55 +03:00 committed by Nikolay Amiantov
parent 98c24b7e56
commit 979710b4a0
3 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,29 @@
{ stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "libstrangle";
version = "2017-02-22";
src = fetchFromGitHub {
owner = "milaq";
repo = pname;
rev = "6020f9e375ba747c75eb7996b7d5f0214ac3221e";
sha256 = "04ikacbjcq9phdc8q5y1qjjpa1sxmzfm0idln9ys95prg289zp4h";
};
makeFlags = [ "prefix=" "DESTDIR=$(out)" ];
patches = [ ./nixos.patch ];
postPatch = ''
substituteAllInPlace src/strangle.sh
'';
meta = with stdenv.lib; {
homepage = "https://github.com/milaq/libstrangle";
description = "Frame rate limiter for Linux/OpenGL";
license = licenses.gpl3;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ aske ];
};
}

View File

@ -0,0 +1,29 @@
diff --git a/makefile b/makefile
index eb13054..a3a1125 100644
--- a/makefile
+++ b/makefile
@@ -27,12 +27,10 @@ $(BUILDDIR)libstrangle32.so: $(BUILDDIR)
$(CC) $(CFLAGS) $(LDFLAGS) -m32 -o $(BUILDDIR)libstrangle32.so $(SOURCES)
install: all
- install -m 0644 -D -T $(BUILDDIR)libstrangle.conf $(DESTDIR)/etc/ld.so.conf.d/libstrangle.conf
install -m 0755 -D -T $(BUILDDIR)libstrangle32.so $(DESTDIR)$(LIB32_PATH)/libstrangle.so
install -m 0755 -D -T $(BUILDDIR)libstrangle64.so $(DESTDIR)$(LIB64_PATH)/libstrangle.so
install -m 0755 -D -T $(SOURCEDIR)strangle.sh $(DESTDIR)$(bindir)/strangle
install -m 0644 -D -T COPYING $(DESTDIR)$(DOC_PATH)/LICENSE
- ldconfig
clean:
rm -f $(BUILDDIR)libstrangle64.so
diff --git a/src/strangle.sh b/src/strangle.sh
index e280e86..b2dd42b 100755
--- a/src/strangle.sh
+++ b/src/strangle.sh
@@ -31,6 +31,5 @@ if [ "$#" -eq 0 ]; then
exit 1
fi
-# Execute the strangled program under a clean environment
# pass through the FPS and overriden LD_PRELOAD environment variables
-exec env FPS="${FPS}" LD_PRELOAD="${LD_PRELOAD}:libstrangle.so" "$@"
+FPS="${FPS}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@out@/lib/libstrangle/lib64:@out@/lib/libstrangle/lib32" LD_PRELOAD="${LD_PRELOAD}:libstrangle.so" exec "$@"

View File

@ -20263,6 +20263,10 @@ in
insync = callPackage ../applications/networking/insync { };
libstrangle = callPackage ../tools/X11/libstrangle {
stdenv = stdenv_32bit;
};
lightdm = libsForQt5.callPackage ../applications/display-managers/lightdm { };
lightdm_qt = lightdm.override { withQt5 = true; };