build/windows: Do revisioning stuff with Inno scripting

Also, fixes CUSTOM_GIMP_VERSION format.
This commit is contained in:
Bruno
2025-02-16 18:12:39 -03:00
parent 0fa421d874
commit 1473a52704
2 changed files with 16 additions and 7 deletions

View File

@ -77,7 +77,7 @@ if ($revision -notmatch '[1-9]' -or $CI_PIPELINE_SOURCE -eq 'schedule')
} }
else else
{ {
$CUSTOM_GIMP_VERSION = "$CUSTOM_GIMP_VERSION.$revision" $CUSTOM_GIMP_VERSION = "$CUSTOM_GIMP_VERSION-$revision"
} }
Write-Output "(INFO): GIMP version: $CUSTOM_GIMP_VERSION" Write-Output "(INFO): GIMP version: $CUSTOM_GIMP_VERSION"
@ -201,11 +201,6 @@ foreach ($bundle in $supported_archs)
$gimp_api_version = Get-Content "$CONFIG_PATH" | Select-String 'GIMP_PKGCONFIG_VERSION' | $gimp_api_version = Get-Content "$CONFIG_PATH" | Select-String 'GIMP_PKGCONFIG_VERSION' |
Foreach-Object {$_ -replace '#define GIMP_PKGCONFIG_VERSION "',''} | Foreach-Object {$_ -replace '"',''} Foreach-Object {$_ -replace '#define GIMP_PKGCONFIG_VERSION "',''} | Foreach-Object {$_ -replace '"',''}
## GIMP revision on about dialog (this does the same as '-Drevision' build option)
## FIXME: This should be done with Inno scripting
(Get-Content "$bundle\share\gimp\*\gimp-release") | Foreach-Object {$_ -replace "revision=0","revision=$revision"} |
Set-Content "$bundle\share\gimp\*\gimp-release"
## Split .debug symbols ## Split .debug symbols
if ("$bundle" -eq "$GIMP32") if ("$bundle" -eq "$GIMP32")
{ {

View File

@ -1528,7 +1528,7 @@ end; //PrepareInterp
//Create .env files //Create .env files
procedure PrepareGimpEnvironment(); procedure PrepareGimpEnvironment();
var EnvFile,Env: String; var EnvFile,Env,sTemp: String;
begin begin
StatusLabel(CustomMessage('SettingUpEnvironment'),''); StatusLabel(CustomMessage('SettingUpEnvironment'),'');
@ -1554,6 +1554,20 @@ begin
SuppressibleMsgBox(FmtMessage(CustomMessage('ErrorChangingEnviron'),[EnvFile]),mbInformation,mb_ok,IDOK); SuppressibleMsgBox(FmtMessage(CustomMessage('ErrorChangingEnviron'),[EnvFile]),mbInformation,mb_ok,IDOK);
end; end;
// Set revision
EnvFile := ExpandConstant('{app}\share\gimp\{#GIMP_API_VERSION}\gimp-release');
DebugMsg('SetRevision','Seting revision number {#REVISION} in ' + EnvFile);
//LoadStringFromUTF8File(EnvFile,Env);
//sTemp := Replace('=0','={#REVISION}',Env);
sTemp := 'revision={#REVISION}' + #10;
if not SaveStringToUTF8File(EnvFile,sTemp,False) then
begin
DebugMsg('PrepareGimpEnvironment','Problem seting revision');
SuppressibleMsgBox(FmtMessage(CustomMessage('ErrorChangingEnviron'),[EnvFile]),mbInformation,mb_ok,IDOK);
end;
// Disable check-update when run with specific option // Disable check-update when run with specific option
if ExpandConstant('{param:disablecheckupdate|false}') = 'true' then if ExpandConstant('{param:disablecheckupdate|false}') = 'true' then
begin begin