2022-03-06 00:34:46 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, makeWrapper
|
|
|
|
, go
|
|
|
|
, gcc
|
|
|
|
, gtk3
|
|
|
|
, webkitgtk
|
|
|
|
, nodejs
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "wails";
|
2023-12-10 00:01:19 +00:00
|
|
|
version = "2.7.1";
|
2022-03-06 00:34:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wailsapp";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-12-10 00:01:19 +00:00
|
|
|
hash = "sha256-KC5BkIaDLWT1soHr1FpfZWnEzyZTMUPaGMTap7P1W98=";
|
2022-03-06 00:34:46 +00:00
|
|
|
} + "/v2";
|
|
|
|
|
2023-12-10 00:01:19 +00:00
|
|
|
vendorHash = "sha256-EoWsDo39tS4KbcOVgrd1esSzEseC2+ZfMj4+KvymwF8=";
|
2022-03-06 00:34:46 +00:00
|
|
|
|
|
|
|
proxyVendor = true;
|
|
|
|
|
|
|
|
subPackages = [ "cmd/wails" ];
|
|
|
|
|
|
|
|
# These packages are needed to build wails
|
|
|
|
# and will also need to be used when building a wails app.
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
# Wails apps are built with Go, so we need to be able to
|
|
|
|
# add it in propagatedBuildInputs.
|
|
|
|
allowGoReference = true;
|
|
|
|
|
|
|
|
# Following packages are required when wails used as a builder.
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
go
|
|
|
|
gcc
|
|
|
|
gtk3
|
|
|
|
webkitgtk
|
|
|
|
nodejs
|
|
|
|
];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
];
|
|
|
|
|
|
|
|
# As Wails calls a compiler, certain apps and libraries need to be made available.
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/wails \
|
2022-08-08 20:07:30 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ pkg-config go gcc nodejs ]} \
|
2022-03-06 00:34:46 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gtk3 webkitgtk ]} \
|
|
|
|
--set PKG_CONFIG_PATH "$PKG_CONFIG_PATH" \
|
|
|
|
--set CGO_LDFLAGS "-L${lib.makeLibraryPath [ zlib ]}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Build applications using Go + HTML + CSS + JS";
|
|
|
|
homepage = "https://wails.io";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ianmjones ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|