Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile perl 5.22 #3358

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
# runs-on https://github.com/actions/virtual-environments
# setup-python https://github.com/actions/setup-python
# actions-setup-perl https://github.com/marketplace/actions/setup-perl-environment
# strawberry Perl 5.12.3.0 https://strawberryperl.com/download/5.12.3.0/strawberry-perl-5.12.3.0-portable.zip
# strawberry Perl 5.22.3.1 https://strawberryperl.com/download/5.22.3.1/strawberry-perl-5.22.3.1-32bit-portable.zip
# strawberry Perl 5.32.1.1 https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-32bit-portable.zip
# actions-upload-artifact https://github.com/actions/upload-artifact
# actions-download-artifact https://github.com/actions/download-artifact
# actions-cache https://github.com/actions/cache

name: Build XSTools
on:
push:
branches:
- master
- compile_perl_5.22
tags-ignore:
- '*'
pull_request:
Expand All @@ -28,8 +30,8 @@ jobs:
- os: windows-2016
python: 2.7
architecture: x86
perl: 5.12
strawberry_distr: 'https://strawberryperl.com/download/5.12.3.0/strawberry-perl-5.12.3.0-portable.zip'
perl: 5.22
strawberry_distr: 'https://strawberryperl.com/download/5.22.3.1/strawberry-perl-5.22.3.1-32bit-portable.zip'

- os: windows-latest
python: 3
Expand All @@ -40,7 +42,7 @@ jobs:
- os: ubuntu-18.04
python: 2.7
architecture: x64
perl: 5.12
perl: 5.22

- os: ubuntu-latest
python: 3
Expand All @@ -52,9 +54,9 @@ jobs:
uses: actions/checkout@v2

# setup matrix:
# - windows-2016 + python 2.7 x86 + strawberry perl 5.12 x86 + strawberry g++ x86
# - windows-2016 + python 2.7 x86 + strawberry perl 5.22 x86 + strawberry g++ x86
# - windows-2019 + python 3 x86 + strawberry perl 5.32 x86 + strawberry g++ x86
# - ubuntu-18.04 + python 2.7 x64 + perl 5.12 x64
# - ubuntu-18.04 + python 2.7 x64 + perl 5.22 x64
# - ubuntu-20.04 + python 3 x64 + perl 5.32 x64
- name: Setup python ${{ matrix.python }} ${{ matrix.architecture }}
uses: actions/setup-python@v2
Expand Down Expand Up @@ -162,7 +164,6 @@ jobs:
PERL: ${{ matrix.perl }}
ARCHITECTURE: ${{ matrix.architecture }}
run: |
sudo apt update
sudo apt install -y libreadline6-dev libcurl4-openssl-dev
make all
echo "======================================================"
Expand Down Expand Up @@ -209,15 +210,15 @@ jobs:
include:
- os: windows-2016
architecture: x86
perl: 5.12
perl: 5.22

- os: windows-latest
architecture: x86
perl: 5.32

- os: ubuntu-18.04
architecture: x64
perl: 5.12
perl: 5.22

- os: ubuntu-latest
architecture: x64
Expand Down
108 changes: 108 additions & 0 deletions .github/workflows/build_XSTools_win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# runs-on: https://github.com/actions/virtual-environments
# setup-python: https://github.com/actions/setup-python
# actions-setup-perl: https://github.com/marketplace/actions/setup-perl-environment
# Strawberry Perl 5.22.3.1: https://strawberryperl.com/download/5.22.3.1/strawberry-perl-5.22.3.1-32bit-portable.zip
# actions-upload-artifact: https://github.com/actions/upload-artifact

name: Build Win
on:
push:
branches:
- master
tags-ignore:
- '*'
pull_request:

jobs:
build_XSTools:

name: XSTools ${{ matrix.os }} (python ${{ matrix.python }}) (perl ${{ matrix.perl }}) x${{ matrix.perl_arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2016
python: 3
architecture: x86
perl: '5.22'
perl_arch: 64

- os: windows-2016
python: 3
architecture: x86
perl: '5.22'
perl_arch: 32

steps:
- name: Checkout
uses: actions/checkout@v2

# setup Windows matrix: python 3_x86 and strawberry perl 5.32_x64, 5.32_x86
- name: setup-python ${{ matrix.python }} ${{ matrix.architecture }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.architecture }}

- name: Replace perl to 5.32.3.1 x${{ matrix.perl_arch }}
run: |
echo "================================================================="
echo "== previous version of Perl:"
echo "================================================================="
perl --version
echo "================================================================="
echo "== remove the default perl"
echo "================================================================="
rm -r C:/Strawberry/*
echo "================================================================="
echo "== download strawberry perl ${{ matrix.perl }} ${{ matrix.perl_arch }}"
echo "================================================================="
Invoke-WebRequest https://strawberryperl.com/download/5.22.3.1/strawberry-perl-5.22.3.1-${{ matrix.perl_arch }}bit-portable.zip -OutFile strawberry.zip
7z.exe x strawberry.zip -o"C:/Strawberry"
echo "================================================================="
echo "== a new version of Perl:"
echo "================================================================="
perl --version
echo "================================================================="
echo "== uninstall mingw x64"
echo "================================================================="
choco uninstall mingw

- name: Environment check
run: |
echo "================================================================="
echo "== check g++ version:"
echo "================================================================="
g++ --version
echo "================================================================="
echo "== perl version:"
echo "================================================================="
perl --version
echo "================================================================="
echo "== Time::HiRes module:"
echo "================================================================="
perl -e "use Time::HiRes;"
echo "================================================================="
echo "== Compress::Zlib module:"
echo "================================================================="
perl -e "use Compress::Zlib;"
echo "================================================================="
echo "== python version:"
echo "================================================================="
python -V

- name: Run make XSTools.dll
run: |
gmake all
echo "================================================================="
ls src\auto\XSTools\XSTools.dll
ls src\auto\XSTools\NetRedirect.dll

- name: Making artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}_perl${{ matrix.perl }}x${{ matrix.perl_arch }}
path: |
src\auto\XSTools\XSTools.dll
src\auto\XSTools\NetRedirect.dll
86 changes: 86 additions & 0 deletions .github/workflows/test.yml_
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# runs-on: https://github.com/actions/virtual-environments
# setup-python: https://github.com/actions/setup-python
# actions-setup-perl: https://github.com/marketplace/actions/setup-perl-environment

name: make test

on:
push:
branches:
- master
tags-ignore:
- '*'
pull_request:

jobs:
make_test:

name: make test ${{ matrix.os }} (python ${{ matrix.python }}) (perl ${{ matrix.perl }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
#- os: windows-2016
# python: 2.7
# architecture: x86
# perl: 5.12
# distribution: default

#- os: windows-latest
# python: 3
# architecture: x86
# perl: latest
# distribution: strawberry

- os: ubuntu-18.04
python: 2.7
architecture: x64
perl: 5.12
distribution: default

- os: ubuntu-latest
python: 3
architecture: x64
perl: latest
distribution: default

steps:
- name: Checkout
uses: actions/checkout@v2

# setup Windows matrix: python 2.7_x86, 3_x86 and perl 5.12_x64, strawberry last_x64
# setup Linux matrix: python 2.7_x64, 3_x64 and perl 5.12_x64, last_x64
- name: setup-python ${{ matrix.python }} ${{ matrix.architecture }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.architecture }}

- name: setup-perl ${{ matrix.perl }} (${{ matrix.distribution }})
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
distribution: ${{ matrix.distribution }}

- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y libreadline6-dev libcurl4-openssl-dev

- name: Environment check
run: |
echo "------------- check g++ version -------------"
g++ --version
echo "------------- perl version -------------"
perl --version
echo "------------- Time::HiRes module -------------"
perl -e "use Time::HiRes;"
echo "------------- Compress::Zlib module -------------"
perl -e "use Compress::Zlib;"
echo "------------- python version -------------"
python -V

- name: Run Tests
run: make test
Binary file modified NetRedirect.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ env['LINKFLAGS'] = []
if win32:
import platform
# have to use -static-libgcc while compiling with mingw’s g++ to eliminate the dependency on LIBGCC_S_SJLJ-1.DLL
env['LINKFLAGS'] += ['-static-libgcc']
env['LINKFLAGS'] += ['-static-libgcc', '-static']
if "64" in platform.machine():
env['CCFLAGS'] += ['-fpermissive', '-DWINx86_64']

Expand All @@ -235,7 +235,7 @@ libenv = env.Clone()
if win32:
if cygwin:
libenv['CCFLAGS'] += ['-mdll']
libenv['CPPDEFINES'] += ['WIN32']
libenv['CPPDEFINES'] += ['WIN32', 'PERL_EUPXS_ALWAYS_EXPORT']
elif not darwin:
libenv['CCFLAGS'] += ['-fPIC']
libenv['LINKFLAGS'] += ['-fPIC']
Expand Down
Binary file modified XSTools.dll
Binary file not shown.
Binary file added interfaces/tkstart.exe
Binary file not shown.
Binary file added interfaces/vxstart.exe
Binary file not shown.
Binary file added interfaces/winguistart.exe
Binary file not shown.
3 changes: 2 additions & 1 deletion src/Interface/Tk.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use Tk::NoteBook;

#these should go in a config file at some point.
our $line_limit = 1000;
our $buildType;

################################################################
# Public Method
Expand Down Expand Up @@ -173,7 +174,7 @@ sub title {

sub updatePos {
my $self = shift;
return unless defined($config{'char'}) && defined($chars[$config{'char'}]) && defined($char->{'pos_to'});
return unless defined($config{'char'}) && defined($chars[$config{'char'}]) && defined($char) && defined($char->{'pos_to'});
my ($x,$y) = @{$char->{'pos_to'}}{'x', 'y'};
$self->{status_posx}->configure( -text =>$x);
$self->{status_posy}->configure( -text =>$y);
Expand Down
3 changes: 2 additions & 1 deletion src/Interface/Win32.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use Globals;
use Settings;
use Misc;

use Win32::GUI();
use Win32::GUI;
use Win32::GUI::Constants qw(WS_CHILD WS_VISIBLE WS_VSCROLL ES_LEFT ES_MULTILINE ES_READONLY ES_AUTOVSCROLL MB_OK MB_ICONERROR);
use Interface::Win32::Map; #Map Viewer


Expand Down
1 change: 1 addition & 0 deletions src/Interface/Wx.pm
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ sub OnInit {
my $self = shift;

$CVS = ($Settings::SVN =~ /SVN/);
Wx::DisableAssertHandler();
$self->createInterface;
$self->iterate;

Expand Down
2 changes: 1 addition & 1 deletion src/InventoryList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sub new {

sub DESTROY {
my ($self) = @_;
Plugins::delHook($self->{hooks}) if $self->{hooks};
Plugins::delHook($self->{hooks}) if exists $self->{hooks} && defined $self->{hooks};
$self->clear();
$self->SUPER::DESTROY();
}
Expand Down
25 changes: 7 additions & 18 deletions src/InventoryList/Cart.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ sub new {
$self->{exists} = 0;
$self->{type} = 0;

if($masterServer->{itemListType}) {
$self->{hooks} = Plugins::addHooks (
['packet/item_list_start', \&onitemListStart, $self],
['packet/item_list_end', sub { $self->onitemListEnd; }],
);
}

return $self;
}

Expand Down Expand Up @@ -86,21 +79,17 @@ sub item_max_stack {
return $itemStackLimit{$nameID}->{2} || $itemStackLimit{-1}->{2} || 30000;
}

sub onitemListStart {
my ($hook_name, $args, $self) = @_;
if($args->{type} == 0x1) {
$self->clear();
if (!$self->{exists}) {
$self->{exists} = 1;
}
sub start {
my ($self) = @_;
$self->clear();
if (!$self->{exists}) {
$self->{exists} = 1;
}
}

sub onitemListEnd {
sub ready {
my ($self) = @_;
if($current_item_list == 0x1) {
Plugins::callHook('cart_ready');
}
Plugins::callHook('cart_ready');
}

1;
Loading