commit ca717c87d71bd08fa6224dc30ac94b8586cd328c Author: EnumDev Date: Thu May 8 16:54:26 2025 +0300 Initial Commit diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..d643372 --- /dev/null +++ b/pkg.info @@ -0,0 +1,8 @@ +name: fftw +description: C subroutine library for computing the discrete Fourier transform +version: 3.3.10 +url: http://www.fftw.org/ +license: GPL2-or-later +architecture: any +depends: ["gcc","glibc"] +type: source diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..7520e23 --- /dev/null +++ b/source.sh @@ -0,0 +1,70 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +DOWNLOAD="https://www.fftw.org/fftw-${BPM_PKG_VERSION}.tar.gz" +FILENAME="${DOWNLOAD##*/}" + +# The prepare function is executed in the root of the temp directory +# This function is used for downloading files and putting them into the correct location +prepare() { + wget "$DOWNLOAD" + tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + # Build double precision arithmetic version + mkdir "$BPM_SOURCE"/double_precision + cd "$BPM_SOURCE"/double_precision + ../configure --prefix=/usr --enable-shared --disable-static --enable-threads --enable-sse2 --enable-avx --enable-avx2 + make + + # Build single precision arithmetic version + mkdir "$BPM_SOURCE"/single_precision + cd "$BPM_SOURCE"/single_precision + ../configure --prefix=/usr --enable-shared --disable-static --enable-threads --enable-sse2 --enable-avx --enable-avx2 --enable-float + make + + # Build long double precision arithmetic version + mkdir "$BPM_SOURCE"/long_double_precision + cd "$BPM_SOURCE"/long_double_precision + ../configure --prefix=/usr --enable-shared --disable-static --enable-threads --enable-long-double + make +} + +# The check function is executed in the source directory +# This function is used to run tests to verify the package has been compiled correctly +check() { + # Check double precision arithmetic version + cd "$BPM_SOURCE"/double_precision + make check + + # Check single precision arithmetic version + cd "$BPM_SOURCE"/single_precision + make check + + # Check long double precision arithmetic version + cd "$BPM_SOURCE"/long_double_precision + make check +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + # Package double precision arithmetic version + cd "$BPM_SOURCE"/double_precision + make DESTDIR="$BPM_OUTPUT" install + + # Package single precision arithmetic version + cd "$BPM_SOURCE"/single_precision + make DESTDIR="$BPM_OUTPUT" install + + # Package long double precision arithmetic version + cd "$BPM_SOURCE"/long_double_precision + make DESTDIR="$BPM_OUTPUT" install + + # Install license + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/fftw/COPYING +}