parent
17fb9bbd77
commit
5061fb5670
@ -1,17 +1,58 @@ |
||||
{ |
||||
# Modified from https://github.com/matthewbauer/nix-bundle/blob/e9fa7e8a118942adafa8592a28b301ee23d37c13/appimagetool.nix |
||||
{ stdenv, lib, fetchurl, fuse, zlib, file, glib, }: |
||||
|
||||
fetchFromGitHub, |
||||
callPackage, |
||||
# This is from some binaries. |
||||
|
||||
}: let |
||||
# Ideally, this should be source based, |
||||
# but I can't get it to build from GitHub |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "matthewbauer"; |
||||
repo = "nix-bundle"; |
||||
rev = "223f4ffc4179aa318c34dc873a08cb00090db829"; |
||||
sha256 = "0pqpx9vnjk9h24h9qlv4la76lh5ykljch6g487b26r1r2s9zg7kh"; |
||||
}; |
||||
let |
||||
|
||||
in |
||||
inherit (stdenv.cc.bintools) dynamicLinker; |
||||
|
||||
callPackage "${src}/appimagetool.nix" {} |
||||
version = "745"; |
||||
|
||||
cpuArch = stdenv.buildPlatform.parsed.cpu.arch; |
||||
|
||||
src = { |
||||
|
||||
"x86-64" = fetchurl { |
||||
url = "https://github.com/probonopd/go-appimage/releases/download/continuous/appimagetool-${version}-x86_64.AppImage"; |
||||
sha256 = "sha256-HQ7d9LQDaPm6sGZ5boWZdmGTNqiGN9NWHUWPiDhl2Xc="; |
||||
}; |
||||
|
||||
# TODO other archs |
||||
|
||||
}."${cpuArch}"; |
||||
|
||||
in stdenv.mkDerivation rec { |
||||
inherit version src; |
||||
|
||||
pname = "go-appimage"; |
||||
|
||||
sourceRoot = "squashfs-root"; |
||||
|
||||
unpackPhase = '' |
||||
cp $src appimagetool |
||||
chmod u+wx appimagetool |
||||
#patchelf --set-interpreter ${dynamicLinker} \ |
||||
# --set-rpath ${fuse}/lib:${zlib}/lib \ |
||||
# appimagetool |
||||
./appimagetool --appimage-extract |
||||
''; |
||||
|
||||
installPhase = '' |
||||
mkdir -p $out |
||||
|
||||
cp -r usr/* $out |
||||
for x in $out/bin/*; do |
||||
patchelf \ |
||||
--set-interpreter ${dynamicLinker} \ |
||||
--set-rpath ${lib.makeLibraryPath [ zlib stdenv.glibc.out fuse glib ]} \ |
||||
$x || true |
||||
done |
||||
''; |
||||
|
||||
dontStrip = true; |
||||
dontPatchELF = true; |
||||
} |
||||
|
Loading…
Reference in new issue