Compare commits
3 Commits
49ee551b9b
...
2869c656c1
Author | SHA1 | Date | |
---|---|---|---|
2869c656c1 | |||
ec713b633e | |||
88234f8283 |
@ -69,7 +69,7 @@ plus rsvg-convert from librsvg2, icotool from icoutils, and msitools ≥ 0.102.
|
|||||||
Beware that the build will take up about a gigabyte of disk space.
|
Beware that the build will take up about a gigabyte of disk space.
|
||||||
|
|
||||||
$ sh -e msys2-configure.sh builddir
|
$ sh -e msys2-configure.sh builddir
|
||||||
$ meson install -C builddir
|
$ meson compile package -C builddir
|
||||||
|
|
||||||
If everything succeeds, you will find a portable build of the application
|
If everything succeeds, you will find a portable build of the application
|
||||||
in the 'builddir/package' subdirectory, and a very basic MSI installation
|
in the 'builddir/package' subdirectory, and a very basic MSI installation
|
||||||
|
2
fiv.c
2
fiv.c
@ -458,7 +458,7 @@ show_about_dialog(GtkWidget *parent)
|
|||||||
|
|
||||||
GtkWidget *website = gtk_label_new(NULL);
|
GtkWidget *website = gtk_label_new(NULL);
|
||||||
gtk_label_set_selectable(GTK_LABEL(website), TRUE);
|
gtk_label_set_selectable(GTK_LABEL(website), TRUE);
|
||||||
const char *url = "https://git.janouch.name/p/" PROJECT_NAME;
|
const char *url = PROJECT_URL;
|
||||||
gchar *link = g_strdup_printf("<a href='%s'>%s</a>", url, url);
|
gchar *link = g_strdup_printf("<a href='%s'>%s</a>", url, url);
|
||||||
gtk_label_set_markup(GTK_LABEL(website), link);
|
gtk_label_set_markup(GTK_LABEL(website), link);
|
||||||
g_free(link);
|
g_free(link);
|
||||||
|
42
fiv.wxs.in
42
fiv.wxs.in
@ -27,7 +27,7 @@
|
|||||||
<Media Id='1' Cabinet='data.cab' EmbedCab='yes' />
|
<Media Id='1' Cabinet='data.cab' EmbedCab='yes' />
|
||||||
<Icon Id='fiv.ico' SourceFile='fiv.ico' />
|
<Icon Id='fiv.ico' SourceFile='fiv.ico' />
|
||||||
<Property Id='ARPPRODUCTICON' Value='fiv.ico' />
|
<Property Id='ARPPRODUCTICON' Value='fiv.ico' />
|
||||||
<Property Id='ARPURLINFOABOUT' Value='https://git.janouch.name/p/fiv' />
|
<Property Id='ARPURLINFOABOUT' Value='@ProjectURL@' />
|
||||||
|
|
||||||
<UIRef Id='WixUI_Minimal' />
|
<UIRef Id='WixUI_Minimal' />
|
||||||
<!-- This isn't supported by msitools, but is necessary for WiX.
|
<!-- This isn't supported by msitools, but is necessary for WiX.
|
||||||
@ -35,32 +35,34 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<Directory Id='TARGETDIR' Name='SourceDir'>
|
<Directory Id='TARGETDIR' Name='SourceDir'>
|
||||||
<Directory Id='$(var.ProgramFilesFolder)' Name='Files'>
|
<Directory Id='$(var.ProgramFilesFolder)'>
|
||||||
<Directory Id='INSTALLDIR' Name='$(var.FullName)' />
|
<Directory Id='INSTALLDIR' Name='$(var.FullName)' />
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
<Directory Id='ProgramMenuFolder' Name='Programs'>
|
<Directory Id='ProgramMenuFolder'>
|
||||||
<Directory Id='ProgramMenuDir' Name='$(var.FullName)'>
|
<Directory Id='ProgramMenuDir' Name='$(var.FullName)' />
|
||||||
<Component Id='ProgramMenuDir' Guid='*'>
|
|
||||||
<Shortcut Id='ProgramsMenuShortcut'
|
|
||||||
Name='@ProjectName@'
|
|
||||||
Target='[INSTALLDIR]\fiv.exe'
|
|
||||||
WorkingDirectory='INSTALLDIR'
|
|
||||||
Arguments='"%USERPROFILE%"'
|
|
||||||
Icon='fiv.ico' />
|
|
||||||
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
|
|
||||||
<RegistryValue Root='HKCU'
|
|
||||||
Key='Software\[Manufacturer]\[ProductName]'
|
|
||||||
Type='string'
|
|
||||||
Value=''
|
|
||||||
KeyPath='yes' />
|
|
||||||
</Component>
|
|
||||||
</Directory>
|
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
<Directory Id='DesktopFolder' Name='Desktop' />
|
<Directory Id='DesktopFolder' />
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
|
<DirectoryRef Id='ProgramMenuDir'>
|
||||||
|
<Component Id='ProgramMenuDir' Guid='*'>
|
||||||
|
<Shortcut Id='ProgramsMenuShortcut'
|
||||||
|
Name='@ProjectName@'
|
||||||
|
Target='[INSTALLDIR]\fiv.exe'
|
||||||
|
WorkingDirectory='INSTALLDIR'
|
||||||
|
Arguments='"%USERPROFILE%"'
|
||||||
|
Icon='fiv.ico' />
|
||||||
|
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
|
||||||
|
<RegistryValue Root='HKCU'
|
||||||
|
Key='Software\[Manufacturer]\[ProductName]'
|
||||||
|
Type='string'
|
||||||
|
Value=''
|
||||||
|
KeyPath='yes' />
|
||||||
|
</Component>
|
||||||
|
</DirectoryRef>
|
||||||
|
|
||||||
<Feature Id='Complete' Level='1'>
|
<Feature Id='Complete' Level='1'>
|
||||||
<ComponentGroupRef Id='CG.fiv' />
|
<ComponentGroupRef Id='CG.fiv' />
|
||||||
<ComponentRef Id='ProgramMenuDir' />
|
<ComponentRef Id='ProgramMenuDir' />
|
||||||
|
19
meson.build
19
meson.build
@ -93,11 +93,13 @@ endif
|
|||||||
# XXX: https://github.com/mesonbuild/meson/issues/825
|
# XXX: https://github.com/mesonbuild/meson/issues/825
|
||||||
docdir = get_option('datadir') / 'doc' / meson.project_name()
|
docdir = get_option('datadir') / 'doc' / meson.project_name()
|
||||||
application_ns = 'name.janouch.'
|
application_ns = 'name.janouch.'
|
||||||
|
application_url = 'https://janouch.name/p/' + meson.project_name()
|
||||||
|
|
||||||
conf = configuration_data()
|
conf = configuration_data()
|
||||||
conf.set_quoted('PROJECT_NAME', meson.project_name())
|
conf.set_quoted('PROJECT_NAME', meson.project_name())
|
||||||
conf.set_quoted('PROJECT_VERSION', '@VCS_TAG@')
|
conf.set_quoted('PROJECT_VERSION', '@VCS_TAG@')
|
||||||
conf.set_quoted('PROJECT_NS', application_ns)
|
conf.set_quoted('PROJECT_NS', application_ns)
|
||||||
|
conf.set_quoted('PROJECT_URL', application_url)
|
||||||
conf.set_quoted('PROJECT_DOCDIR', get_option('prefix') / docdir)
|
conf.set_quoted('PROJECT_DOCDIR', get_option('prefix') / docdir)
|
||||||
if win32
|
if win32
|
||||||
conf.set_quoted('PROJECT_DOCDIR', docdir)
|
conf.set_quoted('PROJECT_DOCDIR', docdir)
|
||||||
@ -338,18 +340,25 @@ elif meson.is_cross_build()
|
|||||||
msys2_root = meson.get_external_property('msys2_root')
|
msys2_root = meson.get_external_property('msys2_root')
|
||||||
meson.add_install_script('msys2-install.sh', msys2_root)
|
meson.add_install_script('msys2-install.sh', msys2_root)
|
||||||
|
|
||||||
# TODO: If we used DESTDIR instead of the prefix, this could probably
|
wxs = configure_file(
|
||||||
# be a custom target that invokes "meson install --destdir $(pwd)/package"
|
|
||||||
# through "meson compile -C builddir msi". Try it out, also in MSYS2.
|
|
||||||
meson.add_install_script('msys2-package.sh', host_machine.cpu())
|
|
||||||
configure_file(
|
|
||||||
input : 'fiv.wxs.in',
|
input : 'fiv.wxs.in',
|
||||||
output : 'fiv.wxs',
|
output : 'fiv.wxs',
|
||||||
configuration : configuration_data({
|
configuration : configuration_data({
|
||||||
'ProjectName' : meson.project_name(),
|
'ProjectName' : meson.project_name(),
|
||||||
'ProjectVersion' : meson.project_version(),
|
'ProjectVersion' : meson.project_version(),
|
||||||
|
'ProjectURL' : application_url,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
custom_target('package',
|
||||||
|
output : 'fiv.msi',
|
||||||
|
command : [meson.current_source_dir() / 'msys2-package.sh',
|
||||||
|
host_machine.cpu(), 'fiv.msi', wxs],
|
||||||
|
env : ['MESON_BUILD_ROOT=' + meson.current_build_dir(),
|
||||||
|
'MESON_SOURCE_ROOT=' + meson.current_source_dir()],
|
||||||
|
console : true,
|
||||||
|
build_always_stale : true,
|
||||||
|
build_by_default : false,
|
||||||
|
)
|
||||||
|
|
||||||
# This is the minimum to run targets from msys2-configure.sh builds.
|
# This is the minimum to run targets from msys2-configure.sh builds.
|
||||||
meson.add_devenv({
|
meson.add_devenv({
|
||||||
|
@ -120,13 +120,12 @@ setup() {
|
|||||||
endian = 'little'
|
endian = 'little'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
meson setup --buildtype=debugoptimized --prefix="$packagedir" \
|
meson setup --buildtype=debugoptimized --prefix=/ \
|
||||||
--bindir . --libdir . --cross-file="$toolchain" "$builddir" "$sourcedir"
|
--bindir . --libdir . --cross-file="$toolchain" "$builddir" "$sourcedir"
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcedir=$(realpath "${2:-$(dirname "$0")}")
|
sourcedir=$(realpath "${2:-$(dirname "$0")}")
|
||||||
builddir=$(realpath "${1:-builddir}")
|
builddir=$(realpath "${1:-builddir}")
|
||||||
packagedir=$builddir/package
|
|
||||||
toolchain=$builddir/msys2-cross-toolchain.meson
|
toolchain=$builddir/msys2-cross-toolchain.meson
|
||||||
|
|
||||||
# This directory name matches the prefix in .pc files, so we don't need to
|
# This directory name matches the prefix in .pc files, so we don't need to
|
||||||
|
@ -1,9 +1,17 @@
|
|||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C
|
||||||
cd "$MESON_BUILD_ROOT"
|
cd "$MESON_BUILD_ROOT"
|
||||||
|
arch=$1 msi=$2 files=package-files.wxs destdir=$(pwd)/package
|
||||||
|
shift 2
|
||||||
|
|
||||||
|
# We're being passed host_machine.cpu(), which will be either x86 or x86_64.
|
||||||
|
[ "$arch" = "x86" ] || arch=x64
|
||||||
|
|
||||||
|
rm -rf "$destdir"
|
||||||
|
meson install --destdir "$destdir"
|
||||||
|
|
||||||
txt2rtf() {
|
txt2rtf() {
|
||||||
iconv -f utf-8 -t ascii//translit "$@" | awk 'BEGIN {
|
LC_CTYPE=C.UTF-8 iconv -f utf-8 -t ascii//translit "$@" | awk 'BEGIN {
|
||||||
print "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0 Tahoma;}}"
|
print "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0 Tahoma;}}"
|
||||||
print "\\f0\\fs24{\\pard\\sa240"
|
print "\\f0\\fs24{\\pard\\sa240"
|
||||||
} {
|
} {
|
||||||
@ -15,16 +23,12 @@ txt2rtf() {
|
|||||||
}'
|
}'
|
||||||
}
|
}
|
||||||
|
|
||||||
# We're being passed host_machine.cpu(), which will be either x86 or x86_64.
|
# msitools have this filename hardcoded in UI files, and it's required.
|
||||||
[ "$1" = "x86" ] && arch=x86 || arch=x64
|
|
||||||
|
|
||||||
wxs=fiv.wxs files=fiv-files.wxs msi=fiv.msi
|
|
||||||
|
|
||||||
txt2rtf "$MESON_SOURCE_ROOT/LICENSE" > License.rtf
|
txt2rtf "$MESON_SOURCE_ROOT/LICENSE" > License.rtf
|
||||||
find "$MESON_INSTALL_DESTDIR_PREFIX" -type f \
|
|
||||||
| wixl-heat --prefix "$MESON_INSTALL_DESTDIR_PREFIX/" \
|
|
||||||
--directory-ref INSTALLDIR --component-group CG.fiv \
|
|
||||||
--var var.SourceDir > "$files"
|
|
||||||
|
|
||||||
wixl --verbose --arch "$arch" -D SourceDir="$MESON_INSTALL_DESTDIR_PREFIX" \
|
find "$destdir" -type f \
|
||||||
--ext ui --output "$msi" "$wxs" "$files"
|
| wixl-heat --prefix "$destdir/" --directory-ref INSTALLDIR \
|
||||||
|
--component-group CG.fiv --var var.SourceDir > "$files"
|
||||||
|
|
||||||
|
wixl --verbose --arch "$arch" -D SourceDir="$destdir" --ext ui \
|
||||||
|
--output "$msi" "$@" "$files"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user