hover: 0.47.0 -> 0.47.2

+7 -97
-78
pkgs/by-name/ho/hover/fix-assets-path.patch
··· 1 - diff --git a/internal/fileutils/assets.go b/internal/fileutils/assets.go 2 - index 83eacd9..0b80e51 100644 3 - --- a/internal/fileutils/assets.go 4 - +++ b/internal/fileutils/assets.go 5 - @@ -1,28 +1,7 @@ 6 - //go:generate rice embed 7 - package fileutils 8 - 9 - -import ( 10 - - "os" 11 - - "sync" 12 - - 13 - - rice "github.com/GeertJohan/go.rice" 14 - - "github.com/go-flutter-desktop/hover/internal/log" 15 - -) 16 - - 17 - -var ( 18 - - assetsBox *rice.Box 19 - - assetsBoxOnce sync.Once 20 - -) 21 - - 22 - // AssetsBox hover's assets box 23 - -func AssetsBox() *rice.Box { 24 - - assetsBoxOnce.Do(func() { 25 - - var err error 26 - - assetsBox, err = rice.FindBox("../../assets") 27 - - if err != nil { 28 - - log.Errorf("Failed to find hover assets: %v", err) 29 - - os.Exit(1) 30 - - } 31 - - }) 32 - - return assetsBox 33 - +func AssetsBox() string { 34 - + return "@assetsFolder@" 35 - } 36 - diff --git a/internal/fileutils/file.go b/internal/fileutils/file.go 37 - index cb75563..3822e80 100644 38 - --- a/internal/fileutils/file.go 39 - +++ b/internal/fileutils/file.go 40 - @@ -11,8 +11,6 @@ import ( 41 - "strings" 42 - "text/template" 43 - 44 - - rice "github.com/GeertJohan/go.rice" 45 - - 46 - "github.com/go-flutter-desktop/hover/internal/log" 47 - ) 48 - 49 - @@ -215,24 +213,24 @@ func ExecuteTemplateFromFile(boxed, to string, templateData interface{}) { 50 - } 51 - 52 - // ExecuteTemplateFromAssetsBox create file from a template asset 53 - -func ExecuteTemplateFromAssetsBox(boxed, to string, assetsBox *rice.Box, templateData interface{}) { 54 - - templateString, err := assetsBox.String(boxed) 55 - +func ExecuteTemplateFromAssetsBox(boxed, to string, assetsBox string, templateData interface{}) { 56 - + templateString, err := ioutil.ReadFile(assetsBox + "/" + boxed) 57 - if err != nil { 58 - log.Errorf("Failed to find template file: %v\n", err) 59 - os.Exit(1) 60 - } 61 - - executeTemplateFromString(templateString, to, templateData) 62 - + executeTemplateFromString(string(templateString), to, templateData) 63 - } 64 - 65 - // CopyAsset copies a file from asset 66 - -func CopyAsset(boxed, to string, assetsBox *rice.Box) { 67 - +func CopyAsset(boxed string, to string, assetsBox string) { 68 - file, err := os.Create(to) 69 - if err != nil { 70 - log.Errorf("Failed to create %s: %v", to, err) 71 - os.Exit(1) 72 - } 73 - defer file.Close() 74 - - boxedFile, err := assetsBox.Open(boxed) 75 - + boxedFile, err := os.OpenFile(assetsBox + "/" + boxed, os.O_RDONLY, 0666) 76 - if err != nil { 77 - log.Errorf("Failed to find boxed file %s: %v", boxed, err) 78 - os.Exit(1)
···
+7 -19
pkgs/by-name/ho/hover/package.nix
··· 18 19 let 20 pname = "hover"; 21 - version = "0.47.0"; 22 23 libs = with xorg; [ 24 libX11.dev ··· 36 hover = buildGoModule { 37 inherit pname version; 38 39 - meta = with lib; { 40 description = "Build tool to run Flutter applications on desktop"; 41 homepage = "https://github.com/go-flutter-desktop/hover"; 42 - license = licenses.bsd3; 43 - platforms = platforms.linux; 44 - maintainers = with maintainers; [ ericdallo ]; 45 }; 46 47 subPackages = [ "." ]; 48 49 - vendorHash = "sha256-GDoX5d2aDfaAx9JsKuS4r8137t3swT6rgcCghmaThSM="; 50 51 src = fetchFromGitHub { 52 tag = "v${version}"; 53 owner = "go-flutter-desktop"; 54 repo = "hover"; 55 - sha256 = "sha256-ch59Wx4g72u7x99807ppURI4I+5aJ/W8Zr35q8X68v4="; 56 }; 57 58 nativeBuildInputs = [ ··· 64 65 checkRun = false; 66 67 - patches = [ 68 - ./fix-assets-path.patch 69 - ]; 70 - 71 - postPatch = '' 72 - sed -i 's|@assetsFolder@|'"''${out}/share/assets"'|g' internal/fileutils/assets.go 73 - ''; 74 - 75 postInstall = '' 76 - mkdir -p $out/share 77 - cp -r assets $out/share/assets 78 - chmod -R a+rx $out/share/assets 79 - 80 wrapProgram "$out/bin/hover" \ 81 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath libs} 82 '';
··· 18 19 let 20 pname = "hover"; 21 + version = "0.47.2"; 22 23 libs = with xorg; [ 24 libX11.dev ··· 36 hover = buildGoModule { 37 inherit pname version; 38 39 + meta = { 40 description = "Build tool to run Flutter applications on desktop"; 41 homepage = "https://github.com/go-flutter-desktop/hover"; 42 + license = [ lib.licenses.bsd3 ]; 43 + platforms = lib.platforms.linux; 44 + maintainers = [ lib.maintainers.ericdallo ]; 45 }; 46 47 subPackages = [ "." ]; 48 49 + vendorHash = "sha256-LDVF1vt1kTm7G/zqWHcjtGK+BsydgmJUET61+sILiE0="; 50 51 src = fetchFromGitHub { 52 tag = "v${version}"; 53 owner = "go-flutter-desktop"; 54 repo = "hover"; 55 + sha256 = "sha256-xS4qfsGZAt560dxHpwEnAWdJCd5vuTdX+7fpUGrSqhw="; 56 }; 57 58 nativeBuildInputs = [ ··· 64 65 checkRun = false; 66 67 postInstall = '' 68 wrapProgram "$out/bin/hover" \ 69 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath libs} 70 '';