Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Bitmask Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
leap
Android Libs
Bitmask Core
Commits
838adb4d
Commit
838adb4d
authored
2 years ago
by
cyberta
Browse files
Options
Downloads
Patches
Plain Diff
add build script that helps to speed up development
parent
cba80662
No related branches found
No related tags found
1 merge request
!10
Update obfsvpn
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
build_core_dev.sh
+7
-92
7 additions, 92 deletions
build_core_dev.sh
with
7 additions
and
92 deletions
build_core_dev.sh
+
7
−
92
View file @
838adb4d
#!/bin/bash
# This script is meant to be used during development of any component related to bitmaskcore
# Make sure you have run build_core.sh at least once before using this script, so that
# golang dev environment is correctly setup, all patches have been applied to the submodules etc.
# This script only builds the different go submodules together as they are currently checked out.
RED
=
'\033[0;31m'
GREEN
=
'\033[0;32m'
NC
=
'\033[0m'
...
...
@@ -13,65 +18,9 @@ function showtitle {
echo
-e
"
\n\n
${
GREEN
}
---
$1
...
${
NC
}
\n
"
}
# -------- install golang ---------------
showtitle
"Installing golang"
if
[[
"
$OSTYPE
"
==
"linux-gnu"
*
]]
;
then
GO_VERSION
=
go1.19.8.linux-amd64
EXPECTED_FP
=
e1a0bf0ab18c8218805a1003fd702a41e2e807710b770e787e5979d1cf947aba
elif
[[
"
$OSTYPE
"
==
"darwin"
*
]]
;
then
# Mac OSX
ARCH
=
`
uname
-a
| rev |
cut
-d
" "
-f
1 | rev
`
if
[[
"
$ARCH
"
=
"x86_64"
]]
;
then
GO_VERSION
=
go1.19.8.darwin-amd64
EXPECTED_FP
=
d63e12909b3639df24f2614284868869ce14fdea2059ed365752da82ca59f994
else
GO_VERSION
=
go1.19.8.darwin-arm64
EXPECTED_FP
=
12df6263329794c55b1d63160cda9dd62de4ecd65fe52ddca33bc96a57c38ea6
fi
else
echo
"
$OSTYPE
is currently not supported."
exit
1
fi
if
[[
$(
ls
-A
${
GO_VERSION
}
.tar.gz
)
]]
then
echo
"Reusing downloaded golang bundle"
else
echo
"Installing go lang bundle
${
GO_VERSION
}
.tar.gz from https://golang.org/dl/
$GO_VERSION
.tar.gz"
curl
-L
-o
"
${
GO_VERSION
}
.tar.gz"
"https://golang.org/dl/
${
GO_VERSION
}
.tar.gz"
if
[[
"
$OSTYPE
"
==
"linux-gnu"
*
]]
;
then
ACTUAL_FP
=
`
sha256sum
$GO_VERSION
.tar.gz |
cut
-d
" "
-f1
`
else
ACTUAL_FP
=
`
shasum
-a
256
$GO_VERSION
.tar.gz |
cut
-d
" "
-f1
`
fi
if
[[
!
$ACTUAL_FP
==
$EXPECTED_FP
]]
then
quit
"Download seems to be corrupted. Cancelling build."
fi
fi
if
[[
-d
./golang
]]
then
if
[[
$(
ls
-A
./golang/
*
)
]]
then
rm
-r
./golang/
*
fi
else
mkdir
./golang
fi
tar
-C
./golang
-xzf
$GO_VERSION
.tar.gz
||
quit
"Could not untar
$GO_VERSION
.tar.gz"
# -------- update submodules ---------------
showtitle
"Updating submodules"
# git submodule sync --recursive || quit "git submodule sync --recursive"
# git submodule update --init --recursive || quit "git submodule update --init --recursive"
# -------- init environment variables ---------------
showtitle
"Initializing go environment"
cd
./golang
export
GOPATH
=
`
pwd
`
export
GO_LANG
=
`
pwd
`
/go/bin
...
...
@@ -82,40 +31,6 @@ go env -w GOFLAGS=-mod=mod
go
env
cd
..
# -------- init gomobile ---------------
showtitle
"Getting gomobile"
#./golang/go/bin/go install golang.org/x/mobile/cmd/gomobile || quit "./golang/go/bin/go install golang.org/x/mobile/cmd/gomobile"
showtitle
"initiating gomobile"
#./golang/bin/gomobile init || quit "./golang/bin/gomobile init"
# -------- prepare snowflake ---------------
showtitle
"Checking out snowflake repository"
cd
./IPtProxy/snowflake
git checkout
--force
--quiet
36f03dfd4483922b3e7400dedc71df9cf2f30b6b
||
quit
"Failed to checkout snowflake at commit 36f03dfd4483922b3e7400dedc71df9cf2f30b6b"
git submodule update
--init
--recursive
||
quit
"Failed to update snowflake submodules"
cd
..
showtitle
"Applying patches to snowflake"
patch
--directory
=
snowflake
--strip
=
1 < snowflake.patch
||
quit
cd
..
showtitle
"Applying patch to IPtProxy"
patch
--directory
=
IPtProxy
--strip
=
1 < iptproxy.patch
||
quit
# -------- preparing obfsvpn ---------------
showtitle
"Applying patch to obfsvpn"
patch
--directory
=
obfsvpn
--strip
=
1 < obfsvpn.patch
||
quit
# -------- preparing shapeshifter ---------------
showtitle
"Applying patch to shapeshifter"
patch
--directory
=
shapeshifter
--strip
=
1 < shapeshifter.patch
||
quit
# -------- preparing motd ---------------
showtitle
"Applying patch to motd (message of the day)"
patch
--directory
=
motd
--strip
=
1 < motd.patch
||
quit
# -------- build core ---------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment