@@ -99,6 +99,17 @@ pub struct DebConfig {
9999 pub files : HashMap < PathBuf , PathBuf > ,
100100}
101101
102+ fn de_minimum_system_version < ' de , D > ( deserializer : D ) -> Result < Option < String > , D :: Error >
103+ where
104+ D : Deserializer < ' de > ,
105+ {
106+ let version = Option :: < String > :: deserialize ( deserializer) ?;
107+ match version {
108+ Some ( v) if v. is_empty ( ) => Ok ( minimum_system_version ( ) ) ,
109+ e => Ok ( e) ,
110+ }
111+ }
112+
102113/// Configuration for the macOS bundles.
103114#[ skip_serializing_none]
104115#[ derive( Debug , PartialEq , Clone , Deserialize , Serialize ) ]
@@ -110,9 +121,15 @@ pub struct MacConfig {
110121 /// If a name is used, ".framework" must be omitted and it will look for standard install locations. You may also use a path to a specific framework.
111122 pub frameworks : Option < Vec < String > > ,
112123 /// A version string indicating the minimum macOS X version that the bundled application supports. Defaults to `10.13`.
124+ ///
113125 /// Setting it to `null` completely removes the `LSMinimumSystemVersion` field on the bundle's `Info.plist`
114126 /// and the `MACOSX_DEPLOYMENT_TARGET` environment variable.
115- #[ serde( default = "minimum_system_version" ) ]
127+ ///
128+ /// An empty string is considered an invalid value so the default value is used.
129+ #[ serde(
130+ deserialize_with = "de_minimum_system_version" ,
131+ default = "minimum_system_version"
132+ ) ]
116133 pub minimum_system_version : Option < String > ,
117134 /// Allows your application to communicate with the outside world.
118135 /// It should be a lowercase, without port and protocol domain name.
0 commit comments