2017-02-22 13:10:19 +00:00
|
|
|
#!/usr/bin/env zsh
|
2020-11-13 11:46:39 +00:00
|
|
|
# shellcheck shell=bash
|
2020-12-23 08:21:17 +00:00
|
|
|
# Copyright (c) 2016-2021 Ivan J. <parazyd@dyne.org>
|
2017-02-22 13:10:19 +00:00
|
|
|
# live-sdk is written and maintained by Ivan J. <parazyd@dyne.org>
|
|
|
|
#
|
|
|
|
# This file is part of live-sdk
|
|
|
|
#
|
|
|
|
# This source code is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This software is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this source code. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
livesdk_version="1.0"
|
2017-02-22 13:10:19 +00:00
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
R="${LIVE_SDK-$PWD}"
|
2017-02-22 13:10:19 +00:00
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
source "$R/lib/zuper/zuper"
|
2017-02-22 13:10:19 +00:00
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
# Global vars
|
2017-02-22 13:10:19 +00:00
|
|
|
vars+=(livesdk_version)
|
|
|
|
vars+=(R workdir strapdir)
|
|
|
|
vars+=(os oslib blendlib)
|
2017-12-12 00:08:19 +00:00
|
|
|
vars+=(release)
|
2017-02-22 13:10:19 +00:00
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
# Global arrs
|
2017-02-22 13:10:19 +00:00
|
|
|
arrs+=(extra_packages)
|
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
# Global maps
|
2017-02-22 13:10:19 +00:00
|
|
|
maps+=(os_map blend_map)
|
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
source "$R/config"
|
2017-02-22 13:10:19 +00:00
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
# Conclude zuper initialization
|
|
|
|
source "$R/lib/zuper/zuper.init"
|
2017-02-22 13:10:19 +00:00
|
|
|
|
|
|
|
load() {
|
|
|
|
fn load "$@"
|
|
|
|
os="$1"
|
2020-11-13 11:46:39 +00:00
|
|
|
blend="$2"
|
2017-12-12 00:08:19 +00:00
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
[[ $# -gt 2 ]] && release="$3"
|
2017-12-12 00:08:19 +00:00
|
|
|
|
2021-11-22 12:59:25 +00:00
|
|
|
req=(os)
|
2017-02-22 13:10:19 +00:00
|
|
|
ckreq || return 1
|
|
|
|
|
|
|
|
os_map=(
|
2022-12-06 02:06:38 +00:00
|
|
|
"delphinium" "$R/lib/libdevuansdk/libdevuansdk"
|
2017-02-22 13:10:19 +00:00
|
|
|
)
|
|
|
|
|
2017-03-25 22:18:45 +00:00
|
|
|
blend_map=(
|
2022-12-06 02:06:38 +00:00
|
|
|
"delphinium-desktop-live" "$R/blends/devuan-desktop-live/devuan-desktop-live.blend"
|
|
|
|
"delphinium-minimal-live" "$R/blends/devuan-minimal-live/devuan-minimal-live.blend"
|
2017-03-25 22:18:45 +00:00
|
|
|
"heads" "$R/../heads.blend"
|
2017-09-18 15:10:54 +00:00
|
|
|
"decode" "$R/../decode.blend"
|
2017-03-25 22:18:45 +00:00
|
|
|
)
|
|
|
|
|
2017-02-22 13:10:19 +00:00
|
|
|
oslib="${os_map[$os]}"
|
2020-11-13 11:46:39 +00:00
|
|
|
[[ -f "$oslib" ]] || { die "No valid distro specified"; return 1; }
|
|
|
|
source "$oslib"
|
2017-02-22 13:10:19 +00:00
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
blendlib="${blend_map[$blend]}"
|
2017-02-22 13:10:19 +00:00
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
[[ -f "$blendlib" ]] || act "No blend specified"
|
|
|
|
[[ -f "$blendlib" ]] && {
|
|
|
|
source "$blendlib" || { zerr; return 1; }
|
|
|
|
act "$(basename "$blend") blend loaded"
|
2017-03-18 20:33:18 +00:00
|
|
|
export BLEND=1
|
|
|
|
}
|
2017-02-22 13:10:19 +00:00
|
|
|
|
|
|
|
workdir="$R/tmp/${os}-${arch}-build"
|
|
|
|
strapdir="$workdir/bootstrap"
|
2020-11-13 11:46:39 +00:00
|
|
|
mkdir -p "$strapdir"
|
2017-02-22 13:10:19 +00:00
|
|
|
|
|
|
|
export LANG=C
|
|
|
|
export LC_ALL=C
|
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
source "$R/lib/zuper/zuper.init"
|
2017-02-22 13:10:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TRAPZERR() { zerr; return $? }
|
|
|
|
|
2020-11-13 11:46:39 +00:00
|
|
|
notice "live-sdk $livesdk_version loaded"
|
2017-02-22 13:10:19 +00:00
|
|
|
export PROMPT="%F{yellow}%(?..%? )%{$reset_color%}livesdk@%{$fg[red]%}%m %{$reset_color%} %{$fg[blue]%}%#%{$fg_bold[blue]%}%{$reset_color%} "
|