Initial checkin of Pika from heckimp

This commit is contained in:
2023-09-25 15:35:21 -07:00
commit 891e999216
6761 changed files with 5240685 additions and 0 deletions

View File

@ -0,0 +1,3 @@
#!/bin/bash
sed "1s/^/\xEF\xBB\xBF/" "$1" > "$2"

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="2.0"
xmlns:gt="https://www.gnu.org/s/gettext/ns/its/extensions/1.0">
<its:translateRule selector="/pika-ms-installer-config" translate="no"/>
<its:translateRule selector="//value" translate="yes"/>
<gt:escapeRule selector="//value" escape="no"/>
</its:rules>

View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<locatingRules>
<locatingRule name="PikaMsInstallerConfig" pattern="*.xml">
<documentRule localName="pika-ms-installer-config" target="pika-ms-installer-config.its"/>
</locatingRule>
</locatingRules>

View File

@ -0,0 +1,132 @@
# First we use the XML file to be able to do gettext translation
ms_installer_config_xml = i18n.merge_file(
input : 'setup.isl.xml.in',
output: '@BASENAME@',
data_dirs: meson.current_source_dir(),
po_dir: po_windows_installer_dir,
install: false,
)
languages = [
{ 'code': 'bg', },
{ 'code': 'ca', },
{ 'code': 'cs', },
{ 'code': 'da', },
{ 'code': 'de', },
{ 'code': 'el', },
{ 'code': 'en', 'default': true, },
{ 'code': 'en_GB', },
{ 'code': 'eo', },
{ 'code': 'es', },
{ 'code': 'eu', },
{ 'code': 'fi', },
{ 'code': 'fr', },
{ 'code': 'gl', },
{ 'code': 'he', },
{ 'code': 'hu', },
{ 'code': 'id', },
{ 'code': 'is', },
{ 'code': 'it', },
{ 'code': 'ja', },
{ 'code': 'ka', },
{ 'code': 'kab', 'langname': 'Taqbaylit' },
{ 'code': 'ko', },
{ 'code': 'lt', },
{ 'code': 'lv', },
{ 'code': 'mr', },
{ 'code': 'ms', },
{ 'code': 'nl', },
{ 'code': 'pl', },
{ 'code': 'pt', },
{ 'code': 'pt_BR', },
{ 'code': 'ro', },
{ 'code': 'ru', },
{ 'code': 'sk', },
{ 'code': 'sl', },
{ 'code': 'sv', },
{ 'code': 'tr', },
{ 'code': 'uk', },
{ 'code': 'vi', },
{ 'code': 'zh_CN', },
{ 'code': 'zh_TW', },
]
addbom = find_program(meson.current_source_dir() / 'addbom.sh')
# Then, we generate the .isl file for each language using some xsltproc magic
foreach language : languages
lang_code = language.get('code')
if 'default' in language
lang_check = 'value[not(@xml:lang)]'
else
lang_check = 'value[lang(\'@0@\')]'.format(lang_code)
endif
pika_ms_installer_lang_xsl = configure_file(
input: 'pika-ms-installer-config.xsl.in',
output: 'pika-ms-installer-config-@0@.xsl'.format(lang_code),
configuration: { 'LANG_CHECK': lang_check },
)
nobom_setup_isl = '@0@-nobom.setup.isl'.format(lang_code)
nobom_setup_isl_tmp = custom_target(nobom_setup_isl,
input : [ ms_installer_config_xml, pika_ms_installer_lang_xsl ],
output: nobom_setup_isl,
command: [
xsltproc,
'--xinclude',
'--output', '@OUTPUT@',
'@INPUT1@',
'@INPUT0@',
],
build_by_default: true,
)
setup_isl = '@0@.setup.isl'.format(lang_code)
# Inno-Setup absolutely requires a BOM to recognize UTF-8 files.
# Here I am working around 3 issues in meson:
# 1. We can't easily combine commands in meson. So either we combine
# them in an external script, or we run several custom_target(). I do
# a mix of both because custom_target() has too many bugs.
# 2. To concat a BOM to the file, I'd like to simply call this Python
# code:
# 'open("@OUTPUT@", "wb").write(b"\\xEF\\xBB\\xBF" + open("@INPUT@", "rb").read())'
# Unfortunately we can't pass several @INPUT@/@OUTPUT@ in a same arg.
# See: https://github.com/mesonbuild/meson/issues/7696
# 3. Antislashes are replaced with slashes in custom_target(). I tried
# some weird trick encoding a string to UTF-8 instead of using the
# well known BOM bytes directly. Unfortunately result was not
# consistent on all platforms (at least Linux and Windows).
# See https://github.com/mesonbuild/meson/issues/1564
custom_target(setup_isl,
input : [ nobom_setup_isl_tmp, 'addbom.sh' ],
output: [ setup_isl ],
command: [
addbom, '@INPUT0@', '@OUTPUT@'
],
build_by_default: true,
)
if 'langname' in language
# Some languages may have no default language file provided by
# InnoSetup. When this happens, we must at least complete a very
# basic file showing the language name, otherwise it shows as
# "English".
newlang_isl = '@0@.isl'.format(language.get('code'))
newlang_conf = configuration_data()
newlang_conf.set('LANGNAME', language.get('langname'))
configure_file(
input : 'newlang.isl.in',
output : newlang_isl,
configuration : newlang_conf
)
endif
endforeach
test('windows-installer-langs',
find_program('test-installer-langs.sh'),
env: [
'PIKA_TESTING_ABS_TOP_SRCDIR=' + meson.project_source_root(),
],
suite: 'build')

View File

@ -0,0 +1,15 @@
; A template to create the basic lang file for languages which are not
; made available by InnoSetup, not even in the Unofficial/ folder.
; See full list of languages:
; https://github.com/jrsoftware/issrc/tree/main/Files/Languages
;
; Without this, they show as English in the
; start list so we must add a language name (localized preferably) at
; the very least.
; See also the docs for the meanings of different fields:
; https://jrsoftware.org/ishelp/index.php?topic=langoptionssection
[LangOptions]
LanguageName=@LANGNAME@
LanguageID=$0
LanguageCodePage=0

View File

@ -0,0 +1,37 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes" />
<xsl:template match="/">
<xsl:apply-templates select="pika-ms-installer-config" />
</xsl:template>
<xsl:template match="pika-ms-installer-config">
<xsl:apply-templates select="section" />
</xsl:template>
<xsl:template match="section">[<xsl:value-of select="@name"/>]
<xsl:apply-templates select="config" />
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="config">
<xsl:value-of select="@name"/>=<xsl:value-of select="."/>
<xsl:apply-templates select="@LANG_CHECK@" />
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="config">
<xsl:choose>
<xsl:when test="@LANG_CHECK@">
<xsl:value-of select="@name"/>=<xsl:apply-templates select="@LANG_CHECK@" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>=<xsl:apply-templates select="value[not(@xml:lang)]" />
</xsl:otherwise>
</xsl:choose>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,326 @@
<?xml version='1.0' encoding='UTF-8'?>
<pika-ms-installer-config>
<section name="Messages">
<!-- InfoBefore page is used instead of license page because the GPL only concerns distribution, not use, and as such doesn't have to be accepted -->
<config name="WizardInfoBefore">
<value>License Agreement</value>
</config>
<config name="AboutSetupNote">
<value>Setup built by Jernej Simonèiè, jernej-pika@ena.si</value>
</config>
<config name="WinVersionTooLowError">
<value>This version of PIKA requires Windows 7, or a newer version of Windows.</value>
</config>
<config name="WindowsVersionNotSupported">
<value>This version of PIKA requires Windows 7, or a newer version of Windows.</value>
</config>
</section>
<section name="CustomMessages">
<!-- Shown before the wizard starts on development versions of PIKA -->
<config name="DevelopmentWarningTitle">
<value>Development version</value>
</config>
<!-- Shown before the wizard starts on development versions of PIKA -->
<config name="DevelopmentWarning">
<value>This is a development version of PIKA where some features may not be finished, or it may be unstable.%nThis version of PIKA is not intended for day-to-day work as it may be unstable, and you could lose your work.%nIf you encounter any problems, first verify that they haven't already been fixed in GIT before you contact the developers or report it in PIKA gitlab:%n_https://gitlab.gnome.org/GNOME/pika/issues%n%nDo you wish to continue with installation anyway?</value>
</config>
<config name="DevelopmentButtonContinue">
<value>&amp;Continue</value>
</config>
<config name="DevelopmentButtonExit">
<value>Exit</value>
</config>
<!--
<config name="XPSP3Recommended">
<value>Warning: you are running an unsupported version of Windows. Please update to at least Windows XP with Service Pack 3 before reporting any problems.</value>
</config>
-->
<config name="SSERequired">
<value>This version of PIKA requires a processor that supports SSE instructions.</value>
</config>
<config name="Require32BPPTitle">
<value>Display settings problem</value>
</config>
<config name="Require32BPP">
<value>Setup has detected that your Windows is not running in 32 bits-per-pixel display mode. This has been known to cause stability problems with PIKA, so it's recommended to change the display colour depth to 32BPP before continuing.</value>
</config>
<config name="Require32BPPContinue">
<value>&amp;Continue</value>
</config>
<config name="Require32BPPExit">
<value>E&amp;xit</value>
</config>
<config name="InstallOrCustomize">
<value>PIKA is now ready to be installed. Click the Install now button to install using the default settings, or click the Customize button if you'd like to have more control over what gets installed.</value>
</config>
<config name="Install">
<value>&amp;Install</value>
</config>
<config name="Customize">
<value>&amp;Customize</value>
</config>
<!-- Setup types -->
<config name="TypeCompact">
<value>Compact installation</value>
</config>
<!-- Setup types -->
<config name="TypeCustom">
<value>Custom installation</value>
</config>
<!-- Setup types -->
<config name="TypeFull">
<value>Full installation</value>
</config>
<!-- Text above component description -->
<config name="ComponentsDescription">
<value>Description</value>
</config>
<!-- Components -->
<config name="ComponentsPika">
<value>PIKA</value>
</config>
<!-- Components -->
<config name="ComponentsPikaDescription">
<value>PIKA and all default plug-ins</value>
</config>
<!-- Components -->
<config name="ComponentsDeps">
<value>Run-time libraries</value>
</config>
<!-- Components -->
<config name="ComponentsDepsDescription">
<value>Run-time libraries used by PIKA, including GTK Run-time Environment</value>
</config>
<!-- Components -->
<config name="ComponentsDebug">
<value>Debug symbols</value>
</config>
<!-- Components -->
<config name="ComponentsDebugDescription">
<value>Include information to help with debugging PIKA</value>
</config>
<!-- Components -->
<config name="ComponentsGtkWimp">
<value>MS-Windows engine for GTK</value>
</config>
<!-- Components -->
<config name="ComponentsGtkWimpDescription">
<value>Native Windows look for PIKA</value>
</config>
<!-- Components -->
<config name="ComponentsCompat">
<value>Support for old plug-ins</value>
</config>
<!-- Components -->
<config name="ComponentsCompatDescription">
<value>Install libraries needed by old third-party plug-ins</value>
</config>
<!-- Components -->
<config name="ComponentsTranslations">
<value>Translations</value>
</config>
<!-- Components -->
<config name="ComponentsTranslationsDescription">
<value>Translations</value>
</config>
<!-- Components -->
<config name="ComponentsPython">
<value>Python scripting</value>
</config>
<!-- Components -->
<config name="ComponentsPythonDescription">
<value>Allows you to use PIKA plugins written in Python scripting language.</value>
</config>
<!-- Components -->
<config name="ComponentsLua">
<value>Lua scripting</value>
</config>
<!-- Components -->
<config name="ComponentsLuaDescription">
<value>Allows you to use PIKA plugins written in Lua scripting language.</value>
</config>
<!-- Components -->
<config name="ComponentsMyPaint">
<value>MyPaint brushes</value>
</config>
<!-- Components -->
<config name="ComponentsMyPaintDescription">
<value>Install the default set of MyPaint brushes</value>
</config>
<!-- Components -->
<config name="ComponentsGhostscript">
<value>PostScript support</value>
</config>
<!-- Components -->
<config name="ComponentsGhostscriptDescription">
<value>Allow PIKA to load PostScript files</value>
</config>
<!-- Components, only when installing on x64 Windows -->
<config name="ComponentsPika32">
<value>Support for 32-bit plug-ins</value>
</config>
<!-- Compoments, only when installing on x64 Windows -->
<config name="ComponentsPika32Description">
<value>Include files necessary for using 32-bit plug-ins.%nRequired for Python support.</value>
</config>
<!-- Additional installation tasks -->
<config name="AdditionalIcons">
<value>Additional icons:</value>
</config>
<!-- Additional installation tasks -->
<config name="AdditionalIconsDesktop">
<value>Create a &amp;desktop icon</value>
</config>
<!-- Additional installation tasks -->
<config name="AdditionalIconsQuickLaunch">
<value>Create a &amp;Quick Launch icon</value>
</config>
<config name="RemoveOldPIKA">
<value>Remove previous PIKA version</value>
</config>
<!-- %1 is replaced by file name; this message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorChangingEnviron">
<value>There was a problem updating PIKA's environment in %1. If you get any errors loading the plug-ins, try uninstalling and re-installing PIKA.</value>
</config>
<!-- This message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorExtractingTemp">
<value>Error extracting temporary data.</value>
</config>
<!-- This message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorUpdatingPython">
<value>Error updating Python interpreter info.</value>
</config>
<!-- This message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorUpdatingMyPaint">
<value>Error updating MyPaint brushes info.</value>
</config>
<!-- %1 is replaced by file name; this message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorReadingPikaRC">
<value>There was an error updating %1.</value>
</config>
<!-- %1 is replaced by file name; this message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorUpdatingPikaRC">
<value>There was an error updating PIKA's configuration file %1.</value>
</config>
<!-- Displayed in Explorer's right-click menu -->
<config name="OpenWithPika">
<value>Edit with PIKA</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsCaption">
<value>Select file associations</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsExtensions">
<value>Extensions:</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsInfo1">
<value>Select the file types you wish to associate with PIKA</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsInfo2">
<value>This will make selected files open in PIKA when you double-click them in Explorer.</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsSelectAll">
<value>Select &amp;All</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsUnselectAll">
<value>Unselect &amp;All</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsSelectUnused">
<value>Select &amp;Unused</value>
</config>
<!-- Shown on summary screen just before starting the install -->
<config name="ReadyMemoAssociations">
<value>File types to associate with PIKA:</value>
</config>
<config name="RemovingOldVersion">
<value>Removing previous version of PIKA:</value>
</config>
<!-- %1 = version, %2 = installation directory; ran uninstaller, but it returned an error, or didn't remove everything -->
<config name="RemovingOldVersionFailed">
<value>PIKA %1 cannot be installed over your currently installed PIKA version, and the automatic uninstall of old version has failed.%n%nPlease remove the previous version of PIKA yourself before installing this version in %2, or choose a Custom install, and select a different installation folder.%n%nThe Setup will now exit.</value>
</config>
<!-- %1 = version, %2 = installation directory; couldn't find an uninstaller, or found several uninstallers -->
<config name="RemovingOldVersionCantUninstall">
<value>PIKA %1 cannot be installed over your currently installed PIKA version, and Setup couldn't determine how to remove the old version automatically.%n%nPlease remove the previous version of PIKA and any add-ons yourself before installing this version in %2, or choose a Custom install, and select a different installation folder.%n%nThe Setup will now exit.</value>
</config>
<config name="RebootRequiredFirst">
<value>Previous PIKA version was removed successfully, but Windows has to be restarted before the Setup can continue.%n%nAfter restarting your computer, Setup will continue next time an administrator logs in.</value>
</config>
<!-- Displayed if restart settings couldn't be read, or if the setup couldn't re-run itself -->
<config name="ErrorRestartingSetup">
<value>There was an error restarting the Setup. (%1)</value>
</config>
<config name="RemovingOldFiles">
<value>Cleaning up old files...</value>
</config>
<!-- Displayed while the files are being extracted; note the capitalisation! -->
<config name="Billboard1">
<value>Remember: PIKA is Free Software.%n%nPlease visit</value>
</config>
<!-- https://heckin.technology/AlderconeStudio/PIKApp (displayed between Billboard1 and Billboard2) -->
<config name="Billboard2">
<value>for free updates.</value>
</config>
<config name="SettingUpAssociations">
<value>Setting up file associations...</value>
</config>
<config name="SettingUpPyPika">
<value>Setting up environment for PIKA Python extension...</value>
</config>
<config name="SettingUpMyPaint">
<value>Setting up MyPaint brushes...</value>
</config>
<config name="SettingUpEnvironment">
<value>Setting up PIKA environment...</value>
</config>
<config name="SettingUpPikaRC">
<value>Setting up PIKA configuration for 32-bit plug-in support...</value>
</config>
<!-- Displayed on last page -->
<config name="LaunchPika">
<value>Launch PIKA</value>
</config>
<!-- Shown during uninstall when removing add-ons -->
<config name="UninstallingAddOnCaption">
<value>Removing add-on</value>
</config>
<config name="InternalError">
<value>Internal error (%1).</value>
</config>
<!-- Used by installer for add-ons (currently only help) -->
<config name="DirNotPika">
<value>PIKA does not appear to be installed in the selected directory. Continue anyway?</value>
</config>
</section>
</pika-ms-installer-config>

View File

@ -0,0 +1,55 @@
#!/bin/sh
# Make sure that the languages specified in the installer match the
# translations present. This check step is necessary to not forget new
# installer translations because we have a manual step.
INSTALLER_LANGS=`grep -rI '^Name:.*MessagesFile' ${PIKA_TESTING_ABS_TOP_SRCDIR}/build/windows/installer/pika3264.iss | \
sed 's/^Name: *"\([a-zA-Z_]*\)".*$/\1/' | sort`
# 'en' doesn't have a gettext file because it is the default.
INSTALLER_LANGS=`echo "$INSTALLER_LANGS" | tr '\n\r' ' ' | sed 's/\<en\> //'`
PO_LANGS=`ls ${PIKA_TESTING_ABS_TOP_SRCDIR}/po-windows-installer/*.po | \
sed 's%.*/po-windows-installer/\([a-zA-Z_]*\).po%\1%' | sort`
PO_LANGS=`echo "$PO_LANGS" | tr '\n\r' ' '`
if [ "$PO_LANGS" != "$INSTALLER_LANGS" ]; then
echo "Error: languages listed in the Windows installer script do not match the .po files in po-windows-installer/."
echo "- PO languages: $PO_LANGS"
echo "- Installer languages: $INSTALLER_LANGS"
echo "Please verify: build/windows/installer/pika3264.iss"
echo "Base language files can be found in: https://github.com/jrsoftware/issrc/tree/main/Files/Languages"
echo "If a new language is in Unofficial/, also edit/download it from:"
echo "build/windows/gitlab-ci/installer-pika-msys2.sh"
exit 1
fi
MESON_LANGS=`grep "'code':" ${PIKA_TESTING_ABS_TOP_SRCDIR}/build/windows/installer/lang/meson.build | \
sed "s/^.*'code': *'\([^']*\)'.*$/\1/" |sort`
MESON_LANGS=`echo "$MESON_LANGS" | tr '\n\r' ' ' | sed 's/\<en\> //'`
if [ "$PO_LANGS" != "$MESON_LANGS" ]; then
echo "Error: languages listed in the meson script do not match the .po files in po-windows-installer/."
echo "- PO languages: $PO_LANGS"
echo "- Meson languages: $MESON_LANGS"
echo "Please verify: build/windows/installer/lang/meson.build"
exit 1
fi
INSTALLER_LANGS=`grep -rI '^Name:.*MessagesFile.*Unofficial' ${PIKA_TESTING_ABS_TOP_SRCDIR}/build/windows/installer/pika3264.iss | \
sed 's/^.*Unofficial\\\\\([a-zA-Z_.]*\),.*$/\1/' | sort`
INSTALLER_LANGS=`echo "$INSTALLER_LANGS" | tr '\n\r' ' '`
PULLED_UNOFFICIAL=`grep '^download_lang [^(]' ${PIKA_TESTING_ABS_TOP_SRCDIR}/build/windows/gitlab-ci/installer-pika-msys2.sh | \
sed 's$^download_lang \([^.]*.isl.\?\)$\1$' | sort`
PULLED_UNOFFICIAL=`echo "$PULLED_UNOFFICIAL" | tr '\n\r' ' '`
if [ "$INSTALLER_LANGS" = "$PULLED_UNOFFICIAL" ]; then
exit 0
else
echo "Error: unofficial languages listed in the Windows installer script do not match the pulled InnoSetup files."
echo "- Pulled files: $PULLED_UNOFFICIAL"
echo "- Installer languages: $INSTALLER_LANGS"
echo "Please verify: build/windows/gitlab-ci/installer-pika-msys2.sh"
exit 1
fi