Compare commits

...

4 Commits

Author SHA1 Message Date
fosslinux 5e768d3752
Merge pull request #197 from doraskayo/avoid-variable-export
Avoid exporting variables in build scripts
2023-01-28 08:37:12 +11:00
Dor Askayo 3921660396 Avoid exporting variables in build scripts
Environment variables "pollute" the build environment of packages and
can affect their output.

This change results in the removal of some files from packages that
were not meant to be packaged. It also removes the need for a
workaround in automake 1.10.3 to manually remove such files.

Variables are now saved in an .env file for each system and included
in scripts that need them using the dot operation.
2023-01-27 22:19:52 +02:00
Andrius Štikonas a35196a5e4 Build python 3.11 statically. 2023-01-27 19:10:48 +00:00
Dor Askayo a74f3166f3 Pass variables to make explicitly in musl-1.1.24 2023-01-27 10:17:04 +02:00
12 changed files with 234 additions and 29 deletions

View File

@ -53,7 +53,7 @@ f55c11b091361536774b436abe86b17f759cd7a66522cd20c7a2190da92db67a findutils-4.2.
07715a0c8bc13b80fc10ede20573f92e933b8d3dc6a5c8700f4289965ea8ec74 gcc-4.0.4_0.tar.bz2
e7c678c71c51cd6e8ce6eae029503a661169e6994ba0f988ac15634254d1fadb gcc-4.0.4_1.tar.bz2
b90cf37e7d0391dba6b1943c7527b0d5f5f9c7e399070828af6f1c39a1323883 gcc-4.7.4_0.tar.bz2
9a299c3669367165bf1c661486bdb42297e0c4c1fc572d346b6c9e6ae186390c gettext-0.21_0.tar.bz2
6e468a87e3bb80b4756bc6925127c230ab0c526c6d353c4fbf123244fa93435e gettext-0.21_0.tar.bz2
fe16fb6021f1f4650c98f77261145f37732be0aee06e957b0bdb3b01beb593a8 gmp-6.2.1_0.tar.bz2
3fd7b8e71183060864420479bd36a6853119c4eae5568672838cae23b7dc1050 gperf-3.1_0.tar.bz2
390840f2bc9c2a3196c28e06f8650f408e33b5d4ffe5539e174682ed13960bc9 grep-2.4_0.tar.bz2
@ -101,7 +101,7 @@ faa100ea90445983531e90e5e570ad4f559aca4165cfee6caa0ab9036a065bfb python-3.1.5_1
f297082aeecba9e539c4ea22ac0d10e9b73950d54f4f5d394e7227ea960a577c python-3.3.7_0.tar.bz2
d9c26b6764735a21dc9cea68044e3f5f386ac70712a735ff8f497169e16e713f python-3.4.10_0.tar.bz2
68c701e8a33413843b19aba94da4c3f45618f86787ea9ccac608092b3bb0cb32 python-3.8.16_0.tar.bz2
bcc0ba8f0dfec71daf523b65e1d8d587f2446b43ed0b7bb355df877b988d68ba python-3.11.1_0.tar.bz2
e4baae4350c5ccc54717e77c10a3a2ee9cc6c626bd4d3751c0b5cacf0a9cace0 python-3.11.1_0.tar.bz2
8a0248fbf8fe1764580698415cc3628585d4dd054ddf63040f400e18cbaef7a4 sed-4.0.9_0.tar.bz2
177553732a080e25ba5778525743543e9da012122f4ad0d314a425ca87a3c2bd sed-4.8_0.tar.bz2
f3be04bb46c9ac80180defa46c274214ab00b5b4dd9c8a3a6de162e43ef0fa20 tar-1.34_0.tar.bz2

View File

@ -24,7 +24,4 @@ src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
rm "${DESTDIR}${PREFIX}/share/doc/automake/amhello-1.0.tar.gz"
rm "${DESTDIR}/usr/bin/automake" "${DESTDIR}/usr/bin/aclocal"
# Delete some stray directories
rm -r "${DESTDIR}${SOURCES}"
}

View File

@ -24,10 +24,10 @@ src_configure() {
}
src_compile() {
make CROSS_COMPILE= CFLAGS="-DSYSCALL_NO_TLS" AS_CMD='as -o $@ $<'
make PREFIX="${PREFIX}" CROSS_COMPILE= CFLAGS="-DSYSCALL_NO_TLS" AS_CMD='as -o $@ $<'
}
src_install() {
rm -rf "${PREFIX}/include"
make install
make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install
}

View File

@ -9,13 +9,13 @@
set -e
# shellcheck disable=SC2154
export PREFIX="${prefix}"
PREFIX="${prefix}"
# shellcheck disable=SC2154
export SOURCES="${sysa}"
export DISTFILES="${sysa}/distfiles"
export DESTDIR=/tmp/destdir
SOURCES="${sysa}"
DISTFILES="${sysa}/distfiles"
DESTDIR=/tmp/destdir
# shellcheck disable=SC2154
export SRCDIR="${srcdir}"
SRCDIR="${srcdir}"
# shellcheck source=sysa/helpers.sh
. helpers.sh

View File

@ -7,9 +7,10 @@
set -e
export PATH=/usr/bin
export PREFIX=/usr
export SOURCES=/usr/src
PREFIX=/usr
SOURCES="${PREFIX}/src"
export PATH="${PREFIX}/bin"
# shellcheck source=sysa/helpers.sh
. /usr/src/helpers.sh
@ -34,5 +35,10 @@ install_tar kexec-tools-2.0.22 0
install_tar util-linux-2.19.1 0
# Begin sysb bootstrapping process
cd /usr/src
./run.sh
cd "${SOURCES}"
# shellcheck disable=SC2129
echo "PREFIX=${PREFIX}" >> .env
echo "SOURCES=${SOURCES}" >> .env
exec ./run.sh

View File

@ -6,6 +6,9 @@
set -e
# shellcheck source=/dev/null
. .env
# shellcheck source=sysa/helpers.sh
. helpers.sh
@ -74,8 +77,6 @@ if [ $(($(ls -l "/dev/${DISK}" | sed "s/.*, *//" | sed "s/ .*//") % 8)) -eq 0 ];
fi
echo "export DISK=${DISK}" >> /usr/src/bootstrap.cfg
PREFIX=/usr
SOURCES="${PREFIX}/src"
SYSC=/sysc
# Otherwise, add stuff from sysa to sysb

View File

@ -5,4 +5,6 @@
# Replace this hook if you wish to do more
. /usr/src/.env
exec env - PATH="${PREFIX}/bin" PS1="\w # " bash -i

View File

@ -7,12 +7,13 @@
set -e
export PATH=/usr/bin:/usr/sbin
export PREFIX=/usr
export SOURCES=/usr/src
export DESTDIR=/tmp/destdir
export DISTFILES=/distfiles
export SRCDIR="${SOURCES}"
PREFIX=/usr
SOURCES="${PREFIX}/src"
DESTDIR=/tmp/destdir
DISTFILES=/distfiles
SRCDIR="${SOURCES}"
export PATH="${PREFIX}/bin:${PREFIX}/sbin"
export HOME=/tmp
export SOURCE_DATE_EPOCH=0
@ -61,4 +62,12 @@ ln -s /usr/bin/bash /usr/bin/sh
# Begin sysc bootstrapping process
cd "${SOURCES}"
# shellcheck disable=SC2129
echo "PREFIX=${PREFIX}" >> .env
echo "SOURCES=${SOURCES}" >> .env
echo "DESTDIR=${DESTDIR}" >> .env
echo "DISTFILES=${DISTFILES}" >> .env
echo "SRCDIR=${SRCDIR}" >> .env
exec ./run.sh

View File

@ -0,0 +1,179 @@
# SPDX-FileCopyrightText: 2023 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-License-Identifier: PSF-2.0
# Based on Modules/Setup file
*static*
# Modules that should always be present (POSIX and Windows):
_asyncio _asynciomodule.c
_bisect _bisectmodule.c
_contextvars _contextvarsmodule.c
_csv _csv.c
_datetime _datetimemodule.c
_decimal _decimal/_decimal.c
_heapq _heapqmodule.c
_json _json.c
_lsprof _lsprof.c rotatingtree.c
_multiprocessing -I$(srcdir)/Modules/_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c
_opcode _opcode.c
_pickle _pickle.c
_queue _queuemodule.c
_random _randommodule.c
_socket socketmodule.c
_statistics _statisticsmodule.c
_struct _struct.c
_typing _typingmodule.c
_zoneinfo _zoneinfo.c
array arraymodule.c
audioop audioop.c
binascii binascii.c
cmath cmathmodule.c
math mathmodule.c
mmap mmapmodule.c
select selectmodule.c
# XML
_elementtree _elementtree.c
pyexpat pyexpat.c
# hashing builtins
_blake2 _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c
_md5 md5module.c
_sha1 sha1module.c
_sha256 sha256module.c
_sha512 sha512module.c
_sha3 _sha3/sha3module.c
# text encodings and unicode
_codecs_cn cjkcodecs/_codecs_cn.c
_codecs_hk cjkcodecs/_codecs_hk.c
_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
_codecs_jp cjkcodecs/_codecs_jp.c
_codecs_kr cjkcodecs/_codecs_kr.c
_codecs_tw cjkcodecs/_codecs_tw.c
_multibytecodec cjkcodecs/multibytecodec.c
unicodedata unicodedata.c
# Modules with some UNIX dependencies
_posixsubprocess _posixsubprocess.c
_posixshmem -I$(srcdir)/Modules/_multiprocessing _multiprocessing/posixshmem.c -lrt
fcntl fcntlmodule.c
grp grpmodule.c
ossaudiodev ossaudiodev.c
resource resource.c
spwd spwdmodule.c
syslog syslogmodule.c
termios termios.c
# Modules with UNIX dependencies that require external libraries
#_crypt _cryptmodule.c -lcrypt
#nis nismodule.c -I/usr/include/tirpc -lnsl -ltirpc
# Modules that require external libraries.
#_bz2 _bz2module.c -lbz2
#_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c -ldl -lffi -DHAVE_FFI_PREP_CIF_VAR -DHAVE_FFI_PREP_CLOSURE_LOC -DHAVE_FFI_CLOSURE_ALLOC
# The _dbm module supports NDBM, GDBM with compat module, and Berkeley DB.
#_dbm _dbmmodule.c -lgdbm_compat -DUSE_GDBM_COMPAT
#_gdbm _gdbmmodule.c -lgdbm
_lzma _lzmamodule.c -llzma
#_uuid _uuidmodule.c -luuid
zlib zlibmodule.c -lz
# The readline module also supports libeditline (-leditline).
# Some systems may require -ltermcap or -ltermlib.
#readline readline.c -lreadline -ltermcap
# OpenSSL bindings
#_ssl _ssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS)
#_hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) -lcrypto
# To statically link OpenSSL:
_ssl _ssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \
-l:libssl.a -Wl,--exclude-libs,libssl.a \
-l:libcrypto.a -Wl,--exclude-libs,libcrypto.a
_hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \
-l:libcrypto.a -Wl,--exclude-libs,libcrypto.a
# The _tkinter module.
#
# The command for _tkinter is long and site specific. Please
# uncomment and/or edit those parts as indicated. If you don't have a
# specific extension (e.g. Tix or BLT), leave the corresponding line
# commented out. (Leave the trailing backslashes in! If you
# experience strange errors, you may want to join all uncommented
# lines and remove the backslashes -- the backslash interpretation is
# done by the shell's "read" command and it may not be implemented on
# every system.
# *** Always uncomment this (leave the leading underscore in!):
#_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT $(TCLTK_INCLUDES) $(TCLTK_LIBS) \
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
# -I/usr/local/include \
# *** Uncomment and edit to reflect where your X11 header files are:
# -I/usr/X11R6/include \
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
# -DWITH_TIX -ltix8.1.8.2 \
# *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
# (See http://www.pythonware.com/products/pil/ for more info)
# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
# -L/usr/openwin/lib \
# *** Uncomment these for TOGL extension only:
# -lGL -lGLU -lXext -lXmu \
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
# -lX11
# Some system have -lcurses
#_curses -lncurses -lncursesw -ltermcap _cursesmodule.c
#_curses_panel -lpanel -lncurses _curses_panel.c
# macOS specific module, needs SystemConfiguration and CoreFoundation framework
# _scproxy _scproxy.c
# Examples
#xx xxmodule.c
#xxlimited xxlimited.c
#xxlimited_35 xxlimited_35.c
xxsubtype xxsubtype.c # Required for the test suite to pass!
# Testing
#_xxsubinterpreters _xxsubinterpretersmodule.c
#_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c
#_testbuffer _testbuffer.c
#_testinternalcapi _testinternalcapi.c
# Some testing modules MUST be built as shared libraries.
#*shared*
#_ctypes_test _ctypes/_ctypes_test.c
#_testcapi _testcapimodule.c
#_testimportmultiple _testimportmultiple.c
#_testmultiphase _testmultiphase.c
# ---
# Uncommenting the following line tells makesetup that all following modules
# are not built (see above for more detail).
#
#*disabled*
#
# _sqlite3 _tkinter _curses pyexpat
# _codecs_jp _codecs_kr _codecs_tw unicodedata

View File

@ -12,6 +12,8 @@ src_prepare() {
# Regenerate ssl_data for ssl module
rm Modules/_ssl_data_300.h Modules/_ssl_data.h
python Tools/ssl/make_ssl_data.py ../openssl-1.1.1l Modules/_ssl_data_111.h
sed -i 's#$(srcdir)/Modules/_ssl_data.h ##' Makefile.pre.in
sed -i 's#$(srcdir)/Modules/_ssl_data_300.h ##' Makefile.pre.in
# Regenerate encodings
grep generated -r . -l | grep encodings | xargs rm
@ -48,15 +50,18 @@ src_prepare() {
}
src_configure() {
mv Setup.local Modules
MACHDEP=linux ac_sys_system=Linux \
CPPFLAGS="-U__DATE__ -U__TIME__" \
LDFLAGS="-L/usr/lib/musl" \
PKG_CONFIG_PATH="${PREFIX}/lib/musl/pkgconfig/" \
LDFLAGS="-static" \
./configure \
--build=i386-unknown-linux-musl \
--host=i386-unknown-linux-musl \
--prefix="${PREFIX}" \
--libdir="${PREFIX}/lib/musl" \
--with-system-ffi
--with-system-ffi \
--disable-shared
}
src_compile() {

View File

@ -8,6 +8,9 @@
set -e
# shellcheck source=/dev/null
. .env
# shellcheck source=sysa/helpers.sh
. helpers.sh
@ -55,4 +58,4 @@ fi
build bash-5.1
exec env -i PATH="${PATH}" PREFIX="${PREFIX}" SOURCES="${SOURCES}" DESTDIR="${DESTDIR}" DISTFILES="${DISTFILES}" SRCDIR="${SRCDIR}" HOME="${HOME}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" bash run2.sh
exec env -i PATH="${PATH}" HOME="${HOME}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" bash run2.sh

View File

@ -9,6 +9,9 @@
set -e
# shellcheck source=/dev/null
. .env
# shellcheck disable=SC2153
trap 'env - PATH=${PREFIX}/bin PS1="\w # " bash -i' EXIT
@ -140,4 +143,4 @@ fi
echo "Bootstrapping completed."
cd "/"
exec env -i PATH="${PATH}" PREFIX="${PREFIX}" SOURCES="${SOURCES}" DESTDIR="${DESTDIR}" DISTFILES="${DISTFILES}" HOME="${HOME}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" bash "${SOURCES}/after.sh"
exec env -i PATH="${PATH}" HOME="${HOME}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" bash "${SOURCES}/after.sh"