Skip to content

Commit

Permalink
Move out of local cpanm plugin into nil plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
CAMOBAP committed Dec 28, 2023
1 parent 225645c commit 949b52e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 98 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ubuntu
name: build-and-release

on:
push:
Expand All @@ -11,8 +11,6 @@ jobs:
build:
name: Build LaTeXML snap
runs-on: ubuntu-latest
container:
image: snapcore/snapcraft:stable
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image:https://github.com/metanorma/latexml-snap/workflows/ubuntu/badge.svg["Build Status", link="https://github.com/metanorma/latexml-snap/actions?query=workflow%3Aubuntu"]
image:https://github.com/metanorma/latexml-snap/workflows/build-and-release/badge.svg["Build Status", link="https://github.com/metanorma/latexml-snap/actions?query=workflow%3Abuild-and-release"]

= latexml-snap: LaTeXML Snap Package

Expand Down
77 changes: 0 additions & 77 deletions snap/plugins/cpanm.py

This file was deleted.

59 changes: 42 additions & 17 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,48 @@ confinement: strict

parts:
latexml:
plugin: cpanm
cpanm-packages: ['XML::[email protected]', LaTeXML@$SNAPCRAFT_PROJECT_VERSION]
build-packages: [libxml2-dev, libxslt1-dev, libicu-dev, zlib1g-dev]
stage-packages: [libxml2, libxslt1.1, zlib1g]
override-stage: |
snapcraftctl stage
chmod 0755 ./usr/local/share/sgml
chmod 0755 ./usr/local/share/sgml/declaration
chmod 0755 ./usr/local/share/sgml/dtd
chmod 0755 ./usr/local/share/sgml/entities
chmod 0755 ./usr/local/share/sgml/misc
chmod 0755 ./usr/local/share/sgml/stylesheet
chmod 0755 ./usr/local/share/xml
chmod 0755 ./usr/local/share/xml/declaration
chmod 0755 ./usr/local/share/xml/entities
chmod 0755 ./usr/local/share/xml/misc
chmod 0755 ./usr/local/share/xml/schema
plugin: nil
source: .
override-pull: |
apt update
apt install -y curl perl build-essential
curl -o cpanminus.pl http://cpanmin.us
perl -- cpanminus.pl App::cpanminus
override-build: |
apt update
apt install -y libxml2-dev libxslt1-dev libicu-dev zlib1g-dev
# Install cpanm packages
cpanm_packages=("XML::[email protected]" "LaTeXML@$SNAPCRAFT_PROJECT_VERSION")
for pkg in "${cpanm_packages[@]}"; do
cpanm --notest "$pkg"
done
# Modify perl5lib.sh
perl_inc=$(perl -e 'print "@INC"')
perl_snap_inc=()
for incpath in $(perl -e 'print "@INC"'); do
if [ "$incpath" != "." ]; then
perl_snap_inc+=("$SNAP$incpath")
fi
done
perl5lib_sh="/usr/bin/perl5lib.sh"
echo "env PERL5LIB=$(IFS=:; echo "${perl_snap_inc[*]}") env PATH=$SNAP/usr/local/bin:$PATH \$@" > "$perl5lib_sh"
chmod +x "$perl5lib_sh"
organize:
/usr/bin/perl5lib.sh: /usr/bin/perl5lib.sh
/usr/local: /usr/local

stage-packages:
- libicu66
- libxml2
- libxslt1.1
- zlib1g

apps:
latexml:
environment:
Expand Down

0 comments on commit 949b52e

Please sign in to comment.