2021-07-19 15:00:00 +03:00
|
|
|
{ stdenv, lib, fetchurl, fuse, zlib, squashfsTools, glib }:
|
2017-02-07 01:17:20 +03:00
|
|
|
|
|
|
|
# This is from some binaries.
|
|
|
|
|
|
|
|
# Ideally, this should be source based,
|
|
|
|
# but I can't get it to build from GitHub
|
|
|
|
|
2018-02-26 21:41:50 +03:00
|
|
|
let
|
|
|
|
inherit (stdenv.cc.bintools) dynamicLinker;
|
|
|
|
in stdenv.mkDerivation rec {
|
2017-02-07 01:17:20 +03:00
|
|
|
name = "appimagekit";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-02-26 21:39:57 +03:00
|
|
|
url = "https://github.com/AppImage/AppImageKit/releases/download/10/appimagetool-x86_64.AppImage";
|
|
|
|
sha256 = "03zbiblj8a1yk1xsb5snxi4ckwn3diyldg1jh5hdjjhsmpw652ig";
|
2017-02-07 01:17:20 +03:00
|
|
|
};
|
|
|
|
|
2017-05-01 02:51:20 +03:00
|
|
|
buildInputs = [
|
|
|
|
squashfsTools
|
|
|
|
];
|
|
|
|
|
2017-02-07 01:17:20 +03:00
|
|
|
sourceRoot = "squashfs-root";
|
|
|
|
|
|
|
|
unpackPhase = ''
|
2017-02-08 13:29:43 +03:00
|
|
|
cp $src appimagetool-x86_64.AppImage
|
|
|
|
chmod u+wx appimagetool-x86_64.AppImage
|
2018-02-26 21:41:50 +03:00
|
|
|
patchelf --set-interpreter ${dynamicLinker} \
|
2017-02-08 13:29:43 +03:00
|
|
|
--set-rpath ${fuse}/lib:${zlib}/lib \
|
|
|
|
appimagetool-x86_64.AppImage
|
|
|
|
./appimagetool-x86_64.AppImage --appimage-extract
|
2017-02-07 01:17:20 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r usr/* $out
|
2017-11-08 07:29:52 +03:00
|
|
|
|
2018-02-26 22:14:37 +03:00
|
|
|
for x in $out/bin/*; do
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter ${dynamicLinker} \
|
2021-07-19 15:00:00 +03:00
|
|
|
--set-rpath ${lib.makeLibraryPath [ zlib stdenv.glibc.out fuse glib ]} \
|
2018-02-26 22:14:37 +03:00
|
|
|
$x
|
|
|
|
done
|
2017-02-07 01:17:20 +03:00
|
|
|
'';
|
|
|
|
|
2017-11-08 07:29:52 +03:00
|
|
|
dontStrip = true;
|
2017-02-07 01:17:20 +03:00
|
|
|
dontPatchELF = true;
|
|
|
|
}
|