Skip to content

Commit

Permalink
Add snapcraft.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Langanke authored and jbarlow83 committed Jun 8, 2022
1 parent 21cacad commit ee81f39
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: ocrmypdf
title: OCRmyPDF
base: core20
version: git
summary: OCRmyPDF adds optical character recognition (OCR) to PDFs
description: OCRmyPDF packaged for snap
grade: stable
confinement: strict

architectures: [amd64]

environment:
TESSDATA_PREFIX: $SNAP/usr/share/tesseract-ocr/4.00/tessdata
GS_LIB: $SNAP/usr/share/ghostscript/9.50/Resource/Init
GS_FONTPATH: $SNAP/usr/share/ghostscript/9.50/Resource/Font
LD_LIBRARY_PATH: $SNAP/usr/lib/x86_64-linux-gnu

apps:
ocrmypdf:
command: usr/bin/snapcraft-preload python3 -m ocrmypdf
plugs:
- desktop
- desktop-legacy
- wayland
- x11
- home
- removable-media

parts:
snapcraft-preload:
source: https://github.com/sergiusens/snapcraft-preload.git
plugin: cmake
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr -DLIBPATH=/usr/lib
build-packages:
- on amd64:
- gcc-multilib
- g++-multilib
stage-packages:
- lib32stdc++6

ocrmypdf:
plugin: python
source: https://github.com/ocrmypdf/OCRmyPDF.git

stage-packages:
- ghostscript
- icc-profiles-free
- liblept5
- libxml2
- pngquant
- tesseract-ocr-all
- unpaper
- qpdf
- zlib1g

python-packages:
- cffi
- pdfminer.six
- pikepdf
- Pillow
- pluggy
- reportlab
- setuptools
- tqdm
- pipe

override-build: |
snapcraftctl build
ln -sf ../usr/lib/libsnapcraft-preload.so $SNAPCRAFT_PART_INSTALL/lib/libsnapcraft-preload.so

0 comments on commit ee81f39

Please sign in to comment.