Commit 28aec2b5 authored by Andreas Tille's avatar Andreas Tille

New upstream version 7.2.7

parent 0e8545d6
......@@ -2,4 +2,7 @@
pdftoipe/pdftoipe
figtoipe/figtoipe
ipe5toxml/ipe5toxml
build
*.AppImage
AppImageKit
Ipe.AppDir
......@@ -2,7 +2,7 @@ ipe-tools
=========
These are various tools and helper programs to be used
with the Ipe drawing editor (http://ipe7.sf.net)
with the Ipe drawing editor (http://ipe.otfried.org).
svgtoipe.py
......
annotate.py
==========
This Python script takes a PDF file and creates an Ipe document that
shows the pages of the PDF page by page, allowing you to annotate the
PDF document, for instance using ink mode on a tablet or by simply
creating new text objects.
To run it, you will need the *PyPDF2* library from
https://github.com/mstamy2/PyPDF2. The easiest way to install
*PyPDF2* is using PIP - on Linux it will suffice to say
```
apt-get install python3-pip
pip3 install PyPDF2
```
(Or, if using Python~2, install `python-pip` and call `pip`.)
Run it with a PDF file as an argument:
```
python3 annotate.py doc.pdf
```
It will create the new file `annotate-doc.ipe`.
When opening `annotate-doc.ipe` using Ipe, you will need to have the
original PDF file `doc.pdf` available for Ipe. You either have to
copy it into Ipe's Latex directory (e.g. `~/.ipe/latexrun`), or you
have to set the `TEXINPUTS` environment variable.
#
# Create an Ipe file including pages of given PDF document
#
import sys, os
import PyPDF2 as pdf
# --------------------------------------------------------------------
def create_ipe(pdffile):
i = pdffile.rfind("/")
if i >= 0:
outfile = pdffile[i+1:]
else:
outfile = pdffile
if outfile.endswith(".pdf"):
outfile = outfile[:-4]
outfile = "annotate-" + outfile + ".ipe"
doc = pdf.PdfFileReader(pdffile)
numPages = doc.numPages
out = open(outfile, "w")
out.write("""<ipe version="70205">
<preamble>\\usepackage{graphicx}
</preamble>
<ipestyle name="basic">
</ipestyle>
""")
for i in range(numPages):
out.write("""<page>
<layer name="alpha"/>
<layer name="pdf" edit="no"/>
<text pos="0 0" layer="pdf">\includegraphics[page=%d]{%s}</text>
</page>\n""" % (i+1, pdffile))
out.write("</ipe>\n")
out.close()
os.system("ipescript update-styles %s" % outfile)
# --------------------------------------------------------------------
if len(sys.argv) != 2:
sys.stderr.write("Usage: python annotate.py <document.pdf>\n")
sys.exit(9)
pdffile = sys.argv[1]
create_ipe(pdffile)
# --------------------------------------------------------------------
[Desktop Entry]
Type=Application
Name=Ipe
GenericName=drawing program
Icon=ipe.png
Exec=startipe.sh
Terminal=false
Categories=Graphics;
This diff is collapsed.
# Ipe AppImage recipe
This is a recipe for building an [AppImage](http://appimage.org/) for
Ipe, based on the [fantastic work of Thomas
Leitz](https://github.com/unruhschuh/Ipe.AppImage) - I only tinkered
with a few details and added the Voronoi ipelet and pdftoipe.
Ipe requires `pdflatex` to be installed in order to render text
elements. It is not included in the AppImage so you need to have a
LaTeX distribution installed on your system. You can find informations
about LaTeX and how to install it at
[www.tug.org](https://www.tug.org/).
## Download
* [Download](https://bintray.com/otfried/generic/ipe#files/ipe) the
latest AppImage for Ipe
* Make the AppImage executable, e.g. in the terminal run
`chmod a+x ipe-x.y.z-x86_64.AppImage`
## How to use the Ipe AppImage
* To start Ipe, just click on the AppImage file.
* You can also start Ipe from the command line by executing the AppImage:
```
$ ./ipe-7.2.6-x86_64.AppImage
```
* If you want to use the Ipe command line tools, such as `ipetoipe`, `iperender`, `ipescript`, just prefix the command with the AppImage:
```
$ ./ipe-7.2.6-x86_64.AppImage ipetoipe -pdf ~/test.ipe
```
* If you want to start Ipe with a command line argument, proceed as for the tools:
```
$ ./ipe-7.2.6-x86_64.AppImage ipe -sheet presentation ~/mytalk.pdf
```
Note that you will have to use **absolute filenames** in the arguments
to the command line tools, because the AppImage changes directory
before executing the code.
## How to create an AppImage for Ipe
The AppImage for Ipe is created inside a fresh installation of CentOS
6.7. In order to build the AppImage follow these steps
* Install CentOS 6.7 either on a PC or inside VirtualBox or any other
virtualization program.
* Start the Terminal and run `git clone https://github.com/otfried/ipe-tools`
* Change directory with `cd ipe-tools/appimage`
* Download and compile the needed tools and libraries with
`./setup.sh`.
* Start Ipe compilation and packaging process with `./recipe.sh`.
This creates `ipe-7.x.y-x86_64.AppImage` inside the current directory.
-- Special settings for the Ipe appimage
prefs.browser = "unset XDG_DATA_DIRS && unset LD_LIBRARY_PATH && xdg-open %s"
#!/bin/bash
# Halt on errors
set -e
#scl enable devtoolset-2
source /opt/rh/devtoolset-2/enable
BASE=`pwd`
IPE=ipe-7.2.6
APP_DIR=$BASE/Ipe.AppDir
APP_IMAGE=$BASE/$IPE-x86_64.AppImage
# Cleanup
rm -fr build
rm -fr $APP_DIR $APP_IMAGE
######################################################
# create AppDir
######################################################
mkdir $APP_DIR
mkdir -p $APP_DIR/usr/bin/platforms
mkdir -p $APP_DIR/usr/lib/qt5
# Change directory to build. Everything happens in build.
mkdir -p build
######################################################
# Build Ipe
######################################################
cd $BASE/build
if [ "x$1" == "xlocal" ]; then
echo "Using local copy of Ipe sources"
cp $HOME/$IPE-src.tar.gz .
else
echo "Downloading Ipe sources"
wget https://dl.bintray.com/otfried/generic/ipe/7.2/$IPE-src.tar.gz
fi
tar xfvz $IPE-src.tar.gz
#mkdir $IPE
#rsync -trvz --delete --exclude=.git --exclude=build/obj --exclude=build/Ipe.app $SOURCE_HOST:Devel/ipe/ $IPE/
cd $IPE/src
export QT_SELECT=5
export MOC=moc-qt5
# use libpng16
export PNG_CFLAGS="-I\/usr\/local\/include\/libpng16"
export PNG_LIBS="-lpng16"
export LUA_CFLAGS="-I/usr/local/include"
export LUA_LIBS="-L/usr/local/lib -llua -lm"
export QHULL_CFLAGS="-I/usr/local/include/qhull"
export QHULL_LIBS="-lqhullstatic"
export IPEPREFIX=$APP_DIR/usr
export IPEQVORONOI=1
make IPEAPPIMAGE=1
make install IPEAPPIMAGE=1
######################################################
# Build pdftoipe
######################################################
cd $BASE/build
cp -r $BASE/../pdftoipe .
cd pdftoipe
make
install -m 0755 pdftoipe $APP_DIR/usr/bin
######################################################
# Build exec wrapper (for calling subprocesses)
######################################################
#cd $BASE/build
#git clone git://anongit.kde.org/scratch/brauch/appimage-exec-wrapper.git
#cd appimage-exec-wrapper
#make
#install -m 0755 exec.so $APP_DIR/usr/lib/
######################################################
# Populate Ipe.AppDir
######################################################
cd $BASE
cp AppImageKit/AppRun $APP_DIR
cp ipe.png $APP_DIR
cp Ipe.desktop $APP_DIR
cp startipe.sh $APP_DIR/usr/bin
cp appimage.lua $APP_DIR/usr/ipe/ipelets
cp -R /usr/lib64/qt5/plugins $APP_DIR/usr/lib/qt5/
cp $APP_DIR/usr/lib/qt5/plugins/platforms/libqxcb.so $APP_DIR/usr/bin/platforms/
set +e
ldd $APP_DIR/usr/lib/qt5/plugins/platforms/libqxcb.so | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' $APP_DIR/usr/lib
ldd $APP_DIR/usr/bin/* | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' $APP_DIR/usr/lib
find $APP_DIR/usr/lib -name "*.so*" | xargs ldd | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' $APP_DIR/usr/lib
set -e
cp /usr/local/lib/libjpeg.so.8 $APP_DIR/usr/lib
cp /usr/local/lib/libpng16.so.16 $APP_DIR/usr/lib/
cp $(ldconfig -p | grep libEGL.so.1 | cut -d ">" -f 2 | xargs) $APP_DIR/usr/lib/ # Otherwise F23 cannot load the Qt platform plugin "xcb"
# this prevents "symbol lookup error libunity-gtk-module.so: undefined symbol: g_settings_new" on ubuntu 14.04
rm -f $APP_DIR/usr/lib/qt5/plugins/platformthemes/libqgtk2.so || true
rmdir $APP_DIR/usr/lib/qt5/plugins/platformthemes || true # should be empty after deleting libqgtk2.so
rm -f $APP_DIR/usr/lib/libgio* || true # these are not needed if we don't use gtk
# Removed unused parts of Qt
rm -f $APP_DIR/usr/lib/libQt5PrintSupport.so.5 || true
rm -f $APP_DIR/usr/lib/libQt5Network.so.5 || true
rm -f $APP_DIR/usr/lib/libQt5Sql.so.5 || true
# Delete potentially dangerous libraries
rm -f $APP_DIR/usr/lib/libstdc* $APP_DIR/usr/lib/libgobject* $APP_DIR/usr/lib/libc.so.* || true
# The following are assumed to be part of the base system
rm -f $APP_DIR/usr/lib/libgtk-x11-2.0.so.0 || true # this prevents Gtk-WARNINGS about missing themes
rm -f $APP_DIR/usr/lib/libdbus-1.so.3 || true # this prevents '/var/lib/dbus/machine-id' error on fedora 22/23 live cd
rm -f $APP_DIR/usr/lib/libGL.so.* || true
rm -f $APP_DIR/usr/lib/libdrm.so.* || true
rm -f $APP_DIR/usr/lib/libxcb.so.1 || true
rm -f $APP_DIR/usr/lib/libX11.so.6 || true
rm -f $APP_DIR/usr/lib/libcom_err.so.2 || true
rm -f $APP_DIR/usr/lib/libcrypt.so.1 || true
rm -f $APP_DIR/usr/lib/libdl.so.2 || true
rm -f $APP_DIR/usr/lib/libexpat.so.1 || true
rm -f $APP_DIR/usr/lib/libfontconfig.so.1 || true
rm -f $APP_DIR/usr/lib/libgcc_s.so.1 || true
rm -f $APP_DIR/usr/lib/libglib-2.0.so.0 || true
rm -f $APP_DIR/usr/lib/libgpg-error.so.0 || true
rm -f $APP_DIR/usr/lib/libgssapi_krb5.so.2 || true
rm -f $APP_DIR/usr/lib/libgssapi.so.3 || true
rm -f $APP_DIR/usr/lib/libhcrypto.so.4 || true
rm -f $APP_DIR/usr/lib/libheimbase.so.1 || true
rm -f $APP_DIR/usr/lib/libheimntlm.so.0 || true
rm -f $APP_DIR/usr/lib/libhx509.so.5 || true
rm -f $APP_DIR/usr/lib/libICE.so.6 || true
rm -f $APP_DIR/usr/lib/libidn.so.11 || true
rm -f $APP_DIR/usr/lib/libk5crypto.so.3 || true
rm -f $APP_DIR/usr/lib/libkeyutils.so.1 || true
rm -f $APP_DIR/usr/lib/libkrb5.so.26 || true
rm -f $APP_DIR/usr/lib/libkrb5.so.3 || true
rm -f $APP_DIR/usr/lib/libkrb5support.so.0 || true
# rm -f $APP_DIR/usr/lib/liblber-2.4.so.2 || true # needed for debian wheezy
# rm -f $APP_DIR/usr/lib/libldap_r-2.4.so.2 || true # needed for debian wheezy
rm -f $APP_DIR/usr/lib/libm.so.6 || true
rm -f $APP_DIR/usr/lib/libp11-kit.so.0 || true
rm -f $APP_DIR/usr/lib/libpcre.so.3 || true
rm -f $APP_DIR/usr/lib/libpthread.so.0 || true
rm -f $APP_DIR/usr/lib/libresolv.so.2 || true
rm -f $APP_DIR/usr/lib/libroken.so.18 || true
rm -f $APP_DIR/usr/lib/librt.so.1 || true
rm -f $APP_DIR/usr/lib/libsasl2.so.2 || true
rm -f $APP_DIR/usr/lib/libSM.so.6 || true
rm -f $APP_DIR/usr/lib/libusb-1.0.so.0 || true
rm -f $APP_DIR/usr/lib/libuuid.so.1 || true
rm -f $APP_DIR/usr/lib/libwind.so.0 || true
rm -f $APP_DIR/usr/lib/libz.so.1 || true
# patch hardcoded '/usr/lib' in binaries away
find $APP_DIR/usr/ -type f -exec sed -i -e 's|/usr/lib|././/lib|g' {} \;
######################################################
# Create AppImage
######################################################
# Convert the AppDir into an AppImage
$BASE/AppImageKit/AppImageAssistant.AppDir/package $APP_DIR/ $APP_IMAGE
#!/bin/bash
#
# Download and install all prerequisites for making the Ipe AppImage
#
# Halt on errors
set -e
######################################################
# install packages
######################################################
# epel-release for newest Qt and stuff
sudo yum -y install epel-release
sudo yum -y install readline-devel zlib-devel cairo-devel
sudo yum -y install cmake binutils fuse glibc-devel glib2-devel fuse-devel gcc zlib-devel # AppImageKit dependencies
sudo yum -y install poppler-devel
# Need a newer gcc, getting it from Developer Toolset 2
sudo wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
sudo yum -y install devtoolset-2-gcc devtoolset-2-gcc-c++ devtoolset-2-binutils
# /opt/rh/devtoolset-2/root/usr/bin/gcc
# now holds gcc and c++ 4.8.2
#scl enable devtoolset-2
source /opt/rh/devtoolset-2/enable
######################################################
# Install Qt
######################################################
#wget http://download.qt.io/official_releases/online_installers/qt-unified-linux-x86-online.run
#chmod +x qt-unified-linux-x86-online.run
#./qt-unified-linux-x86-online.run --script qt-installer-noninteractive.qs
# wget http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-linux-x64-5.5.1.run
# chmod +x qt-opensource-linux-x64-5.5.1.run
# ./qt-opensource-linux-x64-5.5.1.run --script qt-installer-noninteractive.qs
sudo yum -y install qt5-qtbase-devel qt5-qtbase-gui
# qt5-qtlocation-devel qt5-qtscript-devel qt5-qtwebkit-devel qt5-qtsvg-devel qt5-linguist qt5-qtconnectivity-devel
######################################################
# build libraries from source
######################################################
# Change directory to build. Everything happens in build.
mkdir build
cd build
# libjpeg
wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz
tar xfvz jpegsrc.v8d.tar.gz
cd jpeg-8d
./configure && make && sudo make install
cd ..
# lua
wget http://www.lua.org/ftp/lua-5.3.3.tar.gz
tar xfvz lua-5.3.3.tar.gz
cd lua-5.3.3/src
#sed -i 's/^CFLAGS=/CFLAGS= -fPIC /g' Makefile
cd ..
make linux CFLAGS="-fPIC"
sudo make install
cd ..
# libpng
wget http://download.sourceforge.net/libpng/libpng-1.6.21.tar.gz
tar xfvz libpng-1.6.21.tar.gz
cd libpng-1.6.21
./configure
make check
sudo make install
cd ..
# qhull
wget http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz
tar xfvz qhull-2015-src-7.2.0.tgz
cd qhull-2015.2
make
sudo install -d /usr/local/include/qhull
sudo install -m 0644 src/libqhull/*.h /usr/local/include/qhull
sudo install -m 0755 lib/libqhullstatic.a /usr/local/lib
cd ..
######################################################
# Build AppImageKit (into top level)
######################################################
cd ..
git clone https://github.com/probonopd/AppImageKit.git
cd AppImageKit/
git checkout master
cmake .
make clean
make
######################################################
#!/bin/bash
CMD=$1
if [ "x${CMD}x" == "xx" ]; then
ipe -style fusion "$@"
else
shift
$CMD "$@"
fi
......@@ -29,7 +29,7 @@ should then not expect a reply.
Alexander Bürger, acfb@users.sourceforge.net
Otfried Cheong, otfried@ipe.airpost.net
Ipe webpage: http://ipe7.sf.net
Ipe webpage: http://ipe.otfried.org
--------------------------------------------------------------------
......
__pycahce__/
out/
tmp.py
*.pyc
......@@ -17,7 +17,7 @@ Use it as an external backend from matplotlib like this:
# --------------------------------------------------------------------
from __future__ import division, print_function
from __future__ import division, print_function, unicode_literals
import os, base64, tempfile, urllib, gzip, io, sys, codecs, re
......@@ -45,7 +45,7 @@ negative_number = re.compile(u"^\u2212([0-9]+)(\.[0-9]*)?$")
rcParams.validate['ipe.textsize'] = validate_bool
rcParams.validate['ipe.stylesheet'] = validate_path_exists
rcParams.validate['ipe.preamble'] = lambda (s) : s
rcParams.validate['ipe.preamble'] = lambda s : s
# ----------------------------------------------------------------------
# SimpleXMLWriter class
......@@ -147,8 +147,7 @@ class XMLWriter:
if attrib or extra:
attrib = attrib.copy()
attrib.update(extra)
attrib = attrib.items()
attrib.sort()
attrib = sorted(attrib.items())
for k, v in attrib:
if not v == '':
k = escape_cdata(k)
......@@ -216,7 +215,7 @@ class XMLWriter:
# can be omitted.
def element(self, tag, text=None, attrib={}, **extra):
apply(self.start, (tag, attrib), extra)
self.start(*(tag, attrib), **extra)
if text:
self.data(text)
self.end(indent=False)
......@@ -255,15 +254,15 @@ class RendererIpe(RendererBase):
version=u"70005",
creator="matplotlib")
pre = rcParams.get('ipe.preamble', "")
if pre <> "":
if pre != "":
self.writer.start(u'preamble')
self.writer.data(pre)
self.writer.end(indent=False)
sheet = rcParams.get('ipe.stylesheet', "")
if sheet <> "":
if sheet != "":
self.writer.insertSheet(sheet)
self.writer.start(u'ipestyle', name=u"opacity")
for i in range(10,100,10):
self.writer.element(u'opacity', name=u'%02d%%'% i,
value=u'%g'% (i/100.0))
......@@ -494,8 +493,10 @@ class FigureCanvasIpe(FigureCanvasBase):
# Provide the standard names that backend.__init__ is expecting
class FigureManagerIpe(FigureManagerBase):
pass
def __init__(self, *args):
FigureManagerBase.__init__(self, *args)
FigureCanvas = FigureCanvasIpe
FigureManager = FigureManagerIpe
def new_figure_manager(num, *args, **kwargs):
......@@ -517,7 +518,7 @@ def _cleanup():
LatexManager._cleanup_remaining_instances()
# This is necessary to avoid a spurious error
# caused by the atexit at the end of the PGF backend
LatexManager.__del__ = lambda (self) : None
LatexManager.__del__ = lambda self : None
atexit.register(_cleanup)
......
......@@ -2,13 +2,14 @@
# Run all the tests in tests subdirectory
# and save plots in ipe and svg format
#
from __future__ import division, print_function, unicode_literals
import os, sys
def fix_file(f):
data = open("tests/%s" % f, "rb").readlines()
data = open("tests/%s" % f, "r").readlines()
os.rename("tests/%s" % f, "tests/%s.bak" % f)
out = open("tests/%s" % f, "wb")
out = open("tests/%s" % f, "w")
for l in data:
ll = l.strip()
if ll == "import matplotlib as mpl": continue
......@@ -30,13 +31,13 @@ def runall(form):
def run(form, f):
sys.stderr.write("# %s\n" % f)
t = open("tmp.py", "wb")
t = open("tmp.py", "w")
t.write("""# %s
import matplotlib as mpl
""" % f)
if form=="ipe":
t.write("mpl.use('module://backend_ipe')\n")
t.write(open("tests/%s.py" % f, "rb").read())
t.write(open("tests/%s.py" % f, "r").read())
t.write("plt.savefig('out/%s.%s', format='%s')\n" % (f, form, form))
t.close()
os.system("python tmp.py")
......
......@@ -16,9 +16,11 @@ else ifdef IPECROSS
LDFLAGS += -static
TARGET = pdftoipe.exe
else
CPPFLAGS += $(shell pkg-config --cflags poppler)
LIBS += $(shell pkg-config --libs poppler)
TARGET = pdftoipe
POPPLER_CFLAGS ?= $(shell pkg-config --cflags poppler)
POPPLER_LIBS ?= $(shell pkg-config --libs poppler)
CPPFLAGS += $(POPPLER_CFLAGS)
LIBS += $(POPPLER_LIBS)
TARGET = pdftoipe
endif
CXXFLAGS += -Wno-write-strings
......
......@@ -32,7 +32,7 @@ direct Email.
KAIST
Daejeon, South Korea
Email: otfried@ipe.airpost.net
Ipe webpage: http://ipe7.sourceforge.net
Ipe webpage: http://ipe.otfried.org
--------------------------------------------------------------------
......
# Ipe in a snap
Linux users suffer from the problem that Linux distributions provide
packages for rather old versions of Ipe. For instance, Ubuntu 16.04
still provides Ipe 7.1.10 (from late 2015). Distributions tend to be
conservative to ensure the stability of the system.
[**Snappy**](http://snapcraft.io) is a new system that provides apps
in *encapsulated blocks* called **snaps**. A bug in a snap does not
affect the robustness of the remaining sytem, and so users can freely
upgrade individual snaps at will. From now on, Ipe will provide an
up-to-date snap for each Ipe release, such that Linux users, like
Windows and OSX users, can upgrade easily and immediately.
Snappy is available on recent Linux distributions such as Ubuntu
16.04, etc. You install the system by installing the **snapd**
package. On Ubuntu or Debian, you would use
```
sudo apt-get install snapd
```
See http://snapcraft.io/docs/core/install for how to install Snapcraft
on other Linux distributions such as Fedora,
## Installing Ipe in a snap
Once you have the **snap** command on your system, you can install the
most recent version of Ipe by saying
```
sudo snap install ipe --edge
```
You can now start Ipe by simply saying `ipe` (which calls
`/snap/bin/ipe`). Note that the other Ipe commands are available as
`ipe.ipetoipe`, `ipe.iperender`, etc.
## How Ipe uses Pdflatex
Snappy isolates each snap to ensure the robustness of the system when
a snap misbehaves. This implies some severe restrictions: Ipe does
not have access to your system's files (with the exception of the
files in your home directory that do not start with a dot). In
particular, Ipe does not have access to the Latex installation on your
system!
To allow Ipe to run *pdflatex*, the Ipe snap contains a *small Texlive
installation*. You will need to remember this when Ipe fails to find
a Latex style or package. In this case, you will need to install the
Latex package **inside** the snap.
Note that the following commands are exposed by the snap to help you
find Latex problems: `ipe.pdflatex`, `ipe.lualatex`, `ipe.kpsewhich`.
## Installing additional Latex packages
You cannot actually add additional Latex packages to the Texlive
installation inside a snap, as snaps reside entirely in read-only
memory. However, Ipe's Latex installation can use a *user tree* where
you can add additional styles and fonts. To install into this user
tree, you run the *texlive manager* `tlmgr` contained in the snap.
For technical reasons, it has to be run from outside the snap, like
this:
```
/snap/ipe/current/bin/tlmgr install dante-logo
```
## What doesn't work?
* The Ipe icon is not shown on the desktop (apparently a bug in
snappy).
* Opening the manual from the Ipe Help menu currently doesn't work
(apparently a bug in snappy). You can read the manual by opening
the file `/snap/ipe/current/ipe/doc/manual.html`.
* Declaring an external editor doesn't work. This is currently a
fundamental limitation of snappy (Ipe has no access to running an
editor program that lives outside the snap).
## Anything else?
If you want to customize Ipe, you will need to know that some files
are in locations different from a classic Linux setup. Use *Show
configuration* in the Help menu to find the right place. For
instance, Ipe runs Latex in `~/snap/ipe/current/latexrun` (rather than
`~/.ipe/latexrun`), and the ipelet directory is
`~/snap/ipe/common/ipelets` rather than `~/.ipe/ipelets`.
#!/bin/sh
SNAP="/snap/ipe/current"
COMMAND=$1
shift
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu"
exec $SNAP/bin/$COMMAND $@
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
import os
from subprocess import Popen, PIPE
import snapcraft
from snapcraft.plugins import dump
extras = [ "xcolor", "tcolorbox", "pgf", "ms", "environ", "pgfplots",
"metalogo", "trimspaces", "etoolbox" ]
class TexLivePlugin(snapcraft.plugins.dump.DumpPlugin):
def build(self):
super(dump.DumpPlugin, self).build()
# Install TexLive with the standard installer
env = self._build_environment()
p1 = Popen(['echo', '-n', 'I'], env=env, stdout=PIPE)
p2 = Popen(['{}/install-tl'.format(self.builddir), '-portable', '-scheme', 'basic'], env=env, stdin=p1.stdout, stdout=PIPE)
output = p2.communicate()[0]
self.run(['{}/texlive/bin/x86_64-linux/tlmgr'.format(self.installdir),
'install'] + extras, env=env)
def _build_environment(self):
env = os.environ.copy()
env['TEXLIVE_INSTALL_PREFIX'] = os.path.join(self.installdir, 'texlive')
return env