diff --git a/R.yaml b/R.yaml new file mode 100644 index 00000000000..0c5eb8e260a --- /dev/null +++ b/R.yaml @@ -0,0 +1,133 @@ +# Generated from https://git.alpinelinux.org/aports/plain/community/R/APKBUILD +package: + name: R + version: 4.3.1 + epoch: 0 + description: Language and environment for statistical computing + copyright: + - license: ( GPL-2.0-only OR GPL-3.0-only ) AND LGPL-2.1-or-later + +environment: + contents: + packages: + - busybox + - ca-certificates-bundle + - build-base + - automake + - autoconf + - bzip2-dev + - curl-dev + - gcc + - gfortran + - icu-dev + - libjpeg-turbo + - libpng-dev + - make + - openblas-dev + - pcre2-dev + - readline-dev + - xz-dev + - zlib-dev + - cairo-dev + - openjdk-17 + - openjdk-17-default-jvm + - libxmu-dev + - pango-dev + - perl + - tiff-dev + - tzdata + - glibc-iconv + - glibc-dev + - libjpeg-turbo-dev + - libice-dev + - libgcc + - libx11-dev + +pipeline: + - uses: fetch + with: + expected-sha256: 8dd0bf24f1023c6f618c3b317383d291b4a494f40d73b983ac22ffea99e4ba99 + uri: https://cran.r-project.org/src/base/R-4/R-${{package.version}}.tar.gz + + - runs: | + r_cv_have_curl728=y \ + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc/R \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --libdir=/usr/lib \ + rdocdir=/usr/share/doc/R \ + rincludedir=/usr/include/R \ + rsharedir=/usr/share/R \ + --disable-nls \ + --enable-R-shlib \ + --enable-java \ + --with-blas=openblas \ + --with-cairo \ + --with-ICU \ + --with-jpeglib \ + --with-lapack \ + --with-libpng \ + --with-libtiff \ + --with-x \ + --with-tcltk + + - uses: autoconf/make + + - runs: | + make -C src/nmath/standalone + + - uses: autoconf/make-install + + - runs: | + _rhome="usr/lib/R" + ldpath="/$_rhome/lib" + destdir="${{targets.destdir}}/$_rhome" + + cd src/nmath/standalone + make DESTDIR="${{targets.destdir}}" install + cd ../../../ + + # Fixup R wrapper script (taken from Arch). + rm "$destdir"/bin/R + ln -sf /usr/bin/R "$destdir"/bin/R + + # Remove some useless files (COPYING is duplicated, it will be + # in -doc, don't worry). + rm "$destdir"/COPYING "$destdir"/SVN-REVISION + + mkdir -p "${{targets.destdir}}"/etc/R + + # R apparently ignores --sysconfdir, so we must manually move configs + # to /etc/R and make symlinks. + cd "$destdir"/etc + for f in *; do + mv "$f" "${{targets.destdir}}"/etc/R/ && ln -sf /etc/R/$f $f + done + + - uses: strip + +subpackages: + - name: R-mathlib + pipeline: + - runs: | + mkdir -p "${{targets.subpkgdir}}"/usr/lib + mv "${{targets.destdir}}"/usr/lib/libRmath.so* "${{targets.subpkgdir}}"/usr/lib + + - name: R-dev + pipeline: + - uses: split/dev + description: R dev + + - name: R-doc + pipeline: + - uses: split/manpages + - runs: | + mkdir -p "${{targets.subpkgdir}}"/usr/share/doc/ + mv "${{targets.destdir}}"/usr/share/doc/* "${{targets.subpkgdir}}"/usr/share/doc/ + description: R manpages + +update: + release-monitor: + identifier: 4150 diff --git a/openblas.yaml b/openblas.yaml new file mode 100644 index 00000000000..9571ffbebd4 --- /dev/null +++ b/openblas.yaml @@ -0,0 +1,98 @@ +# Generated from https://git.alpinelinux.org/aports/plain/community/openblas/APKBUILD +package: + name: openblas + version: 0.3.23 + epoch: 0 + description: fast BSD-licensed BLAS based on gotoBLAS2, with LAPACK + copyright: + - license: BSD-3-Clause + +environment: + contents: + packages: + - busybox + - ca-certificates-bundle + - build-base + - automake + - autoconf + - perl + - linux-headers + - gfortran + +pipeline: + - uses: fetch + with: + expected-sha256: 5d9491d07168a5d00116cdc068a40022c3455bf9293c7cb86a65b1054d7e5114 + uri: https://github.com/xianyi/OpenBLAS/archive/v${{package.version}}/openblas-${{package.version}}.tar.gz + + - uses: patch + with: + patches: blas-lapack.patch + + - runs: | + _flags=" + MAJOR_VERSION=3 + NO_AFFINITY=1 + NO_STATIC=1 + USE_OPENMP=0 + PREFIX=/usr + " + if [ "${{build.arch}}" = "x86_64" ]; then + _flags="$_flags DYNAMIC_ARCH=1" + _flags="$_flags TARGET=CORE2" + elif [ "${{build.arch}}" = "aarch64" ]; then + _flags="$_flags DYNAMIC_ARCH=0" + _flags="$_flags TARGET=ARMV8" + fi + + builddir=$(pwd) + cd .. + export CFLAGS=${CFLAGS/-Os/-O2} + + make -C "$builddir" \ + $_flags CFLAGS="$CFLAGS" + + make -C "$builddir"/interface \ + $_flags CFLAGS="$CFLAGS" shared-blas-lapack + + + cd $builddir + make $_flags DESTDIR="${{targets.destdir}}" install + install -Dm755 interface/liblapack.so.3 \ + "${{targets.destdir}}"/usr/lib/liblapack.so.3 + ln -s liblapack.so.3 "${{targets.destdir}}"/usr/lib/liblapack.so + install -Dm755 interface/liblapacke.so.3 \ + "${{targets.destdir}}"/usr/lib/liblapacke.so.3 + ln -s liblapacke.so.3 "${{targets.destdir}}"/usr/lib/liblapacke.so + + install -Dm 0644 Changelog.txt TargetList.txt USAGE.md \ + -t "${{targets.destdir}}"/usr/share/doc/${{package.name}}/ + + - uses: strip + +subpackages: + - name: openblas-dev + pipeline: + - uses: split/dev + description: openblas dev + + - name: openblas-doc + pipeline: + - uses: split/manpages + description: openblas manpages + + - name: liblapack + pipeline: + - runs: | + mkdir -p "${{targets.subpkgdir}}"/usr/lib + mv "${{targets.destdir}}"/usr/lib/liblapack.so* "${{targets.subpkgdir}}"/usr/lib + + - name: liblapacke + pipeline: + - runs: | + mkdir -p "${{targets.subpkgdir}}"/usr/lib + mv "${{targets.destdir}}"/usr/lib/liblapacke.so* "${{targets.subpkgdir}}"/usr/lib + +update: + github: + identifier: xianyi/OpenBLAS diff --git a/openblas/blas-lapack.patch b/openblas/blas-lapack.patch new file mode 100644 index 00000000000..ced2f4f0226 --- /dev/null +++ b/openblas/blas-lapack.patch @@ -0,0 +1,39 @@ +Patch-Source: https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-libs/openblas/files/openblas-0.3.12-shared-blas-lapack.patch +-- +diff --git a/interface/Makefile b/interface/Makefile +index 2ac9663..077ed16 100644 +--- a/interface/Makefile ++++ b/interface/Makefile +@@ -332,7 +332,7 @@ CCBLAS3OBJS = \ + cblas_chemm.$(SUFFIX) cblas_cherk.$(SUFFIX) cblas_cher2k.$(SUFFIX) \ + cblas_comatcopy.$(SUFFIX) cblas_cimatcopy.$(SUFFIX)\ + cblas_cgeadd.$(SUFFIX) cblas_cgemmt.$(SUFFIX) +- ++ + CXERBLAOBJ = \ + cblas_xerbla.$(SUFFIX) + +@@ -2384,3 +2384,22 @@ cblas_zgeadd.$(SUFFIX) cblas_zgeadd.$(PSUFFIX) : zgeadd.c + cblas_xerbla.$(SUFFIX) cblas_xerbla.$(PSUFFIX) : xerbla.c + $(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F) + ++##### ++shared-blas-lapack: libblas.so.3 libcblas.so.3 liblapack.so.3 liblapacke.so.3 ++ ++# The list of prerequisite is created by comparing with NETLIB BLAS public API. ++libblas.so.3: $(SBLAS1OBJS) $(SBLAS2OBJS) $(SBLAS3OBJS) $(DBLAS1OBJS) $(DBLAS2OBJS) $(DBLAS3OBJS) $(CBLAS1OBJS) $(CBLAS2OBJS) $(CBLAS3OBJS) $(ZBLAS1OBJS) $(ZBLAS2OBJS) $(ZBLAS3OBJS) ../kernel/lsame.o ../kernel/scabs1.o ../kernel/dcabs1.o ../driver/others/xerbla.o ++ $(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libblas.so.3 -L.. -lopenblas $(EXTRALIB) ++ ++libcblas.so.3: $(CSBLAS1OBJS) $(CSBLAS2OBJS) $(CSBLAS3OBJS) $(CDBLAS1OBJS) $(CDBLAS2OBJS) $(CDBLAS3OBJS) $(CCBLAS1OBJS) $(CCBLAS2OBJS) $(CCBLAS3OBJS) $(CZBLAS1OBJS) $(CZBLAS2OBJS) $(CZBLAS3OBJS) ../kernel/lsame.o ../kernel/scabs1.o ../kernel/dcabs1.o ../driver/others/xerbla.o ++ $(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libcblas.so.3 -L.. -lopenblas $(EXTRALIB) ++ ++# The prerequisites must match the symbols deleted in target delete-duplicate-lapack-objects ++liblapack.so.3: $(SLAPACKOBJS) $(DLAPACKOBJS) $(CLAPACKOBJS) $(ZLAPACKOBJS) ../kernel/lsame.o ../driver/others/xerbla.o ++ $(CC) $(LDFLAGS) -shared -o $@ $^ ../lapack-netlib/SRC/*.o -Wl,-soname,liblapack.so.3 -L.. -lopenblas $(EXTRALIB) ++ ++liblapacke.so.3: liblapack.so.3 ++ $(CC) $(LDFLAGS) -shared -o $@ `find ../lapack-netlib/LAPACKE -name "*.o"` -Wl,-soname,liblapacke.so.3 -L.. -lopenblas $(EXTRALIB) ++ ++clean:: ++ rm -f libblas.so.3 libcblas.so.3 liblapack.so.3 +