Skip to content

Commit 85f3148

Browse files
committed
update README
1 parent a056c9c commit 85f3148

File tree

4 files changed

+79
-13
lines changed

4 files changed

+79
-13
lines changed

.github/dependabot.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build workflow
2+
run-name: Build workflow
3+
on:
4+
push:
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
7+
cancel-in-progress: true
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest # Maybe here is a blocker
11+
container:
12+
image: debian:bullseye
13+
defaults:
14+
run:
15+
shell: bash -le {0}
16+
env:
17+
BRANCH: ${{ github.ref_name }}
18+
steps:
19+
- name: prepare
20+
21+
run: |
22+
apt-get update
23+
apt-get -y dist-upgrade
24+
apt-get -y install locales build-essential gettext libpq5 libpq-dev make gcc git openssh-client curl wget sudo lsb-release socat redis-server cmake
25+
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
26+
locale-gen
27+
if [[ ! $BRANCH =~ perl-[0-9]+\.[0-9]+\.[0-9]+ ]]; then
28+
echo "Error: Branch name must be perl-<version>"
29+
exit 1
30+
fi
31+
VERSION=$(echo $BRANCH | sed -e 's/.*perl-\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/')
32+
33+
echo "VERSION=$VERSION" | tee -a $GITHUB_ENV
34+
git config --global user.email "cibot@deriv.com"
35+
git config --global user.name "ci bot"
36+
git config --global --add safe.directory $PWD # ignore ownership problem
37+
- name: Checkout
38+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4
39+
- name: compile
40+
run: |
41+
bash ./rebuild.sh
42+
- name: push
43+
run: |
44+
rm -rf lib bin man
45+
mv /home/git/binary-com/perl/{bin,lib} .
46+
git add lib bin
47+
git commit -m "[ci skip] compile $VERSION"
48+
git push origin HEAD:$BRANCH

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# perl
2-
Custom compiled perl for Binary.com
32

4-
# compiling steps
3+
Custom compiled perl for Binary.com
54

6-
Download source code from http://www.cpan.org/src/5.0/perl-5.26.2.tar.gz
5+
## compiling steps
76

8-
We defined `-Dusesitecustomize` and removed `-Dusethreads`. Most of other parameters are copied from `perl -V | grep config_args`
9-
Run following command:
10-
```
11-
./Configure -Dusesitecustomize -Dinc_version_list=none -Dprefix=/home/git/binary-com/perl -Dvendorprefix=/home/git/regentmarkets/cpan/local -Dvendorlib=/home/git/regentmarkets/cpan/local/lib/perl5 -Dvendorarch=/home/git/regentmarkets/cpan/local/lib/perl5/x86_64-linux -Duselargefiles -Dccflags="-DDEBIAN -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security" -Dldflags=" -Wl,-z,relro" -Dlddlflags="-shared -Wl,-z,relro" -Dcccdlflags="-fPIC" -Duse64bitint -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Uuseithreads -Uusemultiplicity -Ui_libutil -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -des
12-
make
13-
make install
7+
```bash
8+
VERSION=5.26.1 ./rebuild.sh
149
```
10+
11+
## compiling it with CI
12+
13+
1. enable CI test in your forked repo :
14+
at https://github.com/username/perl/settings/actions set `Allow all actions and reusable workflows`
15+
and `Read and write permissions`. Don't forget to click `save` at both section.
16+
2. Or create a new branch directly on binary-com/perl repo
17+
3. create a branch whose name include a perl version `perl-x.yy.zz`, e.g. `upgrade/perl.5.38.2`
18+
19+
Then CI will download and compile perl and push it to your branch

rebuild.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
#!/bin/bash
22
set -e
33

4-
wget http://www.cpan.org/src/5.0/perl-5.26.2.tar.gz
5-
rm -rf perl-5.26.2
6-
tar xzvf perl-5.26.2.tar.gz
7-
cd perl-5.26.2
4+
if [ -z "$VERSION" ]; then
5+
echo "No VERSION environment variable set. Exiting..."
6+
exit 1
7+
fi
8+
echo "Building perl version $VERSION"
9+
rm -rf bin lib man
10+
wget http://www.cpan.org/src/5.0/perl-$VERSION.tar.gz
11+
rm -rf perl-$VERSION
12+
tar xzvf perl-$VERSION.tar.gz
13+
cd perl-$VERSION
814

915
# Apply patch for fixing Time::Local tests entering year 2020 (CPAN RT#124787)
1016
zcat ../patches/0001-Fix-Time-Local-tests.patch.gz | patch -p1 --verbose || exit 1
1117

1218
# Apply patch for fixing gcc 10 problem https://github.com/openwrt/packages/pull/12178
1319
patch -Np1 < ../patches/999-fix-build-failure-against-gcc-10.patch
1420

21+
#We defined `-Dusesitecustomize` and removed `-Dusethreads`. Most of other parameters are copied from `perl -V | grep config_args`
1522
./Configure -Dusesitecustomize -Dinc_version_list=none -Dprefix=/home/git/binary-com/perl -Dsitelib=/home/git/regentmarkets/cpan-private/local/lib/perl5 -Dsitearch=/home/git/regentmarkets/cpan-private/local/lib/perl5/x86_64-linux -Dvendorprefix=/home/git/regentmarkets/cpan/local -Dvendorlib=/home/git/regentmarkets/cpan/local/lib/perl5 -Dvendorarch=/home/git/regentmarkets/cpan/local/lib/perl5/x86_64-linux -Duselargefiles -Dccflags="-DDEBIAN -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security" -Dldflags=" -Wl,-z,relro" -Dlddlflags="-shared -Wl,-z,relro" -Dcccdlflags="-fPIC" -Duse64bitint -Dman1dir=none -Dman3dir=none -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Uuseithreads -Uusemultiplicity -Ui_libutil -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -des
1623
make && make test && make install
1724

0 commit comments

Comments
 (0)