git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #74728 from cdepillabout/update-stretchly

stretchly: 0.19.1 -> 0.21.0

commit8b1772c2f40291b295b5bb7d8bb763cc1810b37f authorDennis Gosnell <cdep.illabout@gmail.com> dateMon 2 Dec 2019, 23:19 (7 years ago) parent8d026388a2aefe
1 file changed+94−46
pkgs/applications/misc/stretchly/default.nix+94−46
pkgs/applications/misc/stretchly/default.nix+94−46
@@ -1,8 +1,12 @@
11{ GConf
22, alsaLib
33, at-spi2-atk
4+, at-spi2-core
45, atk
6+, buildFHSUserEnv
57, cairo
8+, common-updater-scripts
9+, coreutils
610, cups
711, dbus
812, expat
@@ -29,15 +33,19 @@
2933, libnotify
3034, libpciaccess
3135, libpng12
36+, libuuid
3237, libxcb
3338, nspr
3439, nss
3540, pango
3641, pciutils
3742, pulseaudio
43+, runtimeShell
3844, stdenv
3945, udev
4046, wrapGAppsHook
47+, writeScript
48+, file
4149}:
4250
4351let
@@ -45,6 +53,7 @@ let
4553 GConf
4654 alsaLib
4755 at-spi2-atk
56+ at-spi2-core
4857 atk
4958 cairo
5059 cups
@@ -71,6 +80,7 @@ let
7180 libnotify
7281 libpciaccess
7382 libpng12
83+ libuuid
7484 libxcb
7585 nspr
7686 nss
@@ -82,58 +92,96 @@ let
8292 ];
8393
8494 libPath = lib.makeLibraryPath libs;
95+
96+ stretchly =
97+ stdenv.mkDerivation rec {
98+ pname = "stretchly";
99+ version = "0.21.0";
100+
101+ src = fetchurl {
102+ url = "https://github.com/hovancik/stretchly/releases/download/v${version}/stretchly-${version}.tar.xz";
103+ sha256 = "1gyyr22xq8s4miiacs8wqhp7lxnwvkvlwhngnq8671l62s6iyjzl";
104+ };
105+
106+ nativeBuildInputs = [
107+ wrapGAppsHook
108+ coreutils
109+ ];
110+
111+ buildInputs = libs;
112+
113+ dontPatchELF = true;
114+ dontBuild = true;
115+ dontConfigure = true;
116+
117+ installPhase = ''
118+ mkdir -p $out/bin $out/lib/stretchly
119+ cp -r ./* $out/lib/stretchly/
120+ ln -s $out/lib/stretchly/stretchly $out/bin/
121+ '';
122+
123+ preFixup = ''
124+ patchelf --set-rpath "${libPath}" $out/lib/stretchly/libffmpeg.so
125+ patchelf --set-rpath "${libPath}" $out/lib/stretchly/libEGL.so
126+ patchelf --set-rpath "${libPath}" $out/lib/stretchly/libGLESv2.so
127+ patchelf --set-rpath "${libPath}" $out/lib/stretchly/swiftshader/libEGL.so
128+ patchelf --set-rpath "${libPath}" $out/lib/stretchly/swiftshader/libGLESv2.so
129+
130+ patchelf \
131+ --set-rpath "$out/lib/stretchly:${libPath}" \
132+ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
133+ $out/lib/stretchly/stretchly
134+
135+ patchelf \
136+ --set-rpath "$out/lib/stretchly:${libPath}" \
137+ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
138+ $out/lib/stretchly/chrome-sandbox
139+ '';
140+
141+ meta = with stdenv.lib; {
142+ description = "A break time reminder app";
143+ longDescription = ''
144+ stretchly is a cross-platform electron app that reminds you to take
145+ breaks when working on your computer. By default, it runs in your tray
146+ and displays a reminder window containing an idea for a microbreak for 20
147+ seconds every 10 minutes. Every 30 minutes, it displays a window
148+ containing an idea for a longer 5 minute break.
149+ '';
150+ homepage = https://hovancik.net/stretchly;
151+ downloadPage = https://hovancik.net/stretchly/downloads/;
152+ license = licenses.bsd2;
153+ maintainers = with maintainers; [ cdepillabout ];
154+ platforms = platforms.linux;
155+ };
156+ };
157+
85158in
86159
87−stdenv.mkDerivation rec {
88− pname = "stretchly";
89− version = "0.19.1";
160+buildFHSUserEnv {
161+ inherit (stretchly) meta;
90162
91− src = fetchurl {
92− url = "https://github.com/hovancik/stretchly/releases/download/v${version}/stretchly-${version}.tar.xz";
93− sha256 = "1q2wxfqs8qv9b1rfh5lhmyp3rrgdl05m6ihsgkxlgp0yzi07afz8";
94− };
163+ name = "stretchly";
95164
96− nativeBuildInputs = [
97− wrapGAppsHook
165+ targetPkgs = pkgs: [
166+ stretchly
98167 ];
99168
100− buildInputs = libs;
101−
102− dontPatchELF = true;
103− dontBuild = true;
104− dontConfigure = true;
105−
106− installPhase = ''
107− mkdir -p $out/bin $out/lib/stretchly
108− cp -r ./* $out/lib/stretchly/
109− ln -s $out/lib/stretchly/libffmpeg.so $out/lib/
110− ln -s $out/lib/stretchly/libnode.so $out/lib/
111− ln -s $out/lib/stretchly/stretchly $out/bin/
112− '';
113−
114− preFixup = ''
115− patchelf --set-rpath "${libPath}" $out/lib/stretchly/libffmpeg.so
116− patchelf --set-rpath "${libPath}" $out/lib/stretchly/libnode.so
117−
118− patchelf \
119− --set-rpath "$out/lib/stretchly:${libPath}" \
120− --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
121− $out/lib/stretchly/stretchly
122− '';
123−
124− meta = with stdenv.lib; {
125− description = "A break time reminder app";
126− longDescription = ''
127− stretchly is a cross-platform electron app that reminds you to take
128− breaks when working on your computer. By default, it runs in your tray
129− and displays a reminder window containing an idea for a microbreak for 20
130− seconds every 10 minutes. Every 30 minutes, it displays a window
131− containing an idea for a longer 5 minute break.
169+ runScript = "stretchly";
170+
171+ passthru = {
172+ updateScript = writeScript "update-stretchly" ''
173+ #!${runtimeShell}
174+
175+ set -eu -o pipefail
176+
177+ # get the latest release version
178+ latest_version=$(curl -s https://api.github.com/repos/hovancik/stretchly/releases/latest | jq --raw-output .tag_name | sed -e 's/^v//')
179+
180+ echo "updating to $latest_version..."
181+
182+ ${common-updater-scripts}/bin/update-source-version stretchly.passthru.stretchlyWrapped "$latest_version"
132183 '';
133− homepage = https://hovancik.net/stretchly;
134− downloadPage = https://hovancik.net/stretchly/downloads/;
135− license = licenses.bsd2;
136− maintainers = with maintainers; [ cdepillabout ];
137− platforms = platforms.linux;
184+
185+ stretchlyWrapped = stretchly;
138186 };
139187}