aboutsummaryrefslogtreecommitdiff
path: root/Build/lib/pre
diff options
context:
space:
mode:
authorDeposite Pirate2018-09-16 18:48:36 +0200
committerDeposite Pirate2018-09-16 18:48:36 +0200
commitd150a5f3e462fa7fe194a805a4aa0076f4d03ab9 (patch)
treece5e44d69c5f3175bfdbd1e3717b52c5dcca5638 /Build/lib/pre
parentf29d3519ce073ec30f99754d93304324f7f26d65 (diff)
Add ports.
Diffstat (limited to 'Build/lib/pre')
-rwxr-xr-xBuild/lib/pre/10-download.sh60
-rw-r--r--Build/lib/pre/20-check.sh28
-rwxr-xr-xBuild/lib/pre/30-unpack.sh60
-rwxr-xr-xBuild/lib/pre/40-patch.sh39
-rwxr-xr-xBuild/lib/pre/50-build.sh46
-rwxr-xr-xBuild/lib/pre/60-docs.sh48
6 files changed, 281 insertions, 0 deletions
diff --git a/Build/lib/pre/10-download.sh b/Build/lib/pre/10-download.sh
new file mode 100755
index 0000000..17c02c6
--- /dev/null
+++ b/Build/lib/pre/10-download.sh
@@ -0,0 +1,60 @@
+# Copyright (c) 2012, Deposite Pirate
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the copyright holder nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+SRCPKG="${SRCPACK[${source}]##*/}"
+SRCURL="${SRCPACK[${source}]%/*}"
+SRCSCH="${SRCPACK[${source}]%://*}"
+
+debug "SRCPKG=${SRCPKG}"
+debug "SRCURL=${SRCURL}"
+debug "SRCSCH=${SRCSCH}"
+
+if [ ! -e "${SRCPKG}" ]; then
+ if [[ "${SRCURL}" ]]; then
+ info "Downloading ${SRCPACK[${source}]}"
+ case "${SRCSCH}" in
+ 'git')
+ pushd "${BUILD[dir]}" >/dev/null
+ src.download.git ${SRCPACK[${source}]}
+ checkstatus ${?}
+ popd >/dev/null
+ SRCROOT[${source}]="${SRCPKG%*.git}"
+ SRCOPTS[${source}]="${SRCOPTS[${source}]} nounpack"
+ ;;
+ *)
+ src.download ${SRCPACK[${source}]}
+ # Throw a newline because curl doesn't
+ echo
+ # Since curl returns 0 even when it failed to download something, then
+ # just check if we can find the source.
+ if [ ! -e "${SRCPKG}" ]; then
+ abort "No source"
+ fi
+ ;;
+ esac
+ else
+ abort "No source"
+ fi
+fi
diff --git a/Build/lib/pre/20-check.sh b/Build/lib/pre/20-check.sh
new file mode 100644
index 0000000..494deea
--- /dev/null
+++ b/Build/lib/pre/20-check.sh
@@ -0,0 +1,28 @@
+# Copyright (c) 2012, Deposite Pirate
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the copyright holder nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#if [[ ! SRCCKSM[${source}] == $(src.checksum ${SRC}) ]]; then
+# warning "Checksum does not match"
+#fi
diff --git a/Build/lib/pre/30-unpack.sh b/Build/lib/pre/30-unpack.sh
new file mode 100755
index 0000000..edb11ae
--- /dev/null
+++ b/Build/lib/pre/30-unpack.sh
@@ -0,0 +1,60 @@
+# Copyright (c) 2012, Deposite Pirate
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the copyright holder nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+if [[ ! "${SRCROOT[${source}]}" ]]; then
+ if [[ "${SRCOPTS[${source}]}" == *pkgunpack* ]]; then
+ debug "PKG=${PKG}"
+ SRC="${PKG}"
+ else
+ SRC="${BUILD[dir]}/${SRCNAME[${source}]}-${SRCVERS[${source}]}"
+ fi
+else
+ SRC="${BUILD[dir]}/${SRCROOT[${source}]}"
+fi
+
+debug "SRC=${SRC}"
+
+if [[ "${SRCOPTS[${source}]}" == *nosrcroot* ]]; then
+ dir.make "${SRC}"
+ pushd "${SRC}" >/dev/null
+else
+ if [[ "${SRCOPTS[${source}]}" == *pkgunpack* ]]; then
+ pushd "${SRC}" >/dev/null
+ else
+ if [[ ! "${SRCOPTS[${source}]}" == *skipsrcroot* ]]; then
+ pushd "${BUILD[dir]}" >/dev/null
+ fi
+ fi
+fi
+
+if [[ ! "${SRCOPTS[${source}]}" == *nounpack* ]]; then
+ info "Unpacking ${SRCPKG} in ${SRC}"
+ src.unpack ${CWD}/${SRCPKG}
+ checkstatus ${?}
+fi
+
+if [[ ! "${SRCOPTS[${source}]}" == *skipsrcroot* ]]; then
+ popd >/dev/null
+fi
diff --git a/Build/lib/pre/40-patch.sh b/Build/lib/pre/40-patch.sh
new file mode 100755
index 0000000..fde64f3
--- /dev/null
+++ b/Build/lib/pre/40-patch.sh
@@ -0,0 +1,39 @@
+# Copyright (c) 2012, Deposite Pirate
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the copyright holder nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+if [[ ! "${SRCOPTS[${source}]}" == *skipsrcroot* ]]; then
+
+QUERY=$(find ${CWD} -name ${SRCNAME[${source}]}-${SRCVERS[${source}]}-\*.patch.xz -maxdepth 1 | sort)
+
+pushd "${SRC}" >/dev/null
+
+for patch in ${QUERY}; do
+ info "Applying ${patch##*/} to ${SRCNAME[${source}]}-${SRCVERS[${source}]}"
+ unz.patch "${patch}" | src.patch
+done
+
+popd >/dev/null
+
+fi
diff --git a/Build/lib/pre/50-build.sh b/Build/lib/pre/50-build.sh
new file mode 100755
index 0000000..6b2fde9
--- /dev/null
+++ b/Build/lib/pre/50-build.sh
@@ -0,0 +1,46 @@
+# Copyright (c) 2012, Deposite Pirate
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the copyright holder nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+info "Building ${SRCNAME[${source}]}-${SRCVERS[${source}]}"
+
+# Create the documentation directory now so that we are able to install stuff
+# into it.
+if [[ ! "${SRCOPTS[${source}]}" == *shareddoc* ]]; then
+ SRCDOCDIR[${source}]="${PKG}/${SYS_DIR[doc]}/${SRCNAME[${source}],,}-${SRCVERS[${source}]}"
+else
+ SRCDOCDIR[${source}]="${PKG}/${SYS_DIR[doc]}/${NAME}-${VERSION}"
+fi
+DOC="${SRCDOCDIR[${source}]}"
+
+if [[ ! "${SRCOPTS[${source}]}" == *skipsrcroot* ]]; then
+ pushd "${SRC}" >/dev/null
+fi
+
+#build${source} &>> "${BUILD[log]}"
+
+build${source}
+
+if [[ ! "${SRCOPTS[${source}]}" == *skipsrcroot* ]]; then
+ popd >/dev/null
+fi
diff --git a/Build/lib/pre/60-docs.sh b/Build/lib/pre/60-docs.sh
new file mode 100755
index 0000000..ec26db0
--- /dev/null
+++ b/Build/lib/pre/60-docs.sh
@@ -0,0 +1,48 @@
+# Copyright (c) 2012, Deposite Pirate
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the copyright holder nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+if [[ "${SRCCOPY[${source}]}" ]]; then
+ info "Adding license information"
+ dir.make "${SRCDOCDIR[${source}]}"
+ pushd "${SRCDOCDIR[${source}]}" 2>/dev/null
+ for license in ${SRCCOPY[${source}]}; do
+ link -v "${SYS_DIR[license]}/${license}.xz" "COPYING.${license}.xz"
+ done
+ popd 2>/dev/null
+fi
+
+if [[ ! "${SRCOPTS[${source}]}" == *nodocz* ]]; then
+ if [ -d "${SRCDOCDIR[${source}]}" ]; then
+ info "Compressing documentation"
+ for file in $(find "${SRCDOCDIR[${source}]}" -maxdepth 1 -size +10k); do
+ type="$(file -bi ${file})"
+ case "${type}" in
+ *"text/plain"*)
+ z.doc "${file}"
+ ;;
+ esac
+ done
+ fi
+fi