summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-04 23:34:21 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-04 23:34:21 +0300
commit26975d2dfddb075681c134f8eb7be8edd4e76abe (patch)
treefca6f9a6d138e1538b20f37e1e394a8e2e283fa5
parent1d497f258e22c0190846c09e773f3450cf9457df (diff)
parent3b5049928a6c82ce72f99cf07ef40499f027160d (diff)
downloadspm-26975d2dfddb075681c134f8eb7be8edd4e76abe.tar.gz
spm-26975d2dfddb075681c134f8eb7be8edd4e76abe.tar.bz2
spm-26975d2dfddb075681c134f8eb7be8edd4e76abe.tar.xz
spm-26975d2dfddb075681c134f8eb7be8edd4e76abe.zip
Merge branch 'master' into zlib
-rw-r--r--packages/SDL2.sh5
-rw-r--r--packages/SDL2_image.sh5
-rw-r--r--packages/SDL2_mixer.sh5
-rw-r--r--packages/SDL2_net.sh5
-rw-r--r--packages/SDL2_ttf.sh5
-rw-r--r--packages/freetype.sh12
-rw-r--r--packages/gcc.sh12
-rw-r--r--packages/gettext.sh11
-rw-r--r--packages/libxml2.sh2
-rw-r--r--packages/libzip.sh12
-rw-r--r--packages/musl.sh9
-rw-r--r--packages/physfs1.sh11
-rw-r--r--packages/pugixml.sh8
-rw-r--r--packages/python.sh10
-rw-r--r--packages/tinyxml2.sh9
-rw-r--r--packages/ustl.sh10
-rwxr-xr-xscripts/buildonly.sh11
-rwxr-xr-xscripts/createenv.sh11
-rwxr-xr-xscripts/createenvs.sh5
-rw-r--r--scripts/include/common.sh104
-rwxr-xr-xscripts/updatesrcall.sh5
21 files changed, 250 insertions, 17 deletions
diff --git a/packages/SDL2.sh b/packages/SDL2.sh
new file mode 100644
index 0000000..feb1a13
--- /dev/null
+++ b/packages/SDL2.sh
@@ -0,0 +1,5 @@
+include "SDL"
+
+DEFAULT_BRANCH="default"
+
+ENV_CPPFLAGS_PATH="include/SDL2"
diff --git a/packages/SDL2_image.sh b/packages/SDL2_image.sh
new file mode 100644
index 0000000..aaa0399
--- /dev/null
+++ b/packages/SDL2_image.sh
@@ -0,0 +1,5 @@
+include "SDL_image"
+
+DEFAULT_BRANCH="default"
+
+ENV_CPPFLAGS_PATH="include/SDL2"
diff --git a/packages/SDL2_mixer.sh b/packages/SDL2_mixer.sh
new file mode 100644
index 0000000..9168396
--- /dev/null
+++ b/packages/SDL2_mixer.sh
@@ -0,0 +1,5 @@
+include "SDL_mixer"
+
+DEFAULT_BRANCH="default"
+
+ENV_CPPFLAGS_PATH="include/SDL2"
diff --git a/packages/SDL2_net.sh b/packages/SDL2_net.sh
new file mode 100644
index 0000000..07fb011
--- /dev/null
+++ b/packages/SDL2_net.sh
@@ -0,0 +1,5 @@
+include "SDL_net"
+
+DEFAULT_BRANCH="default"
+
+ENV_CPPFLAGS_PATH="include/SDL2"
diff --git a/packages/SDL2_ttf.sh b/packages/SDL2_ttf.sh
new file mode 100644
index 0000000..386091a
--- /dev/null
+++ b/packages/SDL2_ttf.sh
@@ -0,0 +1,5 @@
+include "SDL_ttf"
+
+DEFAULT_BRANCH="default"
+
+ENV_CPPFLAGS_PATH="include/SDL2"
diff --git a/packages/freetype.sh b/packages/freetype.sh
new file mode 100644
index 0000000..659cb60
--- /dev/null
+++ b/packages/freetype.sh
@@ -0,0 +1,12 @@
+SRCURL=git://git.sv.nongnu.org/freetype/freetype2.git
+
+ENV_PATH="bin:lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+ENV_LDFLAGS_PATH="lib"
+ENV_MANPATH="share/man"
+ENV_ACLOCAL_PATH="share/aclocal"
+ENV_CPPFLAGS_PATH="include"
+
+BUILD_TYPE="automake"
+SRC_INIT_COMMAND="./autogen.sh"
diff --git a/packages/gcc.sh b/packages/gcc.sh
new file mode 100644
index 0000000..f1f59cb
--- /dev/null
+++ b/packages/gcc.sh
@@ -0,0 +1,12 @@
+# original url
+SRCURL=git://gcc.gnu.org/git/gcc.git
+# mirror
+#SRCURL=https://gitlab.com/4144/gcc.git
+
+ENV_PATH="bin"
+ENV_MANPATH="share/man"
+
+BUILD_TYPE="automake"
+
+CONFIGURE_FLAGS="--enable-languages=c,c++,lto --disable-multilib"
+ENV_LD_LIBRARY_PATH="lib:lib64:lib32"
diff --git a/packages/gettext.sh b/packages/gettext.sh
new file mode 100644
index 0000000..9c3b01c
--- /dev/null
+++ b/packages/gettext.sh
@@ -0,0 +1,11 @@
+SRCURL=git://git.savannah.gnu.org/gettext.git
+
+ENV_PATH="bin:lib:include:lib/gettext"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_LDFLAGS_PATH="lib"
+ENV_MANPATH="share/man"
+ENV_CPPFLAGS_PATH="include"
+ENV_ACLOCAL_PATH="share/aclocal"
+
+BUILD_TYPE="automake"
+SRC_INIT_COMMAND="./autogen.sh"
diff --git a/packages/libxml2.sh b/packages/libxml2.sh
index 894e58b..b649b8f 100644
--- a/packages/libxml2.sh
+++ b/packages/libxml2.sh
@@ -9,4 +9,4 @@ ENV_ACLOCAL_PATH="share/aclocal"
ENV_CPPFLAGS_PATH="include/libxml2"
BUILD_TYPE="automake"
-CONFIGURE_FLAGS="--with-python-install-dir="${bindir}/lib/python""
+CONFIGURE_FLAGS="--without-python" \ No newline at end of file
diff --git a/packages/libzip.sh b/packages/libzip.sh
new file mode 100644
index 0000000..6e514db
--- /dev/null
+++ b/packages/libzip.sh
@@ -0,0 +1,12 @@
+SRCTYPE=hg
+SRCURL=http://hg.nih.at/libzip/
+DEFAULT_BRANCH="default"
+
+ENV_PATH="bin:lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+ENV_LDFLAGS_PATH="lib"
+ENV_MANPATH="share/man"
+ENV_CPPFLAGS_PATH="include:lib/libzip/include"
+
+BUILD_TYPE="automake"
diff --git a/packages/musl.sh b/packages/musl.sh
new file mode 100644
index 0000000..3ee82b8
--- /dev/null
+++ b/packages/musl.sh
@@ -0,0 +1,9 @@
+SRCURL=git://git.musl-libc.org/musl
+DEFAULT_BRANCH="master"
+
+ENV_PATH="bin"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_LDFLAGS_PATH="lib"
+ENV_CPPFLAGS_PATH="include"
+
+BUILD_TYPE="configure"
diff --git a/packages/physfs1.sh b/packages/physfs1.sh
new file mode 100644
index 0000000..5dc9a95
--- /dev/null
+++ b/packages/physfs1.sh
@@ -0,0 +1,11 @@
+SRCTYPE=hg
+SRCURL=https://hg.icculus.org/icculus/physfs/
+DEFAULT_BRANCH="stable-1.0"
+
+ENV_PATH="bin:lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_LDFLAGS_PATH="lib"
+ENV_CPPFLAGS_PATH="include"
+
+BUILD_TYPE="automake"
+SRC_INIT_COMMAND="./bootstrap"
diff --git a/packages/pugixml.sh b/packages/pugixml.sh
new file mode 100644
index 0000000..7f71d80
--- /dev/null
+++ b/packages/pugixml.sh
@@ -0,0 +1,8 @@
+SRCURL=https://github.com/zeux/pugixml.git
+
+ENV_PATH="lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_LDFLAGS_PATH="lib"
+ENV_CPPFLAGS_PATH="include"
+
+BUILD_TYPE="cmake"
diff --git a/packages/python.sh b/packages/python.sh
new file mode 100644
index 0000000..b32f778
--- /dev/null
+++ b/packages/python.sh
@@ -0,0 +1,10 @@
+SRCURL=https://github.com/python/cpython.git
+
+ENV_PATH="bin:lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+ENV_LDFLAGS_PATH="lib"
+ENV_MANPATH="share/man"
+ENV_CPPFLAGS_PATH="include"
+
+BUILD_TYPE="configure"
diff --git a/packages/tinyxml2.sh b/packages/tinyxml2.sh
new file mode 100644
index 0000000..a7f4e0c
--- /dev/null
+++ b/packages/tinyxml2.sh
@@ -0,0 +1,9 @@
+SRCURL=https://github.com/leethomason/tinyxml2.git
+
+ENV_PATH="lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_LDFLAGS_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+ENV_CPPFLAGS_PATH="include"
+
+BUILD_TYPE="cmake"
diff --git a/packages/ustl.sh b/packages/ustl.sh
new file mode 100644
index 0000000..ad58c42
--- /dev/null
+++ b/packages/ustl.sh
@@ -0,0 +1,10 @@
+SRCURL=https://github.com/msharov/ustl.git
+DEFAULT_BRANCH="master"
+
+ENV_LD_LIBRARY_PATH="lib"
+ENV_LDFLAGS_PATH="lib"
+ENV_CPPFLAGS_PATH="include"
+
+BUILD_TYPE="configure"
+
+ENABLE_SAME_DIR_BUILD="true"
diff --git a/scripts/buildonly.sh b/scripts/buildonly.sh
new file mode 100755
index 0000000..5a45ab8
--- /dev/null
+++ b/scripts/buildonly.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+export package=$1
+source ../scripts/include/common.sh
+
+common_package_init
+
+common_build_init
+
+common_run_package
+package_build
diff --git a/scripts/createenv.sh b/scripts/createenv.sh
new file mode 100755
index 0000000..476a9f9
--- /dev/null
+++ b/scripts/createenv.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+export package=$1
+source ../scripts/include/common.sh
+
+common_package_init
+
+common_build_init
+
+common_run_package
+common_use_package
diff --git a/scripts/createenvs.sh b/scripts/createenvs.sh
new file mode 100755
index 0000000..a5fba23
--- /dev/null
+++ b/scripts/createenvs.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+source ../scripts/include/common.sh
+
+common_use_packages $*
diff --git a/scripts/include/common.sh b/scripts/include/common.sh
index d57879b..382f8a5 100644
--- a/scripts/include/common.sh
+++ b/scripts/include/common.sh
@@ -165,9 +165,19 @@ function run_cmake {
}
function run_make {
- echo "make"
- make
+ if [[ "${jobs}" == "" ]]; then
+ if [ -f "/proc/cpuinfo" ]; then
+ jobs="$(cat /proc/cpuinfo|grep processor|wc -l)"
+ else
+ jobs="1"
+ fi
+ fi
+ j=" -j${jobs}"
+
+ echo "make$j"
+ make$j
check_error $?
+ unset j
}
function run_make_install {
@@ -244,44 +254,52 @@ function run_switch_branch {
}
function repack_paths {
- if [[ "$1" == "" ]]; then
+ envvar="$1"
+ if [[ "$2" != "" ]]; then
+ envvar="$2"
+ fi
+ if [[ "$envvar" == "" ]]; then
return
fi
IFS=":"
packedpaths=""
- for var in $1
+ for var in $envvar
do
packedpaths="${packedpaths}${bindir}/$var:"
done
unset IFS
- echo "export $2=\"${packedpaths}\$$2\"" >>"${envfile}"
+ echo "export $3=\"${packedpaths}\$$3\"" >>"${envfile}"
check_error $?
}
function repack_flags {
- if [[ "$1" == "" ]]; then
+ envvar="$1"
+ if [[ "$2" != "" ]]; then
+ envvar="$2"
+ fi
+ if [[ "$envvar" == "" ]]; then
return
fi
IFS=":"
packedpaths=""
- for var in $1
+ for var in $envvar
do
- packedpaths="${packedpaths}${3}${bindir}/$var "
+ packedpaths="${packedpaths}${4}${bindir}/$var "
done
unset IFS
- echo "export $2=\"${packedpaths}\$$2\"" >>"${envfile}"
+ echo "export $3=\"${packedpaths}\$$3\"" >>"${envfile}"
check_error $?
}
function package_use {
echo "package_use"
- repack_paths "$ENV_PATH" "PATH"
- repack_paths "$ENV_LD_LIBRARY_PATH" "LD_LIBRARY_PATH"
- repack_paths "$ENV_PKG_CONFIG_PATH" "PKG_CONFIG_PATH"
- repack_paths "$ENV_MANPATH" "MANPATH"
- repack_paths "$ENV_ACLOCAL_PATH" "ACLOCAL_PATH"
- repack_flags "$ENV_LDFLAGS_PATH" "LDFLAGS" "-L"
- repack_flags "$ENV_CPPFLAGS_PATH" "CPPFLAGS" "-I"
+ repack_paths "$ENV_PATH" "$OVERRIDE_ENV_PATH" "PATH"
+ repack_paths "$ENV_LD_LIBRARY_PATH" "$OVERRIDE_ENV_LD_LIBRARY_PATH" "LD_LIBRARY_PATH"
+ repack_paths "$ENV_PKG_CONFIG_PATH" "$OVERRIDE_ENV_PKG_CONFIG_PATH" "PKG_CONFIG_PATH"
+ repack_paths "$ENV_MANPATH" "$OVERRIDE_ENV_MANPATH" "MANPATH"
+ repack_paths "$ENV_ACLOCAL_PATH" "$OVERRIDE_ENV_ACLOCAL_PATH" "ACLOCAL_PATH"
+ repack_flags "$ENV_LDFLAGS_PATH" "$OVERRIDE_ENV_LDFLAGS_PATH" "LDFLAGS" "-L"
+ repack_flags "$ENV_CPPFLAGS_PATH" "$OVERRIDE_ENV_CPPFLAGS_PATH" "CPPFLAGS" "-I"
}
function common_use_package {
@@ -299,6 +317,56 @@ function common_use_package {
check_error $?
}
+function common_use_packages {
+ cd "${scriptsdir}"
+ check_error $?
+
+ export envname="$1"
+ export installname0="${installname}"
+ export envfile="../env/run${envname}.sh"
+ echo "#!/bin/bash" >"${envfile}"
+ check_error $?
+ echo "" >>"${envfile}"
+ shift
+ names="$*"
+ IFS=" "
+ for package in $names
+ do
+ export installname="${installname0}"
+ unset ENV_PATH
+ unset ENV_LD_LIBRARY_PATH
+ unset ENV_PKG_CONFIG_PATH
+ unset ENV_MANPATH
+ unset ENV_ACLOCAL_PATH
+ unset ENV_LDFLAGS_PATH
+ unset ENV_CPPFLAGS_PATH
+
+ common_package_init
+ common_build_init
+ common_run_package
+ package_use
+ check_error $?
+ done
+ unset IFS
+ echo "\$*" >>"${envfile}"
+ check_error $?
+ chmod 0755 "${envfile}"
+ check_error $?
+}
+
+function common_update_source_all {
+ cd ../src/
+ check_error $?
+ files="*"
+ for package in $files
+ do
+ cd ../scripts/
+ ./updatesrc.sh $package
+ check_error $?
+ done
+ unset files
+}
+
function package_get_source {
echo "package_get_source"
run_clone "${SRCURL}"
@@ -360,3 +428,7 @@ function package_build {
run_make
run_make_install
}
+
+function include {
+ source "./$1.sh"
+}
diff --git a/scripts/updatesrcall.sh b/scripts/updatesrcall.sh
new file mode 100755
index 0000000..6f42573
--- /dev/null
+++ b/scripts/updatesrcall.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+source ../scripts/include/common.sh
+
+common_update_source_all