Skip to content

Commit

Permalink
macOS: Generate version metadata at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Nov 21, 2019
1 parent 720faa2 commit 0e6a1fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions data/Info.plist → data/Info.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.12-alpha</string>
<string>@VERSION@</string>
<key>CFBundleVersion</key>
<string>0.12-alpha</string>
<string>@VERSION@</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2019 Thomas Perl</string>
<key>NSPrincipalClass</key>
Expand Down
8 changes: 7 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ conf.set('HAVE_MPG123', have_mpg123)
configure_file(output : 'config.h',
configuration : conf)

meta = configuration_data()
meta.set('VERSION', meson.project_version())
info_plist = configure_file(output : 'Info.plist',
input : 'data/Info.plist.in',
configuration : meta)

if get_option('macos_app')
install_data('data/wavbreaker.icns', install_dir : 'Contents/Resources')
install_data('data/Info.plist', install_dir : 'Contents')
install_data(info_plist, install_dir : 'Contents')
else
install_data('data/net.sourceforge.wavbreaker.desktop', install_dir: get_option('datadir') + '/applications')
icon_dir = get_option('datadir') + '/icons/hicolor'
Expand Down

0 comments on commit 0e6a1fd

Please sign in to comment.