Skip to content

Instantly share code, notes, and snippets.

@dckc
Last active November 18, 2017 19:56
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 dckc/065803f567f1aaf10d5fce8fe902289b to your computer and use it in GitHub Desktop.
Save dckc/065803f567f1aaf10d5fce8fe902289b to your computer and use it in GitHub Desktop.
$ nix-env -i python
error: syntax error, unexpected $undefined, expecting IND_STR or DOLLAR_CURLY or IND_STRING_CLOSE, at /nix/store/r3lxhi5xz2mqshis956skc3n94483lii-nixpkgs-18.03pre120540.b8f7027360/nixpkgs/pkgs/applications/misc/hubstaff/default.nix:30:77
{ stdenv, fetchurl, unzip, makeWrapper, libX11, zlib, libSM, libICE, libXext
, freetype, libXrender, fontconfig, libXft, libXinerama, libnotify, glib
, gtk3, libappindicator-gtk3, curl }:
let
version = "1.2.14-36df5e3";
rpath = stdenv.lib.makeLibraryPath
[ libX11 zlib libSM libICE libXext freetype libXrender fontconfig libXft
libXinerama stdenv.cc.cc.lib libnotify glib gtk3 libappindicator-gtk3
curl ];
in
stdenv.mkDerivation {
name = "hubstaff-${version}";
src = fetchurl {
url = "https://hubstaff-production.s3.amazonaws.com/downloads/HubstaffClient/Builds/Release/${version}/Hubstaff-${version}.sh";
sha256 = "0yzhxk9zppj94llnf8naa6ca61f7c8jaj6b1m25zffnnz37m1sdb";
};
nativeBuildInputs = [ unzip makeWrapper ];
unpackCmd = ''
# MojoSetups have a ZIP file at the end. ZIP’s magic string is
# most often PK\x03\x04. This *should* work for future updates,
# but feel free to come up with something more reasonable.
dataZipOffset=$(grep --max-count=1 --byte-offset --only-matching --text $'PK\x03\x04' $curSrc | cut -d: -f1)
dd bs=$dataZipOffset skip=1 if=$curSrc of=data.zip 2>/dev/null
unzip -q data.zip "data/*"
rm data.zip
'';
dontBuild = true;
installPhase = ''
# TODO: handle 32-bit arch?
rm -r x86
opt=$out/opt/hubstaff
mkdir -p $out/bin $opt
cp -r . $opt/
prog=$opt/x86_64/HubstaffClient.bin.x86_64
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) $prog
wrapProgram $prog --prefix LD_LIBRARY_PATH : ${rpath}
ln -s $prog $out/bin/HubstaffClient
# Why is this needed? SEGV otherwise.
ln -s $opt/data/resources $opt/x86_64/resources
'';
meta = with stdenv.lib; {
description = "Time tracking software";
homepage = https://hubstaff.com/;
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = [ maintainers.michalrus ];
};
}
$ nix-env -iA nixpkgs.python
installing ‘python-2.7.14’
these paths will be fetched (13.89 MiB download, 72.77 MiB unpacked):
/nix/store/0abay33zgwqgchdzzq6h88ac4963smwf-coreutils-8.28
/nix/store/4ada72n7785wwazv42fhsnxjvilaa3aj-bash-4.4-p12
/nix/store/5fcpyi3vlxbgllb4dnxrqydyfy2f7s8v-gdbm-1.13
/nix/store/cqjq489nydhz27rjlrhcxx9bizwxr56j-attr-2.4.47
/nix/store/f6pmgza1hha574hm76p98mc2s6gsn3y8-python-2.7.14
/nix/store/gn56m9xpwk33xxrp8xrj2jr6d57jspic-ncurses-6.0-20170902
/nix/store/mlmwnxqd5p75lnwdmnw6i5vrh4fhfh2p-openssl-1.0.2m
/nix/store/ni3s4gas1c95aqkkr67pla6k66chkmb8-gcc-6.4.0-lib
/nix/store/qz2lprii3jxy0wybggj4h3304ij7m56p-zlib-1.2.11
/nix/store/szf0cpzndm3ic2vh344sr024r19jdxx1-acl-2.2.52
/nix/store/vbcyvh7rlbmpp85pssmcx4r8nn883dqa-bzip2-1.0.6.0.1
/nix/store/xzn1wijp8kk9r6nhcjrhlamdz6i9caar-db-5.3.28
/nix/store/z90s4radpf90mdmmaw9ld33rs371rdgf-sqlite-3.21.0
/nix/store/zmjhihhfb9kxmb55zr3qw949mljfy2l1-readline-6.3p08
fetching path ‘/nix/store/4ada72n7785wwazv42fhsnxjvilaa3aj-bash-4.4-p12’...
*** Downloading ‘https://cache.nixos.org/nar/0n0x68ns38zapv54hwx76r71hpw582ddhm95v9jh63jx246z13g7.nar.xz’ to ‘/nix/store/4ada72n7785wwazv42fhsnxjvilaa3aj-bash-4.4-p12’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 354k 100 354k 0 0 1289k 0 --:--:-- --:--:-- --:--:-- 1295k
fetching path ‘/nix/store/cqjq489nydhz27rjlrhcxx9bizwxr56j-attr-2.4.47’...
*** Downloading ‘https://cache.nixos.org/nar/10rw3zm29k7nk2ki1qm1j8cd1d614a1ywxrdvrdijhyc2mg6kb2m.nar.xz’ to ‘/nix/store/cqjq489nydhz27rjlrhcxx9bizwxr56j-attr-2.4.47’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 15564 100 15564 0 0 83308 0 --:--:-- --:--:-- --:--:-- 84129
fetching path ‘/nix/store/vbcyvh7rlbmpp85pssmcx4r8nn883dqa-bzip2-1.0.6.0.1’...
*** Downloading ‘https://cache.nixos.org/nar/0bq7mny4jp4ywhyv35qp68gh62s82fj5kz3d8p21gs2pmbw2bvyv.nar.xz’ to ‘/nix/store/vbcyvh7rlbmpp85pssmcx4r8nn883dqa-bzip2-1.0.6.0.1’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 27468 100 27468 0 0 142k 0 --:--:-- --:--:-- --:--:-- 143k
fetching path ‘/nix/store/szf0cpzndm3ic2vh344sr024r19jdxx1-acl-2.2.52’...
*** Downloading ‘https://cache.nixos.org/nar/156lnycqlfkmcdjy9mkbyhv74ja7yc6qmfn71mdq50w4j5pcri5x.nar.xz’ to ‘/nix/store/szf0cpzndm3ic2vh344sr024r19jdxx1-acl-2.2.52’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 22400 100 22400 0 0 113k 0 --:--:-- --:--:-- --:--:-- 114k
fetching path ‘/nix/store/ni3s4gas1c95aqkkr67pla6k66chkmb8-gcc-6.4.0-lib’...
*** Downloading ‘https://cache.nixos.org/nar/0qlrnx9msqm2mfwf47klkilsg8hbflryr9s3s2ikrpyv52rzjh1k.nar.xz’ to ‘/nix/store/ni3s4gas1c95aqkkr67pla6k66chkmb8-gcc-6.4.0-lib’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1136k 100 1136k 0 0 2899k 0 --:--:-- --:--:-- --:--:-- 2899k
fetching path ‘/nix/store/0abay33zgwqgchdzzq6h88ac4963smwf-coreutils-8.28’...
*** Downloading ‘https://cache.nixos.org/nar/1dmqpvb43g1acq1ynndd45xmm4m3y1l1xiybqhg20r674dpkfx06.nar.xz’ to ‘/nix/store/0abay33zgwqgchdzzq6h88ac4963smwf-coreutils-8.28’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1940k 100 1940k 0 0 4526k 0 --:--:-- --:--:-- --:--:-- 4543k
fetching path ‘/nix/store/xzn1wijp8kk9r6nhcjrhlamdz6i9caar-db-5.3.28’...
*** Downloading ‘https://cache.nixos.org/nar/18726mrkbwvi0vvgq5rkbci61kp4h71ski0f66dvyay2bnq817gj.nar.xz’ to ‘/nix/store/xzn1wijp8kk9r6nhcjrhlamdz6i9caar-db-5.3.28’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 885k 100 885k 0 0 2579k 0 --:--:-- --:--:-- --:--:-- 2590k
fetching path ‘/nix/store/5fcpyi3vlxbgllb4dnxrqydyfy2f7s8v-gdbm-1.13’...
*** Downloading ‘https://cache.nixos.org/nar/17j68zq16hx10ay9mdz0d96lg858f30minll1v2rm3sa6mp2q4r9.nar.xz’ to ‘/nix/store/5fcpyi3vlxbgllb4dnxrqydyfy2f7s8v-gdbm-1.13’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 146k 100 146k 0 0 608k 0 --:--:-- --:--:-- --:--:-- 611k
fetching path ‘/nix/store/gn56m9xpwk33xxrp8xrj2jr6d57jspic-ncurses-6.0-20170902’...
*** Downloading ‘https://cache.nixos.org/nar/0wf1zjnnicx635axkgc0l1rnmr3fqxgsf7dkcv07xdwz376lfjak.nar.xz’ to ‘/nix/store/gn56m9xpwk33xxrp8xrj2jr6d57jspic-ncurses-6.0-20170902’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 427k 100 427k 0 0 1280k 0 --:--:-- --:--:-- --:--:-- 1280k
fetching path ‘/nix/store/mlmwnxqd5p75lnwdmnw6i5vrh4fhfh2p-openssl-1.0.2m’...
*** Downloading ‘https://cache.nixos.org/nar/11316l9myjymi7lv7z77pzjshzwapa84awaq8khbgcc3138ci75b.nar.xz’ to ‘/nix/store/mlmwnxqd5p75lnwdmnw6i5vrh4fhfh2p-openssl-1.0.2m’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1045k 100 1045k 0 0 3527k 0 --:--:-- --:--:-- --:--:-- 3544k
fetching path ‘/nix/store/zmjhihhfb9kxmb55zr3qw949mljfy2l1-readline-6.3p08’...
*** Downloading ‘https://cache.nixos.org/nar/135zni39sapq5ncgs72cbjb7p9iir5d7zwijbiw7d6yjcfj3bdzh.nar.xz’ to ‘/nix/store/zmjhihhfb9kxmb55zr3qw949mljfy2l1-readline-6.3p08’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 108k 100 108k 0 0 272k 0 --:--:-- --:--:-- --:--:-- 272k
fetching path ‘/nix/store/z90s4radpf90mdmmaw9ld33rs371rdgf-sqlite-3.21.0’...
*** Downloading ‘https://cache.nixos.org/nar/08msw58170vrrnfppr2800n4sbzp5s7lzdp83s9i794wf7q7bi78.nar.xz’ to ‘/nix/store/z90s4radpf90mdmmaw9ld33rs371rdgf-sqlite-3.21.0’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 481k 100 481k 0 0 1846k 0 --:--:-- --:--:-- --:--:-- 1858k
fetching path ‘/nix/store/qz2lprii3jxy0wybggj4h3304ij7m56p-zlib-1.2.11’...
*** Downloading ‘https://cache.nixos.org/nar/10hffk3ggan9a8b3d3k9nljy94bgjfw334pzc5xvx4n4xw3jisbb.nar.xz’ to ‘/nix/store/qz2lprii3jxy0wybggj4h3304ij7m56p-zlib-1.2.11’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 46680 100 46680 0 0 242k 0 --:--:-- --:--:-- --:--:-- 245k
fetching path ‘/nix/store/f6pmgza1hha574hm76p98mc2s6gsn3y8-python-2.7.14’...
*** Downloading ‘https://cache.nixos.org/nar/158s1vsm56x0h2fj8q2c9ibi5qfj8n5vcw9lc7hxlnhximfc2drn.nar.xz’ to ‘/nix/store/f6pmgza1hha574hm76p98mc2s6gsn3y8-python-2.7.14’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7587k 100 7587k 0 0 7674k 0 --:--:-- --:--:-- --:--:-- 7679k
building path(s) ‘/nix/store/afrmk2nr3nym7ly2lyyv1l3hccdhzdfp-user-environment’
created 1283 symlinks in user environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment