Skip to content

Commit

Permalink
improve staging
Browse files Browse the repository at this point in the history
  • Loading branch information
stephtr committed Sep 19, 2024
1 parent a2c2e42 commit 005230d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 38 deletions.
55 changes: 44 additions & 11 deletions .github/workflows/compile-libqalculate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,65 @@ jobs:
- name: Checkout 🛎
uses: actions/checkout@v4

# - name: Setup dependency cache
# id: cache-dependencies
# uses: actions/cache@v2
# with:
# path: |
# ~/opt/lib
# ~/opt/include
# key: ${{env.LIBQALCULATE_VERSION}}-gmp${{env.GMP_VERSION}}-mpfr${{env.MPFR_VERSION}}-libxml2${{env.LIBXML2_VERSION}}-em${{env.EM_VERSION}}-${{ runner.os }}
- name: Setup dependency cache
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
~/opt/lib
~/opt/include
key: ${{env.LIBQALCULATE_VERSION}}-gmp${{env.GMP_VERSION}}-mpfr${{env.MPFR_VERSION}}-libxml2${{env.LIBXML2_VERSION}}-em${{env.EM_VERSION}}-${{ runner.os }}

- name: Setup emsdk cache
if: steps.cache-dependencies.outputs.cache-hit != 'true'
# if: steps.cache-dependencies.outputs.cache-hit != 'true'
id: cache-system-libraries
uses: actions/cache@v2
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{ runner.os }}

- name: Setup emsdk
if: steps.cache-dependencies.outputs.cache-hit != 'true'
# if: steps.cache-dependencies.outputs.cache-hit != 'true'
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}

- name: Setup dependencies
- name: Setup GMP, MPFR & libxml2
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
sudo apt install -y build-essential lzip binutils autoconf intltool libtool automake lbzip2 lzip
mkdir -p ~/opt/src
cd ~/opt/src
wget https://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.lz
tar xf gmp-${GMP_VERSION}.tar.lz
cd gmp-${GMP_VERSION}
emconfigure ./configure --disable-assembly --host none --enable-cxx --prefix=${HOME}/opt # no, the "none" host is not obsolete.
make
make install
cd ..
wget https://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.xz
# wget https://www.mpfr.org/mpfr-current/allpatches # if available
tar xf mpfr-${MPFR_VERSION}.tar.xz
cd mpfr-${MPFR_VERSION}
emconfigure ./configure --prefix=${HOME}/opt --with-gmp=${HOME}/opt
make
make install
cd ..
wget http://xmlsoft.org/download/libxml2-${LIBXML2_VERSION}.tar.gz -O libxml2-${LIBXML2_VERSION}.tar.gz
tar xf libxml2-${LIBXML2_VERSION}.tar.gz
cd libxml2-${LIBXML2_VERSION}
emconfigure ./configure --prefix=${HOME}/opt --disable-shared --without-python
make
make install
ln -s ${HOME}/opt/include/libxml2/libxml ${HOME}/opt/include/libxml
cd ..
- name: Setup libqalculate
# if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
chmod +x ./.github/workflows/prepare-libqalculate.sh
./.github/workflows/prepare-libqalculate.sh
27 changes: 0 additions & 27 deletions .github/workflows/prepare-libqalculate.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,8 @@
#!/bin/bash

sudo apt install -y build-essential lzip binutils autoconf intltool libtool automake lbzip2 lzip
mkdir -p ~/opt/src
cd ~/opt/src

wget https://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.lz
tar xf gmp-${GMP_VERSION}.tar.lz
cd gmp-${GMP_VERSION}
emconfigure ./configure --disable-assembly --host none --enable-cxx --prefix=${HOME}/opt # no, the "none" host is not obsolete.
make
make install
cd ..

wget https://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.xz
# wget https://www.mpfr.org/mpfr-current/allpatches # if available
tar xf mpfr-${MPFR_VERSION}.tar.xz
cd mpfr-${MPFR_VERSION}
emconfigure ./configure --prefix=${HOME}/opt --with-gmp=${HOME}/opt
make
make install
cd ..

wget http://xmlsoft.org/download/libxml2-${LIBXML2_VERSION}.tar.gz -O libxml2-${LIBXML2_VERSION}.tar.gz
tar xf libxml2-${LIBXML2_VERSION}.tar.gz
cd libxml2-${LIBXML2_VERSION}
emconfigure ./configure --prefix=${HOME}/opt --disable-shared --without-python
make
make install
ln -s ${HOME}/opt/include/libxml2/libxml ${HOME}/opt/include/libxml
cd ..

wget https://github.com/Qalculate/libqalculate/archive/refs/tags/v${LIBQALCULATE_VERSION}.tar.gz -O libqalculate-${LIBQALCULATE_VERSION}.tar.gz
tar xf libqalculate-${LIBQALCULATE_VERSION}.tar.gz
cd libqalculate-${LIBQALCULATE_VERSION}
Expand Down

0 comments on commit 005230d

Please sign in to comment.