diff --git a/mk.sh b/mk.sh index 5946721..09e70a0 100755 --- a/mk.sh +++ b/mk.sh @@ -31,11 +31,11 @@ REPODIR="$BUILDROOT/repo" DEPENDSLIST="$BUILDROOT/depends" PROVIDESLIST="$BUILDROOT/provides" PREFERESLIST="$BUILDROOT/preferes" +SYSROOT="$BUILDROOT/sysroot" declare -A PREFERED_PROVIDER -mkdir -p "$PKGDOWNLOADDIR" "$PKGSRCDIR" "$PKGLOGDIR" -mkdir -p "$REPODIR" +mkdir -p "$PKGDOWNLOADDIR" "$PKGSRCDIR" "$PKGLOGDIR" "$REPODIR" "$SYSROOT" pushd "$SCRIPTDIR" > /dev/null OS_NAME="Pygos" @@ -98,9 +98,9 @@ cat "$PACKAGELIST" echo "--- building packages ---" -export PKG_CONFIG_SYSROOT_DIR="$TCDIR/$TARGET" -export PKG_CONFIG_LIBDIR="$TCDIR/$TARGET/lib/pkgconfig" -export PKG_CONFIG_PATH="$TCDIR/$TARGET/lib/pkgconfig" +export PKG_CONFIG_SYSROOT_DIR="$SYSROOT" +export PKG_CONFIG_LIBDIR="$SYSROOT/lib/pkgconfig" +export PKG_CONFIG_PATH="$SYSROOT/lib/pkgconfig" while read pkg; do include_pkg "$pkg" diff --git a/pkg/bbstatic/build b/pkg/bbstatic/build index 3c11b73..5575539 100755 --- a/pkg/bbstatic/build +++ b/pkg/bbstatic/build @@ -10,8 +10,6 @@ prepare() { } build() { - local SYSROOT="$TCDIR/$TARGET" - cp "$SCRIPTDIR/pkg/$PKGNAME/bbstatic.config" "$PKGBUILDDIR/.config" export KBUILD_OUTPUT="$PKGBUILDDIR" diff --git a/pkg/initrd/build b/pkg/initrd/build index a153175..2ce48db 100755 --- a/pkg/initrd/build +++ b/pkg/initrd/build @@ -7,7 +7,7 @@ build() { deploy() { cp $SCRIPTDIR/pkg/initrd/*.{desc,files} "$PKGDEPLOYDIR" - pkg install -R "$REPODIR" -r "$TCDIR/$TARGET" -l pkg $DEPENDS \ + pkg install -R "$REPODIR" -r "$SYSROOT" -l pkg $DEPENDS \ >> "$PKGDEPLOYDIR/initrd.files" echo "file init 0755 0 0 $SCRIPTDIR/pkg/$PKGNAME/initrd.skel" \ diff --git a/pkg/iproute2/build b/pkg/iproute2/build index 99d481f..b0b33c1 100755 --- a/pkg/iproute2/build +++ b/pkg/iproute2/build @@ -24,14 +24,14 @@ build() { make CCOPTS="-O2 $cflags" LDFLAGS="$ldflags" \ HOSTCC="gcc" AR="${TARGET}-ar" LD="${TARGET}-ld" \ CC="${TARGET}-gcc" PREFIX="" SBINDIR="/bin" \ - KERNEL_INCLUDE="$TCDIR/$TARGET/include" \ - DBM_INCLUDE="$TCDIR/$TARGET/include" + KERNEL_INCLUDE="$SYSROOT/include" \ + DBM_INCLUDE="$SYSROOT/include" } deploy() { make DESTDIR="$PKGDEPLOYDIR" PREFIX="" SBINDIR="/bin" \ - KERNEL_INCLUDE="$TCDIR/$TARGET/include" \ - DBM_INCLUDE="$TCDIR/$TARGET/include" install + KERNEL_INCLUDE="$SYSROOT/include" \ + DBM_INCLUDE="$SYSROOT/include" install cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR" } diff --git a/pkg/ldns/build b/pkg/ldns/build index 6f41396..740f536 100755 --- a/pkg/ldns/build +++ b/pkg/ldns/build @@ -12,7 +12,7 @@ prepare() { build() { run_configure "$1" --with-drill --without-pyldns --without-pyldnsx \ - --without-p5-dns-ldns --with-ssl="$TCDIR/$TARGET" + --without-p5-dns-ldns --with-ssl="$SYSROOT" make -j $NUMJOBS } diff --git a/pkg/libpcap/build b/pkg/libpcap/build index 986f2be..2d69ae3 100755 --- a/pkg/libpcap/build +++ b/pkg/libpcap/build @@ -12,7 +12,7 @@ prepare() { build() { cp -r ${1}/* ${PKGBUILDDIR} - sed -i "s#/usr/include/libnl3#$TCDIR/$TARGET/include/libnl3#g" configure + sed -i "s#/usr/include/libnl3#$SYSROOT/include/libnl3#g" configure run_configure "." --with-pcap=linux --enable-ipv6 make -j $NUMJOBS diff --git a/pkg/ntp/build b/pkg/ntp/build index 8f9cd51..ac4f13e 100644 --- a/pkg/ntp/build +++ b/pkg/ntp/build @@ -11,8 +11,8 @@ prepare() { build() { CFLAGS=-fno-stack-protector \ - run_configure "$1" --with-openssl-libdir="$TCDIR/$TARGET/lib" \ - --with-openssl-incdir="$TCDIR/$TARGET/include" \ + run_configure "$1" --with-openssl-libdir="$SYSROOT/lib" \ + --with-openssl-incdir="$SYSROOT/include" \ --with-yielding-select=yes --enable-ipv6 \ --with-lineeditlibs=readline --without-rpath \ --without-sntp --with-ntpsnmpd diff --git a/pkg/release-alix/build b/pkg/release-alix/build index 46d4ca9..30a8a89 100755 --- a/pkg/release-alix/build +++ b/pkg/release-alix/build @@ -4,7 +4,7 @@ SUBPKG="release" build() { pkg install -om -r "$PKGBUILDDIR/$OS_RELEASE" linux - pkg dump -l pkg -r "$TCDIR/$TARGET" "$REPODIR/rootfs.pkg" \ + pkg dump -l pkg -r "$SYSROOT" "$REPODIR/rootfs.pkg" \ > "$PKGBUILDDIR/files.txt" gensquashfs -F "$PKGBUILDDIR/files.txt" "$OS_RELEASE/rootfs.img" diff --git a/pkg/release-qemu/build b/pkg/release-qemu/build index 6e947eb..ef776f9 100755 --- a/pkg/release-qemu/build +++ b/pkg/release-qemu/build @@ -4,7 +4,7 @@ SUBPKG="release" build() { pkg install -om -r "$PKGBUILDDIR/$OS_RELEASE" linux - pkg dump -l pkg -r "$TCDIR/$TARGET" "$REPODIR/rootfs.pkg" \ + pkg dump -l pkg -r "$SYSROOT" "$REPODIR/rootfs.pkg" \ > "$PKGBUILDDIR/files.txt" gensquashfs -F "$PKGBUILDDIR/files.txt" "$OS_RELEASE/rootfs.img" diff --git a/pkg/release-rpi3/build b/pkg/release-rpi3/build index d3c8277..e442dd0 100755 --- a/pkg/release-rpi3/build +++ b/pkg/release-rpi3/build @@ -5,7 +5,7 @@ build() { pkg install -om -r "$PKGBUILDDIR/boot" \ boot-rpi boot-rpi-dtbo boot-rpi-dtb linux - pkg dump -l pkg -r "$TCDIR/$TARGET" "$REPODIR/rootfs.pkg" \ + pkg dump -l pkg -r "$SYSROOT" "$REPODIR/rootfs.pkg" \ > "$PKGBUILDDIR/files.txt" gensquashfs -F "$PKGBUILDDIR/files.txt" "boot/rootfs.img" diff --git a/pkg/rootfs/build b/pkg/rootfs/build index 7ffefd5..1ceca7a 100755 --- a/pkg/rootfs/build +++ b/pkg/rootfs/build @@ -5,16 +5,16 @@ build() { local desc="$PKGDEPLOYDIR/$PKGNAME.desc" # generate package description and file listing - pkg install -l pkg -r "$TCDIR/$TARGET" $DEPENDS | sort -u > "$listing" + pkg install -l pkg -r "$SYSROOT" $DEPENDS | sort -u > "$listing" touch "$desc" # move configuration to preserve directory - mkdir -pv "$TCDIR/$TARGET/cfg/preserve" "$TCDIR/$TARGET/cfg/overlay" + mkdir -pv "$SYSROOT/cfg/preserve" "$SYSROOT/cfg/overlay" - mv "$TCDIR/$TARGET/etc" "$TCDIR/$TARGET/cfg/preserve/etc" - mv "$TCDIR/$TARGET/usr" "$TCDIR/$TARGET/cfg/preserve/usr" - mv "$TCDIR/$TARGET/var/lib" "$TCDIR/$TARGET/cfg/preserve/var_lib" - rm -rf "$TCDIR/$TARGET/var" + mv "$SYSROOT/etc" "$SYSROOT/cfg/preserve/etc" + mv "$SYSROOT/usr" "$SYSROOT/cfg/preserve/usr" + mv "$SYSROOT/var/lib" "$SYSROOT/cfg/preserve/var_lib" + rm -rf "$SYSROOT/var" sed -i 's#etc/#cfg/preserve/etc/#g' "$listing" sed -i 's#var/lib/#cfg/preserve/var_lib/#g' "$listing" diff --git a/pkg/tc-binutils/build b/pkg/tc-binutils/build index d2fedf0..28dec92 100755 --- a/pkg/tc-binutils/build +++ b/pkg/tc-binutils/build @@ -13,10 +13,10 @@ build() { local extra="$BINUTILS_EXTRACFG" $1/configure --prefix="$TCDIR" --target="$TARGET" --disable-nls \ - --with-sysroot="$TCDIR/$TARGET" --disable-multilib \ + --with-sysroot="$SYSROOT" --disable-multilib \ --enable-shared --enable-plugins --enable-relro \ --with-pic --enable-deterministic-archives \ - --with-lib-path="$TCDIR/$TARGET/lib" $extra + --with-lib-path="$SYSROOT/lib" $extra make configure-host make -j $NUMJOBS @@ -24,28 +24,7 @@ build() { deploy() { make install - - cat > "$PKGDEPLOYDIR/$PKGNAME.files" <<_EOF -dir bin 0755 0 0 -dir lib 0755 0 0 -dir lib/ldscripts 0755 0 0 -file bin/ar 0755 0 0 $TCDIR/$TARGET/bin/ar -file bin/as 0755 0 0 $TCDIR/$TARGET/bin/as -file bin/ld 0755 0 0 $TCDIR/$TARGET/bin/ld -file bin/ld.bfd 0755 0 0 $TCDIR/$TARGET/bin/ld.bfd -file bin/nm 0755 0 0 $TCDIR/$TARGET/bin/nm -file bin/objcopy 0755 0 0 $TCDIR/$TARGET/bin/objcopy -file bin/objdump 0755 0 0 $TCDIR/$TARGET/bin/objdump -file bin/ranlib 0755 0 0 $TCDIR/$TARGET/bin/ranlib -file bin/readelf 0755 0 0 $TCDIR/$TARGET/bin/readelf -file bin/strip 0755 0 0 $TCDIR/$TARGET/bin/strip -_EOF - - find -H "$TCDIR/$TARGET/lib/ldscripts" -type f \ - -printf "file lib/ldscripts/%f 0%m 0 0 %p\\n" \ - >> "$PKGDEPLOYDIR/$PKGNAME.files" - - touch "$PKGDEPLOYDIR/$PKGNAME.desc" + touch "$PKGDEPLOYDIR/$PKGNAME.desc" "$PKGDEPLOYDIR/$PKGNAME.files" } check_update() { diff --git a/pkg/tc-gcc1/build b/pkg/tc-gcc1/build index 81f3696..1aeff5a 100755 --- a/pkg/tc-gcc1/build +++ b/pkg/tc-gcc1/build @@ -33,7 +33,7 @@ build() { $1/configure --prefix="$TCDIR" --target="$TARGET" \ --build="$HOSTTUPLE" --host="$HOSTTUPLE" \ - --with-sysroot="$TCDIR/$TARGET" \ + --with-sysroot="$SYSROOT" \ --disable-nls --disable-shared --without-headers \ --disable-multilib --disable-decimal-float \ --disable-libgomp --disable-libmudflap \ diff --git a/pkg/tc-gcc2/build b/pkg/tc-gcc2/build index 5e6eb41..9f6d6c5 100755 --- a/pkg/tc-gcc2/build +++ b/pkg/tc-gcc2/build @@ -13,7 +13,7 @@ build() { $1/configure --prefix="$TCDIR" --target="$TARGET" \ --build="$HOSTTUPLE" --host="$HOSTTUPLE" \ - --with-sysroot="$TCDIR/$TARGET" \ + --with-sysroot="$SYSROOT" \ --disable-nls --enable-languages=c,c++ \ --enable-c99 --enable-long-long \ --enable-libmudflap --disable-multilib \ @@ -30,11 +30,11 @@ deploy() { make install mkdir -p "$PKGDEPLOYDIR/lib" - mv ${TCDIR}/${TARGET}/{include,lib} "$PKGDEPLOYDIR" - cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR" + mv "$TCDIR/$TARGET/lib" "$PKGDEPLOYDIR" + mkdir -p "$TCDIR/$TARGET/lib" + mv "$PKGDEPLOYDIR/lib/ldscripts" "$TCDIR/$TARGET/lib" - pkg_scan_dir "$PKGDEPLOYDIR/include/c++" |\ - sed "s#$PKGDEPLOYDIR/##g" >> "$PKGDEPLOYDIR/libstdc++-dev.files" + cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR" if [ -f "$PKGDEPLOYDIR/lib/libmpx.a" ]; then cat >> "$PKGDEPLOYDIR/libgcc-dev.files" <<_EOF diff --git a/pkg/tc-pkgtool/build b/pkg/tc-pkgtool/build index fbbcc89..822abb6 100755 --- a/pkg/tc-pkgtool/build +++ b/pkg/tc-pkgtool/build @@ -13,7 +13,7 @@ build() { $1/configure --prefix="$TCDIR" --disable-static \ --build="$HOSTTUPLE" --host="$HOSTTUPLE" \ --with-repo-dir="$REPODIR" \ - --with-install-root="$TCDIR/$TARGET" + --with-install-root="$SYSROOT" make -j $NUMJOBS } diff --git a/pkg/tcpdump/build b/pkg/tcpdump/build index 62ce6b5..b7020a5 100755 --- a/pkg/tcpdump/build +++ b/pkg/tcpdump/build @@ -11,7 +11,7 @@ prepare() { build() { run_configure "$1" --with-system-libpcap --with-cap-ng \ - --with-crypto="$TCDIR/$TARGET" + --with-crypto="$SYSROOT" make -j $NUMJOBS } diff --git a/pkg/toolchain/build b/pkg/toolchain/build index 50749a9..0980b39 100755 --- a/pkg/toolchain/build +++ b/pkg/toolchain/build @@ -9,7 +9,7 @@ deploy() { cat > "$CMAKETCFILE" << _EOF set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSROOT ${TCDIR}/${TARGET}) +set(CMAKE_SYSROOT ${SYSROOT}) set(CMAKE_C_COMPILER ${TCDIR}/bin/${TARGET}-gcc) set(CMAKE_C_COMPILER_TARGET ${TARGET}) diff --git a/pkg/unbound/build b/pkg/unbound/build index ca994c7..63d3a81 100644 --- a/pkg/unbound/build +++ b/pkg/unbound/build @@ -12,8 +12,7 @@ prepare() { build() { run_configure "$1" --with-pidfile=/run/unbound.pid \ - --with-libexpat="$TCDIR/$TARGET" \ - --with-ssl="$TCDIR/$TARGET" + --with-libexpat="$SYSROOT" --with-ssl="$SYSROOT" make -j $NUMJOBS } diff --git a/util/build_package.sh b/util/build_package.sh index 5b6f798..f0f8127 100644 --- a/util/build_package.sh +++ b/util/build_package.sh @@ -18,8 +18,8 @@ build_package() { fetch_package - rm -rf "$TCDIR/$TARGET" "$PKGBUILDDIR" "$PKGDEPLOYDIR" - mkdir -p "$TCDIR/$TARGET" "$PKGBUILDDIR" "$PKGDEPLOYDIR" + rm -rf "$SYSROOT" "$PKGBUILDDIR" "$PKGDEPLOYDIR" + mkdir -p "$SYSROOT" "$PKGBUILDDIR" "$PKGDEPLOYDIR" if [ ! -z "$DEPENDS" ]; then pkg install -omD $DEPENDS @@ -35,5 +35,5 @@ build_package() { -l "$PKGDEPLOYDIR/${f}.files" done - rm -rf "$TCDIR/$TARGET" "$PKGBUILDDIR" "$PKGDEPLOYDIR" + rm -rf "$SYSROOT" "$PKGBUILDDIR" "$PKGDEPLOYDIR" }