Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
build-test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Павел Бекетов
build-test
Commits
e1382c28
Commit
e1382c28
authored
Mar 24, 2022
by
Pavel Beketov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit
parents
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
135 additions
and
0 deletions
+135
-0
build.sh
build.sh
+135
-0
No files found.
build.sh
0 → 100755
View file @
e1382c28
#!/bin/sh -x
.
./config.sh
# build only 32 bit on i586 arch
[
"
$(
epm print info
-a
)
"
=
"x86"
]
&&
BUILDARCH
=
win32
# overrride BUILDARCH
[
"
$1
"
]
&&
BUILDARCH
=
"
$1
"
CLANG
=
"
$(
which ccache 2>/dev/null
)
clang"
check_clang
()
{
# TODO: check we have complete 11 or complete 12
if
[
"
$(
epm print info
-e
)
"
=
"AstraLinux/orel"
]
;
then
epm assure llvm-link llvm-9
||
fatal
epm assure clang-9 clang-9
||
fatal
#epm assure clang clang || fatal
epm assure /usr/bin/lld-link lld-9
||
fatal
epm assure /usr/bin/llvm-dlltool llvm-9
||
fatal
# to allow clang build 32 bit
#epm install libgcc-10-dev-i386-cross || fatal
epm
install
gcc-multilib
elif
[
"
$(
epm print info
-p
)
"
=
"deb"
]
;
then
epm assure llvm-link llvm-11
||
fatal
epm assure clang-11 clang-11
||
fatal
#epm assure clang clang || fatal
epm assure /usr/bin/lld-link lld-11
||
fatal
epm assure /usr/bin/llvm-dlltool llvm-11
||
fatal
# to allow clang build 32 bit
epm
install
libgcc-10-dev-i386-cross
||
fatal
else
epm assure llvm-link llvm
||
fatal
epm assure clang
||
fatal
epm assure /usr/bin/lld-link
||
fatal
epm assure /usr/bin/llvm-dlltool
||
fatal
# hack for p9
if
!
clang
--version
|
grep
"clang version 1[1-9]"
||
!
lld-link
--version
|
grep
"LLD 1[1-9]"
;
then
epmqp llvm10 | epme
--auto
epmqp llvm7 | epme
--auto
epm
install
llvm11.0 clang11.0 /usr/bin/lld-link /usr/bin/llvm-dlltool
||
fatal
fi
fi
}
epm assure git
epm assure
time
case
"
$COMPILER
"
in
clang
)
check_clang
export
CC
=
$CLANG
;;
gcc
)
;;
*
)
fatal
"Unknown COMPILER
$COMPILER
"
esac
case
"
$CROSSCOMPILER
"
in
clang
)
check_clang
for
i
in
clang clang-11 clang-10 clang-9
;
do
which
$i
2>/dev/null
>
/dev/null
||
continue
export
CROSSCC
=
$i
break
done
WINE_BUILD_OPTIONS
=
"
$WINE_BUILD_OPTIONS
--with-mingw"
;;
mingw
)
WINE_BUILD_OPTIONS
=
"
$WINE_BUILD_OPTIONS
--with-mingw"
;;
none|
''
)
WINE_BUILD_OPTIONS
=
"
$WINE_BUILD_OPTIONS
--without-mingw"
;;
*
)
fatal
"Unknown CROSSCOMPILER
$CROSSCOMPILER
"
esac
epm assure jmake etersoft-build-utils
||
fatal
get_current_branch
()
{
(
cd
$REPO
&&
git branch |
grep
'^\*'
|
sed
's/^..//'
|
tr
-d
"
\n
"
)
}
print_build_mark
()
{
echo
"SOURCEREPO=
$(
realpath
$REPO
)
BRANCH=
$(
get_current_branch
)
WINEVERSION='
$(
cat
$REPO
/VERSION
)
' CC=
$COMPILER
CROSSCC=
$CROSSCOMPILER
BUILDARCH=
$BUILDARCH
PLATFORM=
$(
epm print info
-e
)
"
}
cd_to_repo
()
{
if
[
-d
"
$1
"
]
;
then
[
-f
"
$1
/.eterbuild"
]
||
fatal
"Нет флага .eterbuild в
$1
, создано не этим скриптом."
if
[
"
$(
print_build_mark
)
"
!=
"
$(
cat
"
$1
/.eterbuild"
)
"
]
;
then
echo
"Build mark
$(
print_build_mark
)
is changed (was
$(
cat
"
$1
/.eterbuild"
)
), removing old build dirs ..."
rm
-rvf
"
$1
"
fi
fi
# create dir if missed or just removed above
if
[
!
-d
"
$1
"
]
;
then
mkdir
-p
"
$1
"
print_build_mark
>
"
$1
/.eterbuild"
fi
cd
$1
||
fatal
}
# need we?
# disable rpath using for executable
# subst "s|^\(LDRPATH_INSTALL =\).*|\1|" Makefile.in
if
[
"
$BUILDARCH
"
=
"win64"
]
||
[
"
$BUILDARCH
"
=
"both"
]
;
then
cd_to_repo
$BUILDREPO64
$REPO
/configure
--enable-win64
${
WINE_BUILD_OPTIONS
}
||
fatal
"Return from
$(
pwd
)
"
jmake
||
fatal
"Return from
$(
pwd
)
"
fi
if
[
"
$BUILDARCH
"
!=
"win64"
]
;
then
cd_to_repo
$BUILDREPO
# don't search X11 via pkg-config, so it will not help. For Astra I made ln -s /usr/lib32/i386-linux-gnu /usr/lib/i386-linux-gnu
#[ -d /usr/lib32/i386-linux-gnu/pkgconfig ] && export PKG_CONFIG_PATH=/usr/lib32/i386-linux-gnu/pkgconfig
# but default use wine tools from with-wine64 path (checking for the directory containing the Wine tools...)
[
-f
"
$BUILDREPO64
/.eterbuild"
]
&&
WINEOPT
=
"--with-wine64=
$BUILDREPO64
"
||
WINEOPT
=
''
$REPO
/configure
$WINEOPT
${
WINE_BUILD_OPTIONS
}
||
fatal
"Return from
$(
pwd
)
"
jmake
||
fatal
"Return from
$(
pwd
)
"
fi
echo
"Done:
$(
print_build_mark
)
"
# добавить в ww детект префикса (TODO: в wine?)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment