summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-01-27 02:38:42 +0300
committerAndrei Karas <akaras@inbox.ru>2017-01-27 02:38:42 +0300
commita1807d94008cc932533dd7fff0f78bc8a27fdc66 (patch)
treef13fed8d79d984010cabce5d4f323d99ec3da0e4
parentecbc19b90ea893e3934cad6d6542ebc7e5e1a777 (diff)
downloadspm-a1807d94008cc932533dd7fff0f78bc8a27fdc66.tar.gz
spm-a1807d94008cc932533dd7fff0f78bc8a27fdc66.tar.bz2
spm-a1807d94008cc932533dd7fff0f78bc8a27fdc66.tar.xz
spm-a1807d94008cc932533dd7fff0f78bc8a27fdc66.zip
Replace in packages package_use function to ENV_* variables.
Impliment default package_use function for use ENV_* variables.
-rwxr-xr-xpackages/SDL.sh12
-rwxr-xr-xpackages/SDL_gfx.sh8
-rwxr-xr-xpackages/SDL_image.sh8
-rwxr-xr-xpackages/SDL_mixer.sh8
-rwxr-xr-xpackages/SDL_net.sh8
-rwxr-xr-xpackages/SDL_ttf.sh8
-rwxr-xr-xpackages/cmake.sh6
-rwxr-xr-xpackages/cppcheck.sh7
-rwxr-xr-xpackages/curl.sh14
-rwxr-xr-xpackages/libpng.sh14
-rwxr-xr-xpackages/libxml2.sh14
-rwxr-xr-xpackages/manaplus.sh8
-rwxr-xr-xpackages/physfs.sh12
-rwxr-xr-xpackages/qemu.sh8
-rwxr-xr-xpackages/virglrenderer.sh12
-rwxr-xr-xpackages/zlib.sh13
-rw-r--r--scripts/include/common.sh53
17 files changed, 94 insertions, 119 deletions
diff --git a/packages/SDL.sh b/packages/SDL.sh
index 256fa5b..f1da105 100755
--- a/packages/SDL.sh
+++ b/packages/SDL.sh
@@ -3,6 +3,11 @@
SRCTYPE=hg
SRCURL=http://hg.libsdl.org/SDL/
+ENV_PATH="bin"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+ENV_MANPATH="share/man"
+
function package_build {
run_switch_branch SDL-1.2
run_src_script ./autogen.sh
@@ -16,10 +21,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_path "bin"
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
- env_man "share/man"
-}
diff --git a/packages/SDL_gfx.sh b/packages/SDL_gfx.sh
index 9a9fb0b..2cdfbb3 100755
--- a/packages/SDL_gfx.sh
+++ b/packages/SDL_gfx.sh
@@ -2,6 +2,9 @@
SRCURL=https://github.com/ferzkopp/SDL_gfx.git
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+
function package_build {
run_switch_branch master
run_src_script ./autogen.sh
@@ -10,8 +13,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
-}
diff --git a/packages/SDL_image.sh b/packages/SDL_image.sh
index f44089d..1fd81d0 100755
--- a/packages/SDL_image.sh
+++ b/packages/SDL_image.sh
@@ -3,6 +3,9 @@
SRCTYPE=hg
SRCURL=http://hg.libsdl.org/SDL_image/
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+
function package_build {
run_switch_branch SDL-1.2
run_src_script ./autogen.sh
@@ -11,8 +14,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
-}
diff --git a/packages/SDL_mixer.sh b/packages/SDL_mixer.sh
index e83ba0b..e49c7cf 100755
--- a/packages/SDL_mixer.sh
+++ b/packages/SDL_mixer.sh
@@ -3,6 +3,9 @@
SRCTYPE=hg
SRCURL=http://hg.libsdl.org/SDL_mixer/
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+
function package_build {
run_switch_branch SDL-1.2
run_src_script ./autogen.sh
@@ -12,8 +15,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
-}
diff --git a/packages/SDL_net.sh b/packages/SDL_net.sh
index 9fd3357..a535f8c 100755
--- a/packages/SDL_net.sh
+++ b/packages/SDL_net.sh
@@ -3,6 +3,9 @@
SRCTYPE=hg
SRCURL=http://hg.libsdl.org/SDL_net/
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+
function package_build {
run_switch_branch SDL-1.2
run_src_script ./autogen.sh
@@ -11,8 +14,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
-}
diff --git a/packages/SDL_ttf.sh b/packages/SDL_ttf.sh
index 17e145b..42c881c 100755
--- a/packages/SDL_ttf.sh
+++ b/packages/SDL_ttf.sh
@@ -3,6 +3,9 @@
SRCTYPE=hg
SRCURL=http://hg.libsdl.org/SDL_ttf/
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+
function package_build {
run_switch_branch SDL-1.2
run_src_script ./autogen.sh
@@ -11,8 +14,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
-}
diff --git a/packages/cmake.sh b/packages/cmake.sh
index 44c6f3c..f94b528 100755
--- a/packages/cmake.sh
+++ b/packages/cmake.sh
@@ -2,6 +2,8 @@
SRCURL=git://cmake.org/cmake.git
+ENV_PATH="bin"
+
function package_build {
run_switch_branch master
run_cmake
@@ -9,7 +11,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_path "bin"
-}
diff --git a/packages/cppcheck.sh b/packages/cppcheck.sh
index 22de440..5087c95 100755
--- a/packages/cppcheck.sh
+++ b/packages/cppcheck.sh
@@ -2,6 +2,8 @@
SRCURL=https://github.com/danmar/cppcheck.git
+ENV_PATH="bin:share/CppCheck"
+
function package_build {
run_switch_branch master
@@ -10,8 +12,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_path "bin"
- env_path "share/CppCheck"
-}
diff --git a/packages/curl.sh b/packages/curl.sh
index e92d673..6e3496c 100755
--- a/packages/curl.sh
+++ b/packages/curl.sh
@@ -2,6 +2,11 @@
SRCURL=https://github.com/curl/curl.git
+ENV_PATH="bin:lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+ENV_MANPATH="share/man"
+
function package_build {
run_switch_branch master
@@ -14,12 +19,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_path "bin"
- env_path "lib"
- env_path "include"
- env_man "share/man"
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
-}
diff --git a/packages/libpng.sh b/packages/libpng.sh
index ede0e17..bdeff84 100755
--- a/packages/libpng.sh
+++ b/packages/libpng.sh
@@ -2,6 +2,11 @@
SRCURL=git://git.code.sf.net/p/libpng/code
+ENV_PATH="bin:lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+ENV_MANPATH="share/man"
+
function package_build {
run_switch_branch master
@@ -11,12 +16,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_path "bin"
- env_path "lib"
- env_path "include"
- env_man "share/man"
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
-}
diff --git a/packages/libxml2.sh b/packages/libxml2.sh
index 7393475..84cb391 100755
--- a/packages/libxml2.sh
+++ b/packages/libxml2.sh
@@ -2,6 +2,11 @@
SRCURL=git://git.gnome.org/libxml2
+ENV_PATH="bin:lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+ENV_MANPATH="share/man"
+
function package_build {
run_switch_branch master
@@ -11,12 +16,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_path "bin"
- env_path "lib"
- env_path "include"
- env_man "share/man"
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
-}
diff --git a/packages/manaplus.sh b/packages/manaplus.sh
index 414346a..f191af5 100755
--- a/packages/manaplus.sh
+++ b/packages/manaplus.sh
@@ -2,6 +2,9 @@
SRCURL=https://gitlab.com/manaplus/manaplus.git
+ENV_PATH="bin"
+ENV_MANPATH="share/man"
+
function package_build {
run_switch_branch master
@@ -11,8 +14,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_path "bin"
- env_man "share/man"
-}
diff --git a/packages/physfs.sh b/packages/physfs.sh
index 8d9d43b..dacdbd6 100755
--- a/packages/physfs.sh
+++ b/packages/physfs.sh
@@ -3,6 +3,10 @@
SRCTYPE=hg
SRCURL=https://hg.icculus.org/icculus/physfs/
+ENV_PATH="bin:lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+
function package_build {
run_switch_branch stable-2.0
run_cmake
@@ -10,11 +14,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_path "bin"
- env_path "lib"
- env_path "include"
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
-}
diff --git a/packages/qemu.sh b/packages/qemu.sh
index 27dff3e..d8369b5 100755
--- a/packages/qemu.sh
+++ b/packages/qemu.sh
@@ -2,6 +2,9 @@
SRCURL=git://git.qemu-project.org/qemu.git
+ENV_PATH="bin"
+ENV_MANPATH="share/man"
+
function package_build {
run_switch_branch master
run_configure \
@@ -21,8 +24,3 @@ function package_build {
#function package_deps {
# run_add_dep virglrenderer
#}
-
-function package_use {
- env_bin "bin"
- env_man "share/man"
-}
diff --git a/packages/virglrenderer.sh b/packages/virglrenderer.sh
index c3e5654..fc91a33 100755
--- a/packages/virglrenderer.sh
+++ b/packages/virglrenderer.sh
@@ -2,6 +2,11 @@
SRCURL=git://people.freedesktop.org/~airlied/virglrenderer
+ENV_PATH="bin"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+ENV_MANPATH="share/man"
+
function package_build {
run_switch_branch master
run_autoreconf -v --install
@@ -9,10 +14,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_path "bin"
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
- env_man "share/man"
-}
diff --git a/packages/zlib.sh b/packages/zlib.sh
index 4ccef04..8e25f37 100755
--- a/packages/zlib.sh
+++ b/packages/zlib.sh
@@ -2,6 +2,11 @@
SRCURL=https://github.com/madler/zlib.git
+ENV_PATH="bin:lib:include"
+ENV_LD_LIBRARY_PATH="lib"
+ENV_PKG_CONFIG_PATH="lib/pkgconfig"
+ENV_MANPATH="share/man"
+
function package_build {
run_switch_branch v1.2.11
run_configure
@@ -9,11 +14,3 @@ function package_build {
run_make
run_make_install
}
-
-function package_use {
- env_path "lib"
- env_path "include"
- env_man "share/man"
- env_lib_library_path "lib"
- env_pkg_config_path "lib/pkgconfig"
-}
diff --git a/scripts/include/common.sh b/scripts/include/common.sh
index 78f046b..2afe31c 100644
--- a/scripts/include/common.sh
+++ b/scripts/include/common.sh
@@ -71,22 +71,6 @@ function common_run_package {
check_error $?
}
-function common_use_package {
- cd "${scriptsdir}"
- check_error $?
- export envfile="../env/run${envname}.sh"
- echo "#!/bin/bash" >"${envfile}"
- check_error $?
- echo "" >>"${envfile}"
- echo "package_use"
- package_use
- check_error $?
- echo "\$*" >>"${envfile}"
- check_error $?
- chmod 0755 "${envfile}"
- check_error $?
-}
-
function env_path {
echo "export PATH=${bindir}/$1:\$PATH" >>"${envfile}"
check_error $?
@@ -216,9 +200,42 @@ function run_switch_branch {
fi
}
+function repack_paths {
+ if [[ "$1" == "" ]]; then
+ return
+ fi
+ IFS=":"
+ packedpaths=""
+ for var in $1
+ do
+ packedpaths="${packedpaths}${bindir}/$var:"
+ done
+ unset IFS
+ echo "export $2=${packedpaths}\$$2" >>"${envfile}"
+ check_error $?
+}
+
function package_use {
- env_path "bin"
- env_lib_library_path "lib"
+ 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"
+}
+
+function common_use_package {
+ cd "${scriptsdir}"
+ check_error $?
+ export envfile="../env/run${envname}.sh"
+ echo "#!/bin/bash" >"${envfile}"
+ check_error $?
+ echo "" >>"${envfile}"
+ echo "package_use"
+ package_use
+ check_error $?
+ echo "\$*" >>"${envfile}"
+ check_error $?
+ chmod 0755 "${envfile}"
+ check_error $?
}
function package_get_source {