mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 18:19:07 +02:00
IDE: auto creating bundle for IDE
git-svn-id: trunk@16473 -
This commit is contained in:
parent
c779f2c362
commit
d09f2db292
@ -45,11 +45,11 @@ uses
|
|||||||
Graphics, GraphType, StdCtrls, ExtCtrls, Buttons, FileUtil, Dialogs,
|
Graphics, GraphType, StdCtrls, ExtCtrls, Buttons, FileUtil, Dialogs,
|
||||||
LResources, Laz_XMLCfg, InterfaceBase, Themes, ComCtrls,
|
LResources, Laz_XMLCfg, InterfaceBase, Themes, ComCtrls,
|
||||||
LazarusIDEStrConsts, TransferMacros, LazConf, IDEProcs, DialogProcs,
|
LazarusIDEStrConsts, TransferMacros, LazConf, IDEProcs, DialogProcs,
|
||||||
IDEWindowIntf, InputHistory, ExtToolDialog, ExtToolEditDlg,
|
IDEWindowIntf, IDEMsgIntf, InputHistory, ExtToolDialog, ExtToolEditDlg,
|
||||||
{$IFDEF win32}
|
{$IFDEF win32}
|
||||||
EnvironmentOpts, CodeToolManager, // added for windres workaround
|
EnvironmentOpts, CodeToolManager, // added for windres workaround
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
CompilerOptions;
|
ApplicationBundle, CompilerOptions;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -507,6 +507,8 @@ var
|
|||||||
NewTargetOS: String;
|
NewTargetOS: String;
|
||||||
NewTargetCPU: String;
|
NewTargetCPU: String;
|
||||||
CrossCompiling: Boolean;
|
CrossCompiling: Boolean;
|
||||||
|
CurTargetFilename: String;
|
||||||
|
BundleDir: String;
|
||||||
begin
|
begin
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
CurItem:=Options.Items[ItemIndex];
|
CurItem:=Options.Items[ItemIndex];
|
||||||
@ -588,7 +590,7 @@ begin
|
|||||||
Result:=ForceDirectoryInteractive(NewTargetDirectory,[]);
|
Result:=ForceDirectoryInteractive(NewTargetDirectory,[]);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
if OSLocksExecutables and not CrossCompiling then begin
|
if OSLocksExecutables and not CrossCompiling then begin
|
||||||
// Allow for the case where this correspnds to the current executable
|
// Allow for the case where this corresponds to the current executable
|
||||||
NewTargetFilename:='lazarus'+GetExecutableExt(NewTargetOS);
|
NewTargetFilename:='lazarus'+GetExecutableExt(NewTargetOS);
|
||||||
if FileExistsUTF8(AppendPathDelim(NewTargetDirectory)+NewTargetFilename) then
|
if FileExistsUTF8(AppendPathDelim(NewTargetDirectory)+NewTargetFilename) then
|
||||||
NewTargetFilename:='lazarus.new'+GetExecutableExt(NewTargetOS)
|
NewTargetFilename:='lazarus.new'+GetExecutableExt(NewTargetOS)
|
||||||
@ -647,6 +649,36 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// create apple bundle if needed
|
||||||
|
//debugln(['CreateBuildLazarusOptions NewTargetDirectory=',NewTargetDirectory]);
|
||||||
|
if (Options.LCLPlatform in [lpCarbon,lpCocoa])
|
||||||
|
and (NewTargetDirectory<>'')
|
||||||
|
and (DirectoryIsWritableCached(NewTargetDirectory)) then begin
|
||||||
|
CurTargetFilename:=NewTargetFilename;
|
||||||
|
if CurTargetFilename='' then
|
||||||
|
CurTargetFilename:='lazarus'+GetExecutableExt(NewTargetOS);
|
||||||
|
if not FilenameIsAbsolute(CurTargetFilename) then
|
||||||
|
CurTargetFilename:=NewTargetDirectory+PathDelim+CurTargetFilename;
|
||||||
|
BundleDir:=ChangeFileExt(CurTargetFilename,'.app');
|
||||||
|
//debugln(['CreateBuildLazarusOptions checking bundle ',BundleDir]);
|
||||||
|
if not FileExistsCached(BundleDir) then begin
|
||||||
|
//debugln(['CreateBuildLazarusOptions CurTargetFilename=',CurTargetFilename]);
|
||||||
|
Result:=CreateApplicationBundle(CurTargetFilename, 'Lazarus');
|
||||||
|
if not (Result in [mrOk,mrIgnore]) then begin
|
||||||
|
debugln(['CreateBuildLazarusOptions CreateApplicationBundle failed']);
|
||||||
|
IDEMessagesWindow.AddMsg('Error: failed to create application bundle '+BundleDir,NewTargetDirectory,-1);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
//debugln(['CreateBuildLazarusOptions BundleDir exists: ',FileExists(BundleDir)]);
|
||||||
|
Result:=CreateAppBundleSymbolicLink(CurTargetFilename);
|
||||||
|
if not (Result in [mrOk,mrIgnore]) then begin
|
||||||
|
debugln(['CreateBuildLazarusOptions CreateAppBundleSymbolicLink failed']);
|
||||||
|
IDEMessagesWindow.AddMsg('Error: failed to create application bundle symlink to '+CurTargetFilename,NewTargetDirectory,-1);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
if NewUnitDirectory<>'' then
|
if NewUnitDirectory<>'' then
|
||||||
// FPC interpretes '\ ' as an escape for a space in a path,
|
// FPC interpretes '\ ' as an escape for a space in a path,
|
||||||
// so make sure the directory doesn't end with the path delimeter.
|
// so make sure the directory doesn't end with the path delimeter.
|
||||||
|
@ -88,8 +88,6 @@ if [ -z "$COMPILER" ]; then
|
|||||||
COMPILER=$(which fpc)
|
COMPILER=$(which fpc)
|
||||||
fi
|
fi
|
||||||
FPCARCH=$($COMPILER -iSP)
|
FPCARCH=$($COMPILER -iSP)
|
||||||
#~/fpc/bin/$PPCARCH
|
|
||||||
#CROSSCOMPILER=~/fpc/bin/fpc
|
|
||||||
FPCVERSION=$($COMPILER -iV)
|
FPCVERSION=$($COMPILER -iV)
|
||||||
BUILDDIR=~/tmp/buildlaz
|
BUILDDIR=~/tmp/buildlaz
|
||||||
ROOTDIR=$BUILDDIR/Root
|
ROOTDIR=$BUILDDIR/Root
|
||||||
@ -116,9 +114,6 @@ if [ ! -e tools/svn2revisioninc ]; then
|
|||||||
fi
|
fi
|
||||||
./tools/svn2revisioninc $LAZSOURCEDIR ide/revision.inc
|
./tools/svn2revisioninc $LAZSOURCEDIR ide/revision.inc
|
||||||
|
|
||||||
|
|
||||||
#export FPCDIR=~/fpc/lib/fpc/$FPCVERSION
|
|
||||||
|
|
||||||
make bigide PP=$COMPILER USESVN2REVISIONINC=0
|
make bigide PP=$COMPILER USESVN2REVISIONINC=0
|
||||||
make lazbuilder PP=$COMPILER
|
make lazbuilder PP=$COMPILER
|
||||||
|
|
||||||
@ -147,8 +142,6 @@ find $BUILDDIR -name '.DS_Store' -exec rm -rf {} \; || true
|
|||||||
# create symlinks
|
# create symlinks
|
||||||
mkdir -p $ROOTDIR/usr/bin
|
mkdir -p $ROOTDIR/usr/bin
|
||||||
cd $ROOTDIR/usr/bin
|
cd $ROOTDIR/usr/bin
|
||||||
#does not work: ln -s /Developer/lazarus/lazarus.app/Contents/MacOS/lazarus lazarus
|
|
||||||
#does not work: ln -s /Developer/lazarus/lazarus.app/Contents/MacOS/startlazarus startlazarus
|
|
||||||
ln -s /Developer/lazarus/lazbuild lazbuild
|
ln -s /Developer/lazarus/lazbuild lazbuild
|
||||||
cp $TEMPLATEDIR/uninstall.sh $ROOTDIR/Developer/lazarus/
|
cp $TEMPLATEDIR/uninstall.sh $ROOTDIR/Developer/lazarus/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user