Compare commits

...

3 Commits

Author SHA1 Message Date
c6a5a81a7a
ports: Port required libraries to build GCC
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-08 19:51:45 +02:00
3f55a70f6e
ports: Auto-strip binaries, remove libtool .la files, add dependencies 2023-08-08 19:46:04 +02:00
b1e164f360
libc. Add basic wchar.h 2023-08-08 19:43:23 +02:00
9 changed files with 114 additions and 13 deletions

View File

@ -0,0 +1,25 @@
/* wchar.h: Wide-character string manipulation functions. */
#ifndef _WCHAR_H
#define _WCHAR_H
typedef long int wint_t;
#include <stddef.h>
#ifdef __cplusplus
extern "C"
{
#endif
/* Calculate the size of a null-terminated wide character string. */
size_t wcslen(const wchar_t* str);
/* Compare two null-terminated wide character strings. */
int wcscmp(const wchar_t* a, const wchar_t* b);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -13,7 +13,10 @@ Name | Version | Description | URL
---|---|--- | --- ---|---|--- | ---
bc | 6.6.0 | An implementation of the POSIX bc calculator | https://github.com/gavinhoward/bc bc | 6.6.0 | An implementation of the POSIX bc calculator | https://github.com/gavinhoward/bc
binutils | 2.39 | The GNU suite of binary utilities | https://www.gnu.org/software/binutils binutils | 2.39 | The GNU suite of binary utilities | https://www.gnu.org/software/binutils
gmp | 6.3.0 | The GNU Multiple Precision Arithmetic Library | https://gmplib.org
minitar | 1.7.5 | Tiny and easy-to-use C library to read/write tar archives | https://git.cloudapio.eu/apio/minitar minitar | 1.7.5 | Tiny and easy-to-use C library to read/write tar archives | https://git.cloudapio.eu/apio/minitar
mpc | 1.3.1 | The GNU Multiple Precision Complex Library | https://www.multiprecision.org
mpfr | 4.2.0 | The GNU Multiple Precision Floating-Point Reliable Library | https://mpfr.org
nasm | 2.16.01 | An assembler for the x86 CPU architecture | https://nasm.us nasm | 2.16.01 | An assembler for the x86 CPU architecture | https://nasm.us
## Installing ports ## Installing ports
@ -48,10 +51,13 @@ The `name` variable should be set to the name of the ported program.
The `version` variable should be set to the currently ported version of the program. The `version` variable should be set to the currently ported version of the program.
If the program has dependencies on any other library/program, the `dependencies` field should be set to a list of those. Note that these dependencies must also be ported to Luna! Thus, when porting programs, you'll have to start with porting their dependencies (unless those have already been ported).
Example: Example:
``` ```
name="example" name="example"
version="1.0.0" version="1.0.0"
dependencies=(foo bar)
``` ```
#### Download options #### Download options

View File

@ -10,6 +10,7 @@ sha256sum="d12ea6f239f1ffe3533ea11ad6e224ffcb89eb5d01bbea589e9158780fa11f10"
# Build instructions # Build instructions
default_build_make=true default_build_make=true
default_install_make=true
do_patch() do_patch()
{ {
@ -18,13 +19,5 @@ do_patch()
do_configure() do_configure()
{ {
$srcdir/configure --host=$LUNA_ARCH-luna --disable-nls --disable-werror --enable-warn-rwx-segments=no --prefix=/usr --enable-gold=no --enable-ld=yes --enable-gprofng=no $srcdir/configure --host=$LUNA_ARCH-luna --with-build-sysroot=$LUNA_BASE --disable-nls --disable-werror --enable-warn-rwx-segments=no --prefix=/usr --enable-gold=no --enable-ld=yes --enable-gprofng=no
}
do_install()
{
make install
cd $installdir/usr/bin
$LUNA_ARCH-luna-strip size objdump ar strings ranlib objcopy addr2line readelf elfedit nm strip c++filt as gprof ld.bfd ld
} }

18
ports/gmp/PACKAGE Normal file
View File

@ -0,0 +1,18 @@
# Basic information
name="gmp"
version="6.3.0"
# Download options
format="tar"
url="https://gmplib.org/download/gmp/gmp-$version.tar.xz"
output="gmp-$version.tar.xz"
sha256sum="a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898"
# Build instructions
default_build_make=true
default_install_make=true
do_configure()
{
$srcdir/configure --enable-shared=no --with-gnu-ld --host=$LUNA_ARCH-luna --prefix=/usr
}

19
ports/mpc/PACKAGE Normal file
View File

@ -0,0 +1,19 @@
# Basic information
name="mpc"
version="1.3.1"
dependencies=(gmp mpfr)
# Download options
format="tar"
url="https://ftp.gnu.org/gnu/mpc/mpc-$version.tar.gz"
output="mpc-$version.tar.gz"
sha256sum="ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8"
# Build instructions
default_build_make=true
default_install_make=true
do_configure()
{
$srcdir/configure --enable-shared=no --with-gnu-ld --host=$LUNA_ARCH-luna --prefix=/usr
}

19
ports/mpfr/PACKAGE Normal file
View File

@ -0,0 +1,19 @@
# Basic information
name="mpfr"
version="4.2.0"
dependencies=(gmp)
# Download options
format="tar"
url="https://www.mpfr.org/mpfr-current/mpfr-$version.tar.gz"
output="mpfr-$version.tar.gz"
sha256sum="f1cc1c6bb14d18f0c61cc416e083f5e697b6e0e3cf9630b9b33e8e483fc960f0"
# Build instructions
default_build_make=true
default_install_make=true
do_configure()
{
$srcdir/configure --enable-shared=no --with-gnu-ld --host=$LUNA_ARCH-luna --prefix=/usr
}

View File

@ -15,16 +15,23 @@ fi
source ports/$PORT_NAME/PACKAGE source ports/$PORT_NAME/PACKAGE
IS_NEW_VERSION=0
if ! [ -f ports/out/$name-$version.tar.gz ]; then if ! [ -f ports/out/$name-$version.tar.gz ]; then
tools/make-package.sh $PORT_NAME tools/make-package.sh $PORT_NAME
IS_NEW_VERSION=1
fi fi
PORT_FILES=$LUNA_BASE/usr/share/pkgdb/$PORT_NAME.files PORT_FILES=$LUNA_BASE/usr/share/pkgdb/$name.files
if [ -f $PORT_FILES ] if [ -f $PORT_FILES ]
then then
echo "Package $PORT_NAME is already installed! Updating." if [ "$IS_NEW_VERSION" -eq "0" ]; then
tools/uninstall-package.sh $PORT_NAME echo "Package $PORT_NAME version $version is already installed!"
exit 0
fi
echo "Package $PORT_NAME is already installed! Updating to version $version."
tools/uninstall-package.sh $name
fi fi
mkdir -p $LUNA_BASE/usr/share/pkgdb/ mkdir -p $LUNA_BASE/usr/share/pkgdb/

View File

@ -28,6 +28,13 @@ source ports/$PORT_NAME/PACKAGE
[ -z ${format+x} ] && show_error "error: The port's PACKAGE file does not have a 'format' key." [ -z ${format+x} ] && show_error "error: The port's PACKAGE file does not have a 'format' key."
[ -z ${url+x} ] && show_error "error: The port's PACKAGE file does not have a 'url' key." [ -z ${url+x} ] && show_error "error: The port's PACKAGE file does not have a 'url' key."
if ! [ -z ${dependencies+x} ]; then
echo "Installing dependencies of $name: ($dependencies)"
for dep in ${dependencies[@]}; do
tools/install-package.sh $dep
done
fi
export portdir=$LUNA_ROOT/ports/$name/ export portdir=$LUNA_ROOT/ports/$name/
export srcdir=${srcdir:-$WORKDIR/$name-$version} export srcdir=${srcdir:-$WORKDIR/$name-$version}
export builddir=$WORKDIR/build-$name export builddir=$WORKDIR/build-$name
@ -109,6 +116,11 @@ else
do_install do_install
fi fi
rm -f $installdir/usr/lib/*.la # remove all libtool .la files, as they use host stuff which we don't want at all
set +e
$LUNA_ARCH-luna-strip $installdir/usr/bin/* # strip all binaries
set -e
cd $installdir cd $installdir
tar czf $LUNA_ROOT/ports/out/$name-$version.tar.gz * tar czf $LUNA_ROOT/ports/out/$name-$version.tar.gz *

View File

@ -14,5 +14,7 @@ then
exit 1 exit 1
fi fi
set +e
rm -v $(cat $LUNA_BASE/usr/share/pkgdb/$PORT_NAME.files) rm -v $(cat $LUNA_BASE/usr/share/pkgdb/$PORT_NAME.files)
rm -v $LUNA_BASE/usr/share/pkgdb/$PORT_NAME.files rm -v $LUNA_BASE/usr/share/pkgdb/$PORT_NAME.files