hover: 0.47.0 -> 0.47.2 (#414249)

This commit is contained in:
Peder Bergebakken Sundt
2025-06-14 22:45:52 +02:00
committed by GitHub
2 changed files with 9 additions and 99 deletions

View File

@@ -1,78 +0,0 @@
diff --git a/internal/fileutils/assets.go b/internal/fileutils/assets.go
index 83eacd9..0b80e51 100644
--- a/internal/fileutils/assets.go
+++ b/internal/fileutils/assets.go
@@ -1,28 +1,7 @@
//go:generate rice embed
package fileutils
-import (
- "os"
- "sync"
-
- rice "github.com/GeertJohan/go.rice"
- "github.com/go-flutter-desktop/hover/internal/log"
-)
-
-var (
- assetsBox *rice.Box
- assetsBoxOnce sync.Once
-)
-
// AssetsBox hover's assets box
-func AssetsBox() *rice.Box {
- assetsBoxOnce.Do(func() {
- var err error
- assetsBox, err = rice.FindBox("../../assets")
- if err != nil {
- log.Errorf("Failed to find hover assets: %v", err)
- os.Exit(1)
- }
- })
- return assetsBox
+func AssetsBox() string {
+ return "@assetsFolder@"
}
diff --git a/internal/fileutils/file.go b/internal/fileutils/file.go
index cb75563..3822e80 100644
--- a/internal/fileutils/file.go
+++ b/internal/fileutils/file.go
@@ -11,8 +11,6 @@ import (
"strings"
"text/template"
- rice "github.com/GeertJohan/go.rice"
-
"github.com/go-flutter-desktop/hover/internal/log"
)
@@ -215,24 +213,24 @@ func ExecuteTemplateFromFile(boxed, to string, templateData interface{}) {
}
// ExecuteTemplateFromAssetsBox create file from a template asset
-func ExecuteTemplateFromAssetsBox(boxed, to string, assetsBox *rice.Box, templateData interface{}) {
- templateString, err := assetsBox.String(boxed)
+func ExecuteTemplateFromAssetsBox(boxed, to string, assetsBox string, templateData interface{}) {
+ templateString, err := ioutil.ReadFile(assetsBox + "/" + boxed)
if err != nil {
log.Errorf("Failed to find template file: %v\n", err)
os.Exit(1)
}
- executeTemplateFromString(templateString, to, templateData)
+ executeTemplateFromString(string(templateString), to, templateData)
}
// CopyAsset copies a file from asset
-func CopyAsset(boxed, to string, assetsBox *rice.Box) {
+func CopyAsset(boxed string, to string, assetsBox string) {
file, err := os.Create(to)
if err != nil {
log.Errorf("Failed to create %s: %v", to, err)
os.Exit(1)
}
defer file.Close()
- boxedFile, err := assetsBox.Open(boxed)
+ boxedFile, err := os.OpenFile(assetsBox + "/" + boxed, os.O_RDONLY, 0666)
if err != nil {
log.Errorf("Failed to find boxed file %s: %v", boxed, err)
os.Exit(1)

View File

@@ -18,7 +18,7 @@
let
pname = "hover";
version = "0.47.0";
version = "0.47.2";
libs = with xorg; [
libX11.dev
@@ -36,23 +36,23 @@ let
hover = buildGoModule {
inherit pname version;
meta = with lib; {
meta = {
description = "Build tool to run Flutter applications on desktop";
homepage = "https://github.com/go-flutter-desktop/hover";
license = licenses.bsd3;
platforms = platforms.linux;
maintainers = with maintainers; [ ericdallo ];
license = [ lib.licenses.bsd3 ];
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.ericdallo ];
};
subPackages = [ "." ];
vendorHash = "sha256-GDoX5d2aDfaAx9JsKuS4r8137t3swT6rgcCghmaThSM=";
vendorHash = "sha256-LDVF1vt1kTm7G/zqWHcjtGK+BsydgmJUET61+sILiE0=";
src = fetchFromGitHub {
rev = "v${version}";
tag = "v${version}";
owner = "go-flutter-desktop";
repo = pname;
sha256 = "sha256-ch59Wx4g72u7x99807ppURI4I+5aJ/W8Zr35q8X68v4=";
repo = "hover";
sha256 = "sha256-xS4qfsGZAt560dxHpwEnAWdJCd5vuTdX+7fpUGrSqhw=";
};
nativeBuildInputs = [
@@ -64,19 +64,7 @@ let
checkRun = false;
patches = [
./fix-assets-path.patch
];
postPatch = ''
sed -i 's|@assetsFolder@|'"''${out}/share/assets"'|g' internal/fileutils/assets.go
'';
postInstall = ''
mkdir -p $out/share
cp -r assets $out/share/assets
chmod -R a+rx $out/share/assets
wrapProgram "$out/bin/hover" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath libs}
'';