templates/fyne: use fyne command to build

This commit is contained in:
Aaron Bieber 2024-10-31 06:11:10 -06:00
parent 8cadcf0ece
commit c51b0a7d83
No known key found for this signature in database

View File

@ -21,7 +21,7 @@
pkgs = nixpkgsFor.${system}; pkgs = nixpkgsFor.${system};
in in
{ {
thing = pkgs.buildGoModule { thing = pkgs.buildGoModule rec {
pname = "thing"; pname = "thing";
version = "v0.0.0"; version = "v0.0.0";
src = ./.; src = ./.;
@ -31,6 +31,7 @@
nativeBuildInputs = with pkgs; [ pkg-config ]; nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ buildInputs = with pkgs; [
fyne
git git
glfw glfw
libGL libGL
@ -44,6 +45,17 @@
xorg.libXxf86vm xorg.libXxf86vm
xorg.xinput xorg.xinput
]; ];
buildPhase = ''
${fyne}/bin/fyne package
'';
installPhase = ''
mkdir -p $out
pkg="$PWD/${pname}.tar.xz"
cd $out
tar --strip-components=1 -xvf $pkg
'';
}; };
}); });
@ -60,6 +72,7 @@
echo "Go `${pkgs.go}/bin/go version`" echo "Go `${pkgs.go}/bin/go version`"
''; '';
buildInputs = with pkgs; [ buildInputs = with pkgs; [
fyne
git git
go_1_20 go_1_20
gopls gopls