isle/nix/appimagetool.nix

41 lines
1.1 KiB
Nix
Raw Permalink Normal View History

{ stdenv, fetchurl }:
let
2023-04-11 23:58:52 +00:00
version = "765";
cpuArch = stdenv.buildPlatform.parsed.cpu.name;
2023-04-11 23:58:52 +00:00
srcDir = ./go-appimage;
2023-04-11 23:58:52 +00:00
# https://github.com/probonopd/go-appimage
# The author of go-appimage has set up some crazy continuous integration build
# system with github, which is really cool, except that it doesn't preserve
# any older builds of the project. And it's pretty difficult to build it
2023-09-01 16:28:22 +00:00
# ourselves. So fuck it, just embed the build artifacts directly in this
# project.
2023-04-11 23:58:52 +00:00
src = {
"x86_64" = "${srcDir}/appimagetool-${version}-x86_64.AppImage";
"aarch64" = "${srcDir}/go-appimage/appimagetool-${version}-aarch64.AppImage";
"armv7l" = "${srcDir}/go-appimage/appimagetool-${version}-armhf.AppImage";
"i686" = "${srcDir}/go-appimage/appimagetool-${version}-i686.AppImage";
}."${cpuArch}";
in stdenv.mkDerivation rec {
pname = "go-appimage";
inherit version src;
sourceRoot = "squashfs-root";
unpackPhase = ''
cp $src appimagetool
chmod u+wx appimagetool
./appimagetool --appimage-extract
'';
installPhase = ''
mkdir -p $out
cp -r usr/* $out
'';
}