2022-03-10 19:12:11 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, makeWrapper
|
|
|
|
, go
|
|
|
|
, nodejs
|
|
|
|
, zlib
|
2024-04-21 15:54:59 +00:00
|
|
|
# Linux specific dependencies
|
|
|
|
, gtk3
|
|
|
|
, webkitgtk
|
2022-03-10 19:12:11 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "wails";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "2.8.2";
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wailsapp";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-oJ/kxYphBTXxt7Da1x4GW/a78YV+m32iC/4N3MDjU/A=";
|
2022-03-10 19:12:11 +00:00
|
|
|
} + "/v2";
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
vendorHash = "sha256-15Vo4AKmd9qOF0ea1klTlrXJOUs+IHvsNT2rw4R7ZiU=";
|
2022-03-10 19:12:11 +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
|
2024-04-21 15:54:59 +00:00
|
|
|
stdenv.cc
|
|
|
|
nodejs
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2022-03-10 19:12:11 +00:00
|
|
|
gtk3
|
|
|
|
webkitgtk
|
|
|
|
];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
];
|
|
|
|
|
|
|
|
# As Wails calls a compiler, certain apps and libraries need to be made available.
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/wails \
|
2024-04-21 15:54:59 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ pkg-config go stdenv.cc nodejs ]} \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath (lib.optionals stdenv.isLinux [ gtk3 webkitgtk ])}" \
|
2022-03-10 19:12:11 +00:00
|
|
|
--set PKG_CONFIG_PATH "$PKG_CONFIG_PATH" \
|
|
|
|
--set CGO_LDFLAGS "-L${lib.makeLibraryPath [ zlib ]}"
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
meta = {
|
2022-03-10 19:12:11 +00:00
|
|
|
description = "Build applications using Go + HTML + CSS + JS";
|
|
|
|
homepage = "https://wails.io";
|
2024-04-21 15:54:59 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ ianmjones ];
|
|
|
|
mainProgram = "wails";
|
|
|
|
platforms = lib.platforms.unix;
|
2022-03-10 19:12:11 +00:00
|
|
|
};
|
|
|
|
}
|