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 58b5206
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 83 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
77 changes: 0 additions & 77 deletions snap/plugins/cpanm.py

This file was deleted.

42 changes: 38 additions & 4 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,44 @@ 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]
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"
# Copy /usr/local to $SNAP/usr/local
cp -r /usr/local/* $SNAP/usr/local/
override-stage: |
apt update
apt install -y libxml2 libxslt1.1 zlib1g
snapcraftctl stage
chmod 0755 ./usr/local/share/sgml
chmod 0755 ./usr/local/share/sgml/declaration
Expand All @@ -27,6 +60,7 @@ parts:
chmod 0755 ./usr/local/share/xml/entities
chmod 0755 ./usr/local/share/xml/misc
chmod 0755 ./usr/local/share/xml/schema
apps:
latexml:
environment:
Expand Down

0 comments on commit 58b5206

Please sign in to comment.