Skip to content

Commit

Permalink
Try to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
reznikmm committed Nov 26, 2022
1 parent 1102f3c commit a08470e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 25 deletions.
7 changes: 4 additions & 3 deletions .copr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

srpm:
mkdir /tmp/.copr
cp -v `dirname $(spec)`/../patches/gnat-llvm.patch /tmp/.copr
tar cavf /tmp/.copr/`grep ^Source0: $(spec)| sed -e 's/^.* //'` \
--exclude-vcs -C .. `basename $(realpath .)`
curl -L -o /tmp/.copr/gnat-llvm.zip https://github.com/AdaCore/gnat-llvm/archive/e3f56dce0df148c5f27e97d973cfbdc1bd72248f.zip
curl -L -o /tmp/.copr/bb-runtimes.zip https://github.com/Fabien-Chouteau/bb-runtimes/archive/7a4674ae9221d2fa046bed20fbaf9de9caa09d41.zip
curl -L -o /tmp/.copr/gcc.zip https://github.com/gcc-mirror/gcc/archive/e078de24eae8253fd4f24342f65166b525dd99c6.zip
curl -L -o /tmp/.copr/gnat-llvm.zip https://github.com/AdaCore/gnat-llvm/archive/28c91e94c4227e6d9eabb2aeed4c0c12f6a4f3de.zip
curl -L -o /tmp/.copr/bb-runtimes.zip https://github.com/Fabien-Chouteau/bb-runtimes/archive/c1d089bd8880cec250266cf71d6a22cc74fdba79.zip
curl -L -o /tmp/.copr/gcc.zip https://github.com/gcc-mirror/gcc/archive/64d5610f44c995b88261bf83f53a200355cb530f.zip
rpmbuild -bs $(spec) --define="_sourcedir /tmp/.copr" --define="_srcrpmdir $(outdir)"
8 changes: 5 additions & 3 deletions .copr/adawebpack.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
%define __os_install_post %{nil}

Name: adawebpack
Version: 22.0.1
Version: 22.1.0
Release: git%{?dist}
Summary: Ada WASM Runtime and Bindings for Web API
Group: Development/Libraries
Expand All @@ -16,14 +16,15 @@ Source0: adawebpack.tar.gz
Source1: gnat-llvm.zip
Source2: bb-runtimes.zip
Source3: gcc.zip
Patch0: gnat-llvm.patch
BuildRequires: bsdtar
BuildRequires: gcc-gnat
BuildRequires: fedora-gnat-project-common >= 3
BuildRequires: gprbuild
BuildRequires: gcc-c++
BuildRequires: libstdc++-static
BuildRequires: lld
BuildRequires: llvm-devel >= 13
BuildRequires: llvm-devel >= 14
BuildRequires: clang
BuildRequires: chrpath

Expand All @@ -34,13 +35,14 @@ ExclusiveArch: %GPRbuild_arches
Ada WASM Runtime and Bindings for Web API

%prep
%setup -T -b1 -a 0 -a 2 -n gnat-llvm-e3f56dce0df148c5f27e97d973cfbdc1bd72248f/
%setup -T -b1 -a 0 -a 2 -n gnat-llvm-28c91e94c4227e6d9eabb2aeed4c0c12f6a4f3de/
#export LANG=C.utf8
LANG=C.utf8 bsdtar -x -f %{S:3} gcc-*/gcc/ada
mv -v gcc-*/gcc/ada llvm-interface/gnat_src
mv %{name} llvm-interface/%{name}_src
mv -v bb-runtimes-*/gnat_rts_sources/include/rts-sources llvm-interface/
ln -s %{name}_src/source/rtl/Makefile.target llvm-interface/
%patch0 -p0

%build
make -C llvm-interface/ wasm
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
if: ${{ runner.os != 'Windows' }}
with:
repository: AdaCore/gnat-llvm
ref: 'e63df749d39fe80c2feadbb7640f3f2860424039'
ref: '28c91e94c4227e6d9eabb2aeed4c0c12f6a4f3de'
path: gnat-llvm

- name: Get bb-runtimes
Expand Down Expand Up @@ -71,7 +71,9 @@ jobs:
pwd
ls -l
ls -l gnat-llvm/llvm-interface/
cd gnat-llvm/llvm-interface
cd gnat-llvm
patch -p0 < llvm-interface/adawebpack_src/patches/gnat-llvm.patch
cd llvm-interface
ln -sv gcc/gcc/ada gnat_src
ln -sv adawebpack_src/source/rtl/Makefile.target
ln -sv bb-runtimes/gnat_rts_sources/include/rts-sources
Expand Down Expand Up @@ -102,13 +104,19 @@ jobs:
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-gcc-ada
mingw-w64-x86_64-gprbuild
mingw-w64-x86_64-clang
mingw-w64-x86_64-lld
# mingw-w64-x86_64-clang
# mingw-w64-x86_64-lld

- name: Build MSYS2 package
if: ${{ runner.os == 'Windows' }}
shell: msys2 {0}
run: |
curl -O https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-llvm-14.0.6-6-any.pkg.tar.zst
curl -O https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-clang-14.0.6-6-any.pkg.tar.zst
curl -O https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-lld-14.0.6-6-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-*-14.0.6-6-any.pkg.tar.zst
rm -rf *.tar.zst
mv gnat-llvm/llvm-interface/adawebpack_src adawebpack
cp -r adawebpack/packages/msys2 .
tar czf msys2/adawebpack.tar.gz adawebpack
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Prebuild packages are available on [Release page](https://github.com/godunko/ada
You will also need `wasm-ld`, the Web asssembly linker. You will find this:

* on Fedora Linux through the `lld` package;
* on Ubuntu through the `lld-13` package;
* on Ubuntu through the `lld-14` package;
* on other Linux systems look for a similarly-named package.

## How to build
Expand All @@ -30,8 +30,8 @@ You will also need `wasm-ld`, the Web asssembly linker. You will find this:

* Clone [GCC](https://github.com/gcc-mirror/gcc) sources. Use, for instance, `64d5610f44c995b88261bf83f53a200355cb530f` commit.
```
git clone --single-branch --shallow-since=01-12-2021 https://github.com/gcc-mirror/gcc gnat-llvm/llvm-interface/gcc
git -C gnat-llvm/gcc checkout 64d5610f44c995b88261bf83f53a200355cb530f
git clone --single-branch --shallow-since=13-11-2022 https://github.com/gcc-mirror/gcc gnat-llvm/llvm-interface/gcc
git -C gnat-llvm/llvm-interface/gcc checkout 64d5610f44c995b88261bf83f53a200355cb530f
```

* Setup GNAT-LLVM development environment, see details in
Expand Down Expand Up @@ -114,7 +114,7 @@ It could be handy to use docker.
* Build a container image (make sure to replace `curl` argument with latest RPM URL)
```
docker build --tag wgprbuild - <<EOF
FROM registry.fedoraproject.org/fedora-minimal:35
FROM registry.fedoraproject.org/fedora-minimal:36
RUN microdnf --assumeyes install \
make \
rpmdevtools \
Expand All @@ -132,7 +132,7 @@ It could be handy to use docker.
chrpath \
ca-certificates && \
curl -O \
https://download.copr.fedorainfracloud.org/results/reznik/adawebpack/fedora-35-x86_64/03123013-adawebpack/adawebpack-22.0.1-git.fc35.x86_64.rpm && \
https://download.copr.fedorainfracloud.org/results/reznik/adawebpack/fedora-36-x86_64/05068491-adawebpack/adawebpack-22.1.0-git.fc36.x86_64.rpm && \
rpm -i adawebpack*.rpm && \
rm -f adawebpack*.rpm && \
microdnf clean all
Expand Down
22 changes: 12 additions & 10 deletions packages/msys2/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
_realname=adawebpack
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=22.0.0
pkgrel=2
pkgver=22.1.0
pkgrel=1
pkgdesc="AdaWebPack is a toolchain, RTL and WebAPI binding for Ada on WebAssembly"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
url="https://github.com/godunko/adawebpack"
license=('GPL3' 'BSD3')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc-ada"
"${MINGW_PACKAGE_PREFIX}-gprbuild"
"${MINGW_PACKAGE_PREFIX}-clang"
"${MINGW_PACKAGE_PREFIX}-lld"
"${MINGW_PACKAGE_PREFIX}-llvm")
depends=("${MINGW_PACKAGE_PREFIX}-llvm")
source=("gnat-llvm.zip::https://github.com/AdaCore/gnat-llvm/archive/e3f56dce0df148c5f27e97d973cfbdc1bd72248f.zip"
"bb-runtimes.zip::https://github.com/Fabien-Chouteau/bb-runtimes/archive/7a4674ae9221d2fa046bed20fbaf9de9caa09d41.zip"
"gcc.zip::https://github.com/gcc-mirror/gcc/archive/e078de24eae8253fd4f24342f65166b525dd99c6.zip"
"${MINGW_PACKAGE_PREFIX}-clang<15.0.0"
"${MINGW_PACKAGE_PREFIX}-lld<15.0.0"
"${MINGW_PACKAGE_PREFIX}-llvm<15.0.0")
depends=("${MINGW_PACKAGE_PREFIX}-llvm<15.0.0")
source=("gnat-llvm.zip::https://github.com/AdaCore/gnat-llvm/archive/28c91e94c4227e6d9eabb2aeed4c0c12f6a4f3de.zip"
"bb-runtimes.zip::https://github.com/Fabien-Chouteau/bb-runtimes/archive/c1d089bd8880cec250266cf71d6a22cc74fdba79.zip"
"gcc.zip::https://github.com/gcc-mirror/gcc/archive/64d5610f44c995b88261bf83f53a200355cb530f.zip"
"${_realname}.tar.gz")
md5sums=( SKIP SKIP SKIP SKIP )
noextract=( "gcc.zip" )
Expand All @@ -28,7 +28,9 @@ prepare() {
mv -v gcc-*/gcc/ada gnat-llvm/llvm-interface/gnat_src
mv -v bb-runtimes-*/gnat_rts_sources/include/rts-sources gnat-llvm/llvm-interface/
mv -v adawebpack gnat-llvm/llvm-interface/adawebpack_src
cd gnat-llvm/llvm-interface/
cd gnat-llvm
patch -p0 < llvm-interface/adawebpack_src/patches/gnat-llvm.patch
cd llvm-interface/
cp -v adawebpack_src/source/rtl/Makefile.target .
rm -rf gcc-*
rm -rf bb-runtimes-*
Expand Down

0 comments on commit a08470e

Please sign in to comment.