Skip to content

Commit

Permalink
Switch to FPC 3.2.4-rc1 and Lazarus 3.4 (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
lighterowl authored Jul 23, 2024
1 parent bef5fc9 commit 58dee00
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 55 deletions.
22 changes: 12 additions & 10 deletions .github/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -xe

readonly repo_dir=$PWD
readonly sdk_dir=~/.transgui_sdk
readonly fpc_installdir="${sdk_dir}/fpc-3.2.3"
readonly fpc_basepath="${fpc_installdir}/lib/fpc/3.2.3"
readonly fpc_installdir="${sdk_dir}/fpc-3.2.4-rc1"
readonly fpc_basepath="${fpc_installdir}/lib/fpc/3.2.4"
readonly brew_prefix=$(brew --prefix)
readonly macosx_libdir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
readonly macosx_frameworkdir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks
Expand All @@ -32,10 +32,12 @@ fpc_lazarus_build_install() {

mkdir -p "$sdk_dir"
cd "$sdk_dir"
readonly fpc323_commit='0c5256300a323c78caa0b1a9cb772ac137f5aa8e'
curl -O "https://gitlab.com/freepascal.org/fpc/source/-/archive/${fpc323_commit}/source-${fpc323_commit}.tar.gz"
tar xf "source-${fpc323_commit}.tar.gz"
cd "source-${fpc323_commit}"

readonly fpc324_rc1_commit='d78e2897014a69f56a1cfb53c75335c4cc37ba0e'
curl -L -o fpc-src.tar.bz2 "https://gitlab.com/freepascal.org/fpc/source/-/archive/${fpc324_rc1_commit}/source-${fpc324_rc1_commit}.tar.bz2"
tar xf fpc-src.tar.bz2
mv "source-${fpc324_rc1_commit}" fpc-src
cd fpc-src

mkdir -p "${fpc_installdir}"

Expand All @@ -57,9 +59,9 @@ fpc_lazarus_build_install() {
make_fpc_cfg

cd "$sdk_dir"
local -r lazarus_commit='63dda919964be2dead48c0fdb018a02a95727e16'
curl -L -o lazarus-src.tar.gz "https://gitlab.com/dkk089/lazarus/-/archive/${lazarus_commit}/lazarus-${lazarus_commit}.tar.gz"
tar xf lazarus-src.tar.gz
local -r lazarus_commit='4e69368d79e3801ad26a7bc7c1eda0ad3cf7dcc4'
curl -L -o lazarus-src.tar.bz2 "https://gitlab.com/dkk089/lazarus/-/archive/${lazarus_commit}/lazarus-${lazarus_commit}.tar.bz2"
tar xf lazarus-src.tar.bz2
mv "lazarus-${lazarus_commit}" lazarus
cd lazarus
make bigide
Expand Down Expand Up @@ -109,7 +111,7 @@ package_openssl() {
}

my_lazbuild() {
lazbuild --compiler=${fpc_installdir}/lib/fpc/3.2.3/${compiler} \
lazbuild "--compiler=${fpc_basepath}/${compiler}" \
--lazarusdir=${sdk_dir}/lazarus "$@"
}

Expand Down
26 changes: 16 additions & 10 deletions .github/build_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -xe

readonly repo_dir=$PWD
readonly sdk_dir=~/.transgui_sdk
readonly fpc_installdir="${sdk_dir}/fpc-3.2.3"
readonly fpc_basepath="${fpc_installdir}/lib/fpc/3.2.3"
readonly fpc_installdir="${sdk_dir}/fpc-3.2.4-rc1"
readonly fpc_basepath="${fpc_installdir}/lib/fpc/3.2.4"

fpc_lazarus_build_install() {
sudo apt install -yqq --no-install-recommends fpc build-essential
Expand All @@ -14,10 +14,11 @@ fpc_lazarus_build_install() {

mkdir -p "$sdk_dir"
cd "$sdk_dir"
readonly fpc323_commit='0c5256300a323c78caa0b1a9cb772ac137f5aa8e'
curl -O "https://gitlab.com/freepascal.org/fpc/source/-/archive/${fpc323_commit}/source-${fpc323_commit}.tar.gz"
tar xf "source-${fpc323_commit}.tar.gz"
cd "source-${fpc323_commit}"
readonly fpc324_rc1_commit='d78e2897014a69f56a1cfb53c75335c4cc37ba0e'
curl -L -o fpc-src.tar.bz2 "https://gitlab.com/freepascal.org/fpc/source/-/archive/${fpc324_rc1_commit}/source-${fpc324_rc1_commit}.tar.bz2"
tar xf fpc-src.tar.bz2
mv "source-${fpc324_rc1_commit}" fpc-src
cd fpc-src

make all
mkdir -p "${fpc_installdir}"
Expand All @@ -26,16 +27,21 @@ fpc_lazarus_build_install() {
fpcmkcfg -d basepath=${fpc_basepath} -o ~/.fpc.cfg

cd "$sdk_dir"
curl -L -o lazarus-src.tar.gz 'https://gitlab.com/dkk089/lazarus/-/archive/transgui/lazarus-transgui.tar.gz'
tar xf lazarus-src.tar.gz
mv lazarus-transgui lazarus
local -r lazarus_commit='4e69368d79e3801ad26a7bc7c1eda0ad3cf7dcc4'
curl -L -o lazarus-src.tar.bz2 "https://gitlab.com/dkk089/lazarus/-/archive/${lazarus_commit}/lazarus-${lazarus_commit}.tar.bz2"
tar xf lazarus-src.tar.bz2
mv "lazarus-${lazarus_commit}" lazarus
cd lazarus
make bigide LCL_PLATFORM=qt5
export PATH=$PWD:$PATH
}

sudo apt update -yqq
sudo apt install -yqq build-essential libqt5pas-dev libfuse2 qtbase5-dev-tools qt5-qmake libxml2-utils
sudo apt install -yqq build-essential libfuse2 qtbase5-dev-tools qt5-qmake libxml2-utils

curl -L -O https://github.com/davidbannon/libqt5pas/releases/download/v1.2.15/libqt5pas1_2.15-1_amd64.deb
curl -L -O https://github.com/davidbannon/libqt5pas/releases/download/v1.2.15/libqt5pas-dev_2.15-1_amd64.deb
sudo apt install ./libqt5pas1_2.15-1_amd64.deb ./libqt5pas-dev_2.15-1_amd64.deb

if [[ -d $sdk_dir ]]; then
export PATH=${sdk_dir}/lazarus:${fpc_installdir}/bin:${fpc_basepath}:$PATH
Expand Down
24 changes: 12 additions & 12 deletions .github/build_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function My-Download {

$sdk_dir = "${HOME}\transgui_sdk"
$fpc322 = "${sdk_dir}\fpc-3.2.2"
$fpc323 = "${sdk_dir}\fpc-3.2.3"
$fpc324 = "${sdk_dir}\fpc-3.2.4-rc1"
$lazarus = "${sdk_dir}\lazarus"
$openssl = "${sdk_dir}\OpenSSL"

Expand All @@ -28,26 +28,26 @@ function FPC-Lazarus-Build-Install {

$env:Path = "${fpc322}\bin\i386-win32;" + $env:Path

# top of fixes_3_2 at the time of writing
$fpc323_commit = '0c5256300a323c78caa0b1a9cb772ac137f5aa8e'
My-Download -Uri "https://gitlab.com/freepascal.org/fpc/source/-/archive/${fpc323_commit}/source-${fpc323_commit}.zip" -OutFile fpc-fixes.zip
$fpc324_commit = 'd78e2897014a69f56a1cfb53c75335c4cc37ba0e'
My-Download -Uri "https://gitlab.com/freepascal.org/fpc/source/-/archive/${fpc324_commit}/source-${fpc324_commit}.zip" -OutFile fpc-324-rc1.zip

# we could use Expand-Archive but it takes an eternity and then some
7z x fpc-fixes.zip
7z x fpc-324-rc1.zip

cd "source-${fpc323_commit}"
cd "source-${fpc324_commit}"
make all
mkdir "$fpc323"
make PREFIX=${fpc323} install
mkdir "$fpc324"
make PREFIX=${fpc324} install

$env:Path = "${fpc323}\bin\i386-win32;" + $env:Path
fpcmkcfg -d basepath=${fpc323} -o "${fpc323}\bin\i386-win32\fpc.cfg"
$env:Path = "${fpc324}\bin\i386-win32;" + $env:Path
fpcmkcfg -d basepath=${fpc324} -o "${fpc324}\bin\i386-win32\fpc.cfg"

cd "$sdk_dir"
My-Download -Uri "https://gitlab.com/dkk089/lazarus/-/archive/transgui/lazarus-transgui.zip" -OutFile lazarus-src.zip
$lazarus_commit = '4e69368d79e3801ad26a7bc7c1eda0ad3cf7dcc4'
My-Download -Uri "https://gitlab.com/dkk089/lazarus/-/archive/${lazarus_commit}/lazarus-${lazarus_commit}.zip" -OutFile lazarus-src.zip
7z x lazarus-src.zip

mv lazarus-transgui lazarus
mv lazarus-${lazarus_commit} lazarus
cd lazarus
make bigide
$env:Path = "${lazarus};" + $env:Path
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
path: |
~/.transgui_sdk/lazarus
~/.transgui_sdk/fpc-3.2.3
~/.transgui_sdk/fpc-3.2.4-rc1
key: macos-arm64-fpc-lazarus

- run: .github/build_macos.sh
Expand All @@ -44,7 +44,7 @@ jobs:
with:
path: |
~/.transgui_sdk/lazarus
~/.transgui_sdk/fpc-3.2.3
~/.transgui_sdk/fpc-3.2.4-rc1
key: macos-x64-fpc-lazarus

- run: .github/build_macos.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
path: |
~/.transgui_sdk/lazarus
~/.transgui_sdk/fpc-3.2.3
~/.transgui_sdk/fpc-3.2.4-rc1
key: ubuntu-fpc-lazarus

- run: .github/build_ubuntu.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/cache@v4
with:
path: |
~\transgui_sdk\fpc-3.2.3
~\transgui_sdk\fpc-3.2.4-rc1
~\transgui_sdk\lazarus
~\transgui_sdk\OpenSSL\bin\libcrypto-3.dll
~\transgui_sdk\OpenSSL\bin\libssl-3.dll
Expand Down
13 changes: 4 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@

# snap package build via snapcraft
/*.snap
/snap/.snapcraft/
/stage/
/parts/
/prime/

### https://raw.github.com/github/gitignore/8edb8a95c4c4b3dce71a378aaaf89275510b9cef/Global/Lazarus.gitignore

# Lazarus compiler-generated binaries (safe to delete)
Expand Down Expand Up @@ -40,7 +32,6 @@ units
# Application bundle for Mac OS
*.app/


# Free Pascal compiler made files
fpcmade*

Expand All @@ -52,3 +43,7 @@ Release/

# transgui binary
/transgui

# binaries on macos
/transgui_*/
.DS_Store
10 changes: 7 additions & 3 deletions main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1895,11 +1895,13 @@ procedure TMainForm.FormCreate(Sender: TObject);
if j <> 0 then StatusBar.Panels[i].Width:=j else
Ini.WriteInteger('StatusBarPanels',IntToStr(i),Statusbar.Panels[i].Width);
end;
{$IF LCL_FULLVERSION >= 1080000}
PageInfo.Options := PageInfo.Options + [nboDoChangeOnSetIndex];
{$ENDIF}

PageInfo.Options := PageInfo.Options + [nboDoChangeOnSetIndex];
FilterTimer.Interval := 100;
{$if not declared(lcl_custom_transgui)}
acKeepSelectionInTables.Checked := True;
acKeepSelectionInTables.Enabled := False;
{$endif}
end;

procedure TMainForm.FormDestroy(Sender: TObject);
Expand Down Expand Up @@ -3637,8 +3639,10 @@ procedure TMainForm.acStopTorrentExecute(Sender: TObject);
procedure TMainForm.acKeepSelectionInTablesExecute(Sender: TObject);
begin
acKeepSelectionInTables.Checked := not acKeepSelectionInTables.Checked;
{$if declared(lcl_custom_transgui)}
if acKeepSelectionInTables.Checked then gTorrents.Options2:=[]
else gTorrents.Options2:=[goNoScrollAfterSetRow];
{$endif}
Ini.WriteBool('Interface','KeepTableSelection',acKeepSelectionInTables.Checked);
end;

Expand Down
8 changes: 1 addition & 7 deletions vargrid.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1166,16 +1166,10 @@ function TVarGrid.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos
Result:=inherited DoMouseWheel(Shift, WheelDelta, MousePos);
if not Result then begin
if Mouse.WheelScrollLines = -1 then
{$IF LCL_FULLVERSION < 1080000}
GridMouseWheel(Shift, -WheelDelta*VisibleRowCount div 120)
else
GridMouseWheel(Shift, -WheelDelta*Mouse.WheelScrollLines div 120);
{$ENDIF}
{$IF LCL_FULLVERSION >= 1080000}
GridMouseWheel(Shift, WheelDelta*VisibleRowCount div 120)
else
GridMouseWheel(Shift, -WheelDelta div 120);
{$ENDIF}

Result := True;
end;
end;
Expand Down

0 comments on commit 58dee00

Please sign in to comment.