commit c73cb69f06279207ab9cc1d8f4295cce42fb14ea Author: yafox Date: Wed Nov 25 06:15:40 2020 +0000 initial commit diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bd8c239 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2020 "yafox" + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..8652f89 --- /dev/null +++ b/README @@ -0,0 +1,5 @@ +# how-lix-os-default + +provides a set of default dependencies and configuration, build, and install +scripts for lix-os. meant to be checked out into the root directory of a "how" +installation as the "default" subdirectory. diff --git a/conf.sh b/conf.sh new file mode 100755 index 0000000..f676f1a --- /dev/null +++ b/conf.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +./configure \ + --disable-shared \ + --enable-static \ + --build="$BUILD" \ + --host="$HOST" \ + --prefix="$PREFIX" + +## explanation +# +# --disable-shared: don't build anything with dynamic linking. +# +# --enable-static: use static linking instead. +# +# --build: make sure the build string gets set correctly. +# +# --host: make sure the host string gets set correctly. +# +# --prefix: respect the "no /usr/local" policy. diff --git a/default-env.sh b/default-env.sh new file mode 100755 index 0000000..d7e6970 --- /dev/null +++ b/default-env.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# define some variables that will be useful to package scripts. +# for now, each of these can be overridden by pre-existing variables. +export CC="${CC:-gcc}" +export CXX="g++" + +export SHARED_LDFLAGS="${SHARED_LDFLAGS:--z now -z relro}" +export SHARED_CFLAGS="${SHARED_CFLAGS:--fPIC}" +export SHARED_CXXFLAGS="${SHARED_CXXFLAGS:--fPIC}" + +export STATIC_LDFLAGS="${STATIC_LDFLAGS:-$SHARED_LDFLAGS --static -static}" +export STATIC_CFLAGS="${STATIC_CFLAGS:-$SHARED_CFLAGS --static -static}" +export STATIC_CXXFLAGS="${STATIC_CXXFLAGS:-$SHARED_CXXFLAGS --static -static}" + +export LDFLAGS="${LDFLAGS:-$STATIC_LDFLAGS}" +export CFLAGS="${CFLAGS:-$STATIC_CFLAGS}" +export CXXFLAGS="${CXXFLAGS:-$STATIC_CXXFLAGS}" + +export ARCH="$(uname -m)" +export BUILD="$ARCH-lix-linux-musl" +export HOST="$ARCH-lix-linux-musl" +export PREFIX="/usr" # some packages need a prefix; "" doesn't work for them. + +if [ -e /etc/ssl/ca-bundle.crt ]; then + export SSL_CERT_FILE=/etc/ssl/ca-bundle.crt +fi + +if [ "$(which python3 2> /dev/null)" ]; then + export PY3VER="$(python3 -V | sed -n 's/^Python \(\w\+\.\w\+\).*/\1/p')" + export PY3PKGS="/lib/python$PY3VER/site-packages" + export PYTHONHOME="/usr:/usr" + export PYTHONPATH="/lib/python/$PY3VER:$PY3PKGS" +fi + +if [ "$(which pkgconf 2> /dev/null)" ]; then + export PKG_CONFIG="pkgconf" +fi + +# TODO: remove the need for these lines by making musl-cross-make build a gcc +# with a header search path of /include only, with all headers contained there. +export CPATH="${CPATH:-/include}" +export C_INCLUDE_PATH="/powerpc64le-lix-linux-musl/include" +export CPLUS_INCLUDE_PATH="/include/c++/9.2.0/powerpc64le-lix-linux-musl:/include/c++/9.2.0" +export LD_LIBRARY_PATH="/lib" +export LD_RUN_PATH="/lib" # sway won't build without this set diff --git a/deps b/deps new file mode 100644 index 0000000..930a016 --- /dev/null +++ b/deps @@ -0,0 +1,12 @@ +lix-os-filesystem +linux-kernel +musl-cross-make +patch +sbase +ubase +awk +make +dash +gnu-grep +gnu-sed +pkgconf diff --git a/env.sh b/env.sh new file mode 120000 index 0000000..77e415b --- /dev/null +++ b/env.sh @@ -0,0 +1 @@ +default-env.sh \ No newline at end of file diff --git a/inst.sh b/inst.sh new file mode 100755 index 0000000..16aafda --- /dev/null +++ b/inst.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +DESTDIR="$pkgdest" make install diff --git a/make.sh b/make.sh new file mode 100755 index 0000000..22f63a4 --- /dev/null +++ b/make.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +make -j$(nproc) diff --git a/no-op.sh b/no-op.sh new file mode 100755 index 0000000..35d6412 --- /dev/null +++ b/no-op.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "no-op: this step is not necessary for this package." diff --git a/patch.sh b/patch.sh new file mode 100755 index 0000000..433cc7e --- /dev/null +++ b/patch.sh @@ -0,0 +1,6 @@ +[ ! -f ../how/patch ] || patch -i ../how/patch -p1 -N + +[ ! -d ../how/patches-enabled ] || \ +{ ls ../how/patches-enabled | while read patchfile; do + patch -i ../how/patches-enabled/$patchfile -p1 -N +done; }