This commit is contained in:
Brian Picciano 2024-06-16 23:25:23 +02:00
parent c645a8c767
commit 6fd417b925
3 changed files with 79 additions and 7 deletions

View File

@ -157,13 +157,14 @@ in rec {
unset SOURCE_DATE_EPOCH unset SOURCE_DATE_EPOCH
appimagetool ./isle.AppDir appimagetool ./isle.AppDir
mv Isle-* "$out"
mkdir -p "$out"/bin
chmod +w "$out" -R
mv Isle-* "$out"/bin/isle
''; '';
}; };
archPkg = ((import ./dist/linux/arch.nix) {
inherit pkgs buildSystem releaseName appImage;
});
tests = pkgs.writeScript "isle-tests" '' tests = pkgs.writeScript "isle-tests" ''
export PATH=${pkgs.lib.makeBinPath [ export PATH=${pkgs.lib.makeBinPath [
appImage appImage

65
dist/linux/arch.nix vendored Normal file
View File

@ -0,0 +1,65 @@
{
pkgs,
buildSystem,
releaseName,
appImage,
}: let
cpuArch = (pkgs.lib.systems.parse.mkSystemFromString buildSystem).cpu.name;
pkgbuild = pkgs.writeText "isle-arch-PKGBUILD-${releaseName}-${cpuArch}" ''
pkgname=isle
pkgver=${releaseName}
pkgrel=0
pkgdesc="The Isle project provides the foundation for an autonomous community cloud infrastructure."
arch=('${cpuArch}')
url="https://code.betamike.com/micropelago/isle"
license=('AGPLv3')
source=("src.tar.zst")
md5sums=('SKIP')
package() {
cp -r etc "$pkgdir"/etc
cp -r usr "$pkgdir"/usr
}
'';
in
pkgs.stdenv.mkDerivation {
name = "isle-arch-pkg-${releaseName}-${cpuArch}";
nativeBuildInputs = [
pkgs.zstd
pkgs.pacman
pkgs.fakeroot
pkgs.libarchive
];
inherit pkgbuild;
src = appImage;
appDir = ../../AppDir;
dontUnpack = true;
buildPhase = ''
mkdir -p root/usr/bin/
cp "$src" root/usr/bin/isle
mkdir -p root/etc/isle/
cp "$appDir"/etc/daemon.yml root/etc/isle/daemon.yml
cp $pkgbuild PKGBUILD
tar -cf src.tar.zst --zstd --mode=a+rX,u+w -C root .
ls -lh ./root/usr/bin
PKGEXT=".pkg.tar.zst" makepkg --config ${pkgs.pacman}/etc/makepkg.conf
ls -lh ./
'';
installPhase = ''
mkdir -p $out
cp *.pkg.tar.zst $out/
'';
fixupPhase = "";
}

View File

@ -16,15 +16,21 @@
inherit buildSystem hostSystem releaseName revision; inherit buildSystem hostSystem releaseName revision;
}).appImage; }).appImage;
archPkg = ((import ./dist/linux/arch.nix) {
inherit pkgs buildSystem releaseName appImage;
});
in pkgs.stdenv.mkDerivation { in pkgs.stdenv.mkDerivation {
name = "isle-release-${hostSystem}"; name = "isle-release-${hostSystem}";
inherit releaseName appImage hostSystem; inherit releaseName hostSystem;
inherit appImage archPkg;
builder = builtins.toFile "build.sh" '' builder = builtins.toFile "build.sh" ''
source $stdenv/setup source $stdenv/setup
mkdir -p "$out"/ mkdir -p "$out"/
cp "$appImage"/bin/isle "$out"/isle-$releaseName-$hostSystem cp "$appImage" "$out"/isle-$releaseName-$hostSystem.AppImage
cp "$archPkg"/*.tar.zst "$out"/isle-$releaseName-$hostSystem.pkg.tar.zst
''; '';
}; };
@ -43,7 +49,7 @@ in
mkdir -p "$out" mkdir -p "$out"
for p in $releases; do for p in $releases; do
cp "$p"/isle-* "$out"/ cp "$p"/* "$out"/
done done
(cd "$out" && sha256sum * > sha256.txt) (cd "$out" && sha256sum * > sha256.txt)