diff options
author | Kirill Boltaev <aske@fmap.me> | 2019-07-15 21:11:55 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2019-07-15 22:49:32 +0300 |
commit | 979710b4a0e5f0060e9ded6c819c6d0f1a09fe5f (patch) | |
tree | 8e9c33752194b0d58054e002177c15155d890780 /pkgs/tools | |
parent | 98c24b7e5602c0e83129ce2dc5811be928ad1174 (diff) |
libstrangle: init at 2017-02-22
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/X11/libstrangle/default.nix | 29 | ||||
-rw-r--r-- | pkgs/tools/X11/libstrangle/nixos.patch | 29 |
2 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/tools/X11/libstrangle/default.nix b/pkgs/tools/X11/libstrangle/default.nix new file mode 100644 index 0000000000000..d24654ce3ad7a --- /dev/null +++ b/pkgs/tools/X11/libstrangle/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/tools/X11/libstrangle/nixos.patch b/pkgs/tools/X11/libstrangle/nixos.patch new file mode 100644 index 0000000000000..912bdded6daf8 --- /dev/null +++ b/pkgs/tools/X11/libstrangle/nixos.patch @@ -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 "$@" |