Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nccf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
702
Provoz
nccf
Commits
bb1145dc
Commit
bb1145dc
authored
12 years ago
by
Yorhel
Browse files
Options
Downloads
Patches
Plain Diff
Added statically linked binary generator script
parent
4021821b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
static/build.sh
+135
-0
135 additions, 0 deletions
static/build.sh
with
137 additions
and
0 deletions
.gitignore
+
2
−
0
View file @
bb1145dc
...
@@ -18,3 +18,5 @@ ncdu
...
@@ -18,3 +18,5 @@ ncdu
ncdu.1
ncdu.1
*~
*~
*.swp
*.swp
static/*
!static/build.sh
This diff is collapsed.
Click to expand it.
static/build.sh
0 → 100755
+
135
−
0
View file @
bb1145dc
#!/bin/sh
# This script is based on static/build.sh from the ncdc git repo.
# Only i486 and arm arches are supported. i486 should perform well enough, so
# x86_64 isn't really necessary. I can't test any other arches.
MUSL_VERSION
=
0.9.9
NCURSES_VERSION
=
5.9
export
CFLAGS
=
"-O3 -g -static"
# (The variables below are automatically set by the functions, they're defined
# here to make sure they have global scope and for documentation purposes.)
# This is the arch we're compiling for, e.g. arm/mipsel.
TARGET
=
# This is the name of the toolchain we're using, and thus the value we should
# pass to autoconf's --host argument.
HOST
=
# Installation prefix.
PREFIX
=
# Path of the extracted source code of the package we're currently building.
srcdir
=
mkdir
-p
tarballs
# "Fetch, Extract, Move"
fem
()
{
# base-url name targerdir extractdir
echo
"====== Fetching and extracting
$1
$2
"
cd
tarballs
if
[
-n
"
$4
"
]
;
then
EDIR
=
"
$4
"
else
EDIR
=
$(
basename
$(
basename
$(
basename
$2
.tar.bz2
)
.tar.gz
)
.tar.xz
)
fi
if
[
!
-e
"
$2
"
]
;
then
wget
"
$1$2
"
||
exit
fi
if
[
!
-d
"
$3
"
]
;
then
tar
-xvf
"
$2
"
||
exit
mv
"
$EDIR
"
"
$3
"
fi
cd
..
}
prebuild
()
{
# dirname
if
[
-e
"
$TARGET
/
$1
/_built"
]
;
then
echo
"====== Skipping build for
$TARGET
/
$1
(assumed to be done)"
return
1
fi
echo
"====== Starting build for
$TARGET
/
$1
"
rm
-rf
"
$TARGET
/
$1
"
mkdir
-p
"
$TARGET
/
$1
"
cd
"
$TARGET
/
$1
"
srcdir
=
"../../tarballs/
$1
"
return
0
}
postbuild
()
{
touch
_built
cd
../..
}
# Pre-built cross-compilation binaries for musl. Handy. :)
getmusl
()
{
# Order of $HOST is different than the tar/dir names, so we need this case.
case
$TARGET
in
arm
)
DIR
=
arm-linux-musleabi
;;
i486
)
DIR
=
i486-linux-musl
;;
esac
fem https://bitbucket.org/GregorR/musl-cross/downloads/ crossx86-
$DIR
-
$MUSL_VERSION
.tar.xz
"musl-
$TARGET
"
$DIR
}
getncurses
()
{
fem http://ftp.gnu.org/pub/gnu/ncurses/ ncurses-
$NCURSES_VERSION
.tar.gz ncurses
prebuild ncurses
||
return
$srcdir
/configure
--prefix
=
$PREFIX
\
--without-cxx
--without-cxx-binding
--without-ada
--without-manpages
--without-progs
\
--without-tests
--without-curses-h
--without-pkg-config
--without-shared
--without-debug
\
--without-gpm
--without-sysmouse
--enable-widec
--with-default-terminfo-dir
=
/usr/share/terminfo
\
--with-terminfo-dirs
=
/usr/share/terminfo:/lib/terminfo:/usr/local/share/terminfo
\
--with-fallbacks
=
"screen linux vt100 xterm"
--host
=
$HOST
\
CPPFLAGS
=
-D_GNU_SOURCE
||
exit
make
||
exit
make install.libs
||
exit
postbuild
}
getncdu
()
{
prebuild ncdu
||
return
srcdir
=
../../..
$srcdir
/configure
--host
=
$HOST
--with-ncursesw
PKG_CONFIG
=
false
\
CPPFLAGS
=
" -D_GNU_SOURCE -I
$PREFIX
/include -I
$PREFIX
/include/ncursesw"
\
LDFLAGS
=
"-static -L
$PREFIX
/lib -lncursesw"
||
exit
make
||
exit
VER
=
`
cd
'../../..'
&&
git describe
--abbrev
=
5
--dirty
=
|
sed
s/^v//
`
tar
-czf
../../ncdu-linux-
$TARGET
-
$VER
-unstripped
.tar.gz ncdu
$HOST
-strip
ncdu
tar
-czf
../../ncdu-linux-
$TARGET
-
$VER
.tar.gz ncdu
echo
"====== ncdu-linux-
$TARGET
-
$VER
.tar.gz and -unstripped created."
postbuild
}
buildarch
()
{
TARGET
=
$1
case
$TARGET
in
arm
)
HOST
=
arm-musl-linuxeabi
;;
i486
)
HOST
=
i486-musl-linux
;;
*
)
echo
"Unknown target:
$TARGET
"
;;
esac
PREFIX
=
"
`
pwd
`
/
$TARGET
/inst"
mkdir
-p
$TARGET
$PREFIX
getmusl
MBIN
=
"
`
pwd
`
/tarballs/musl-
$TARGET
/bin"
OLDPATH
=
"
$PATH
"
PATH
=
"
$PATH
:
$MBIN
"
getncurses
getncdu
PATH
=
"
$OLDPATH
"
}
buildarch
$1
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