Skip to content

Commit

Permalink
Final tweaks for new release.
Browse files Browse the repository at this point in the history
  • Loading branch information
LongDirtyAnimAlf committed Dec 21, 2017
1 parent b141bf5 commit b355422
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 100 deletions.
Binary file modified fpcupdeluxe.ico
Binary file not shown.
Binary file modified fpcupdeluxe.res
Binary file not shown.
22 changes: 15 additions & 7 deletions fpcupdeluxemainform.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object Form1: TForm1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ButtonInstallCrossCompiler
AnchorSideRight.Side = asrBottom
Left = 152
Left = 154
Height = 28
Hint = 'Auto-update all installed cross-compilers'
Top = 382
Expand All @@ -53,12 +53,15 @@ object Form1: TForm1
TabOrder = 21
end
object radgrpCPU: TRadioGroup
AnchorSideLeft.Control = ListBoxFPCTarget
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = FPCVersionLabel
Left = 152
Left = 154
Height = 304
Top = 40
Width = 100
AutoFill = True
BorderSpacing.Left = 12
Caption = 'CPU'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
Expand All @@ -69,6 +72,7 @@ object Form1: TForm1
ChildSizing.ControlsPerLine = 1
ClientHeight = 284
ClientWidth = 96
Constraints.MaxWidth = 150
Items.Strings = (
'i386'
'x86_64'
Expand All @@ -91,7 +95,7 @@ object Form1: TForm1
AnchorSideTop.Control = radgrpCPU
AnchorSideBottom.Control = radgrpCPU
AnchorSideBottom.Side = asrBottom
Left = 256
Left = 258
Height = 304
Top = 40
Width = 106
Expand All @@ -108,6 +112,7 @@ object Form1: TForm1
ChildSizing.ControlsPerLine = 1
ClientHeight = 284
ClientWidth = 102
Constraints.MaxWidth = 150
Items.Strings = (
'windows'
'linux'
Expand Down Expand Up @@ -1573,14 +1578,17 @@ object Form1: TForm1
ParentFont = False
end
object listModules: TListBox
AnchorSideLeft.Control = BitBtnFPCandLazarus
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = AutoCrossUpdate
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = btnInstallModule
Left = 168
Left = 167
Height = 90
Top = 422
Width = 190
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Top = 12
BorderSpacing.Bottom = 8
Constraints.MinHeight = 80
Expand Down Expand Up @@ -1626,7 +1634,7 @@ object Form1: TForm1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = radgrpOS
AnchorSideRight.Side = asrBottom
Left = 152
Left = 154
Height = 28
Top = 350
Width = 210
Expand Down Expand Up @@ -2953,7 +2961,7 @@ object Form1: TForm1
object btnInstallModule: TButton
AnchorSideLeft.Control = listModules
AnchorSideBottom.Control = Panel1
Left = 168
Left = 167
Height = 25
Top = 520
Width = 101
Expand All @@ -2971,7 +2979,7 @@ object Form1: TForm1
Left = 290
Height = 25
Top = 520
Width = 68
Width = 67
Anchors = [akLeft, akRight, akBottom]
AutoSize = True
BorderSpacing.Bottom = 6
Expand Down
11 changes: 9 additions & 2 deletions fpcupdeluxemainform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -954,9 +954,16 @@ procedure TForm1.SynEdit1Change(Sender: TObject);
then
begin
// print the error itself and the next 2 lines (good or lucky guess)
memoSummary.Lines.Append(BeginSnippet+' Start of special error summary.');
memoSummary.Lines.Append(BeginSnippet+' Start of special error summary:');
memoSummary.Lines.Append(SynEdit1.Lines[x]);
memoSummary.Lines.Append(SynEdit1.Lines[x+1]);
//temporary for trunk
if Pos('BuildUnit_cocoaint.pp',SynEdit1.Lines[x+1])>0 then
begin
memoSummary.Lines.Append('');
memoSummary.Lines.Append('See: https://bugs.freepascal.org/view.php?id=32809');
memoSummary.Lines.Append('');
end else
memoSummary.Lines.Append(SynEdit1.Lines[x+2]);
end;
end;
Expand Down Expand Up @@ -2477,7 +2484,7 @@ procedure TForm1.PrepareRun;
FPCupManager.SwitchURL:=Form2.AutoSwitchURL;

// set custom FPC compiler by special user input through setup+
FPCupManager.CompilerName:=Form2.GetCompiler(GetTargetCPU,GetTargetOS);
FPCupManager.CompilerOverride:=Form2.GetCompiler(GetTargetCPU,GetTargetOS);

// set default values for FPC and Lazarus URL ... can still be changed inside the quick real run button onclicks
FPCupManager.FPCURL:=FPCTarget;
Expand Down
30 changes: 28 additions & 2 deletions fpcuputil.pas
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ implementation
,windows, shlobj {for special folders}, ActiveX, ComObj
{$ENDIF MSWINDOWS}
{$IFDEF UNIX}
,baseunix
,unix,baseunix
{$ENDIF}
{$IFDEF ENABLEWGET}
// for wget downloader
Expand Down Expand Up @@ -690,6 +690,7 @@ procedure CreateDesktopShortCut(Target, TargetArguments, ShortcutName: string);
{$ENDIF MSWINDOWS}

{$IFDEF UNIX}
{$IFNDEF DARWIN}
procedure CreateDesktopShortCut(Target, TargetArguments, ShortcutName: string);
var
OperationSucceeded: boolean;
Expand Down Expand Up @@ -740,6 +741,31 @@ procedure CreateDesktopShortCut(Target, TargetArguments, ShortcutName: string);
XdgDesktopContent.Free;
end;
end;
{$ELSE DARWIN}
procedure CreateDesktopShortCut(Target, TargetArguments, ShortcutName: string);
begin
// Create shortcut on Desktop and in Applications
fpSystem(
'/usr/bin/osascript << EOF'+#10+
'tell application "Finder"'+#10+
'set myLazApp to POSIX file "'+IncludeLeadingPathDelimiter(Target)+'.app" as alias'+#10+
'try'+#10+
'set myLazDeskShort to (path to desktop folder as string) & "'+ShortcutName+'" as alias'+#10+
'on error'+#10+
'make new alias to myLazApp at (path to desktop folder as text)'+#10+
'set name of result to "'+ShortcutName+'"'+#10+
'end try'+#10+
'try'+#10+
'set myLazAppShort to (path to applications folder as string) & "'+ShortcutName+'" as alias'+#10+
'on error'+#10+
'make new alias to myLazApp at (path to applications folder as text)'+#10+
'set name of result to "'+ShortcutName+'"'+#10+
'end try'+#10+

'end tell'+#10+
'EOF');
end;
{$ENDIF DARWIN}
{$ENDIF UNIX}

procedure CreateHomeStartLink(Target, TargetArguments,
Expand All @@ -749,7 +775,7 @@ procedure CreateHomeStartLink(Target, TargetArguments,
ScriptFile: string;
begin
{$IFDEF MSWINDOWS}
infoln('Todo: write me (CreateHomeStartLink)!', etInfo);
infoln('Todo: write me (CreateHomeStartLink)!', etDebug);
{$ENDIF MSWINDOWS}
{$IFDEF UNIX}
//create dir if it doesn't exist
Expand Down
12 changes: 4 additions & 8 deletions installercore.pas
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,9 @@ implementation

function TInstaller.GetCompiler: string;
begin
if (Self is TFPCNativeInstaller) or (Self is TFPCInstaller) then
Result := GetCompilerInDir(FInstallDirectory)
else
Result := FCompiler;
if (Self is TFPCNativeInstaller) or (Self is TFPCInstaller)
then Result := GetCompilerInDir(FInstallDirectory)
else Result := FCompiler;
end;

function TInstaller.GetCrossInstaller: TCrossInstaller;
Expand Down Expand Up @@ -1792,11 +1791,8 @@ procedure TInstaller.WritelnLog(EventType: TEventType; msg: string; ToConsole: b


function TInstaller.GetCompilerInDir(Dir: string): string;
var
ExeName: string;
begin
ExeName := 'fpc' + GetExeExt;
Result := IncludeTrailingBackslash(Dir) + 'bin' + DirectorySeparator + GetFPCTarget(true) + DirectorySeparator + ExeName;
Result := IncludeTrailingBackslash(Dir) + 'bin' + DirectorySeparator + GetFPCTarget(true) + DirectorySeparator + 'fpc' + GetExeExt;
{$IFDEF UNIX}
if FileExistsUTF8(Result + '.sh') then
begin
Expand Down
19 changes: 12 additions & 7 deletions installerfpc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ TFPCInstaller = class(TInstaller)
public
//Directory that has compiler needed to compile compiler sources. If compiler doesn't exist, it will be downloaded
property BootstrapCompilerDirectory: string write FBootstrapCompilerDirectory;
//Optional; URL from which to download bootstrap FPC compiler if it doesn't exist yet.
property BootstrapCompilerURL: string write FBootstrapCompilerURL;
// Build module
function BuildModule(ModuleName:string): boolean; override;
// Clean up environment
Expand Down Expand Up @@ -2714,10 +2712,12 @@ function TFPCInstaller.CleanModule(ModuleName: string): boolean;
FileCounter:word;
DeleteList: TStringList;
CPU_OSSignature:string;
aCleanupCompiler:string;
S : string;
begin
result := inherited;
result:=InitModule;

if not result then exit;

if not DirectoryExistsUTF8(FSourceDirectory) then exit;
Expand All @@ -2729,6 +2729,7 @@ function TFPCInstaller.CleanModule(ModuleName: string): boolean;
CPU_OSSignature:=GetFPCTarget(false);
// Delete any existing buildstamp file
Sysutils.DeleteFile(IncludeTrailingPathDelimiter(FSourceDirectory)+'build-stamp.'+CPU_OSSignature);
Sysutils.DeleteFile(IncludeTrailingPathDelimiter(FSourceDirectory)+'base.build-stamp.'+CPU_OSSignature);
end else CPU_OSSignature:=GetFPCTarget(true);

{$IFDEF MSWINDOWS}
Expand All @@ -2745,7 +2746,11 @@ function TFPCInstaller.CleanModule(ModuleName: string): boolean;
end;
{$ENDIF}

if FileExists(FCompiler) then
if FileExists(FCompiler)
then aCleanupCompiler:=FCompiler
else aCleanupCompiler:=IncludeTrailingPathDelimiter(FBootstrapCompilerDirectory)+GetCompilerName(GetTargetCPU);

if FileExists(aCleanupCompiler) then
begin

Processor.OnErrorM:=nil; //don't want to log errors in distclean
Expand All @@ -2754,7 +2759,7 @@ function TFPCInstaller.CleanModule(ModuleName: string): boolean;
Processor.CurrentDirectory:=ExcludeTrailingPathDelimiter(FSourceDirectory);
Processor.Parameters.Clear;
if ((FCPUCount>1) AND (NOT FNoJobs)) then Processor.Parameters.Add('--jobs='+IntToStr(FCPUCount));
Processor.Parameters.Add('FPC='+FCompiler);
Processor.Parameters.Add('FPC='+aCleanupCompiler);
Processor.Parameters.Add('--directory='+ExcludeTrailingPathDelimiter(FSourceDirectory));
Processor.Parameters.Add('INSTALL_PREFIX='+ExcludeTrailingPathDelimiter(FInstallDirectory));
{$IFDEF MSWINDOWS}
Expand Down Expand Up @@ -2803,15 +2808,15 @@ function TFPCInstaller.CleanModule(ModuleName: string): boolean;
end
else
begin
infoln(infotext+'Running make distclean failed: could not find compiler ('+FCompiler+')',etWarning);
infoln(infotext+'Running make distclean failed: could not find cleanup compiler ('+aCleanupCompiler+')',etWarning);
end;

// Delete any existing fpc.cfg files
Sysutils.DeleteFile(ExtractFilePath(FCompiler)+'fpc.cfg');
if (NOT CrossCompiling) then Sysutils.DeleteFile(IncludeTrailingPathDelimiter(FInstallDirectory)+'bin'+DirectorySeparator+CPU_OSSignature+DirectorySeparator+'fpc.cfg');

{$IFDEF UNIX}
// Delete any fpc.sh shell scripts
Sysutils.DeleteFile(ExtractFilePath(FCompiler)+'fpc.sh');
if (NOT CrossCompiling) then Sysutils.DeleteFile(IncludeTrailingPathDelimiter(FInstallDirectory)+'bin'+DirectorySeparator+CPU_OSSignature+DirectorySeparator+'fpc.sh');
// Delete units
DeleteFile(IncludeTrailingPathDelimiter(FSourceDirectory)+'units');
DeleteFile(IncludeTrailingPathDelimiter(FSourceDirectory)+'lib/fpc/'+GetFPCVersion+'/units');
Expand Down
Loading

0 comments on commit b355422

Please sign in to comment.