Created
November 14, 2019 09:02
-
-
Save sgraf812/8ad982bbb090fc6154638bf5b68120e5 to your computer and use it in GitHub Desktop.
insync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self: super: | |
{ | |
insync = super.insync.overrideAttrs (old: rec { | |
version = "3.0.23.40579"; | |
src = let dist = "stretch"; in | |
if self.stdenv.hostPlatform.system == "x86_64-linux" then | |
self.fetchurl { | |
url = "http://s.insynchq.com/builds/${old.pname}_${version}-${dist}_amd64.deb"; | |
# buster | |
#sha256 = "f348fad2241dae11fe4d0af61398e40b900eab5d56f0e2d0cc75fc970c6b49eb"; | |
# stretch | |
sha256 = "0y3ln3x6w4fiybky9b323w9cxbwym7wc5lli1fr0mh9vw5k96nhc"; | |
} | |
else | |
throw "${old.pname}-${version} is not supported on ${self.stdenv.hostPlatform.system}"; | |
buildInputs = with self; [ | |
glibc | |
zlib | |
libGL | |
glib | |
xorg.libxcb | |
libxkbcommon | |
qt5.qtvirtualkeyboard | |
nss | |
nspr | |
alsaLib | |
wayland | |
pango | |
python37 | |
]; | |
nativeBuildInputs = with self; [ | |
autoPatchelfHook | |
dpkg | |
makeWrapper | |
]; | |
unpackPhase = '' | |
mkdir -p $out | |
dpkg --extract $src . | |
# Debian's pango includes libthai, which we don't have a nix package for | |
rm usr/lib/insync/libpango* | |
# The Python 3.7 version from Buster needs glibc 3.28 at runtime. So we bundle our own. | |
# rm usr/lib/insync/libpython* | |
# ln -s ${self.python37}/lib/libpython3.7m.so.1.0 usr/lib/insync/libpython3.7m.so.1.0 | |
''; | |
postPatch = "true"; | |
installPhase = '' | |
cp -av usr/* $out | |
rm -rf $out/usr | |
rm $out/bin/insync | |
makeWrapper $out/lib/insync/insync $out/bin/insync --set LC_TIME C | |
# Otherwise it looks "suspicious" | |
chmod -R g-w $out | |
''; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment