File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -434,7 +434,7 @@ impl Builder {
434434 return false ;
435435 }
436436
437- self . do_work ( bin_path, & context. sbuild_pkg ) ;
437+ self . do_work ( bin_path, & context. sbuild_pkg , build_config . pkg_type . clone ( ) ) ;
438438
439439 let finalize = Finalize :: new (
440440 context. sbuild_pkg . clone ( ) ,
@@ -580,12 +580,23 @@ impl Builder {
580580 success
581581 }
582582
583- pub fn do_work < P : AsRef < Path > > ( & mut self , file_path : P , pkg_name : & str ) {
583+ pub fn do_work < P : AsRef < Path > > (
584+ & mut self ,
585+ file_path : P ,
586+ pkg_name : & str ,
587+ pkg_type : Option < String > ,
588+ ) {
584589 let magic_bytes = calc_magic_bytes ( & file_path, 12 ) ;
585590
586591 if magic_bytes[ 8 ..] == APPIMAGE_MAGIC_BYTES {
587- self . pkg_type = PackageType :: AppImage ;
588- let appimage = AppImage :: new ( None , & file_path, None ) . unwrap ( ) ;
592+ let filter = if pkg_type == Some ( "nixappimage" . into ( ) ) {
593+ self . pkg_type = PackageType :: NixAppImage ;
594+ Some ( pkg_name)
595+ } else {
596+ self . pkg_type = PackageType :: AppImage ;
597+ None
598+ } ;
599+ let appimage = AppImage :: new ( filter, & file_path, None ) . unwrap ( ) ;
589600 let squashfs = & appimage. squashfs ;
590601
591602 if !self . icon {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ pub enum PackageType {
1111 Dynamic ,
1212 AppImage ,
1313 FlatImage ,
14+ NixAppImage ,
1415 Unknown ,
1516}
1617
@@ -20,6 +21,7 @@ impl Display for PackageType {
2021 PackageType :: Static => write ! ( f, "static" ) ,
2122 PackageType :: Dynamic => write ! ( f, "dynamic" ) ,
2223 PackageType :: AppImage => write ! ( f, "appimage" ) ,
24+ PackageType :: NixAppImage => write ! ( f, "nixappimage" ) ,
2325 PackageType :: FlatImage => write ! ( f, "flatimage" ) ,
2426 PackageType :: Unknown => write ! ( f, "unknown" ) ,
2527 }
You can’t perform that action at this time.
0 commit comments