diff --git a/buildScripts/assembleAppImage b/buildScripts/assembleAppImage deleted file mode 100755 index e48c1fe..0000000 --- a/buildScripts/assembleAppImage +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# This bash script automates the creation of an AppImage for pdf2htmlEX -# It is based upon code taken from -# https://github.com/AppImage/pkg2appimage -# and -# https://github.com/AppImage/AppImages - -mkdir -p buildAppImage - -cd buildAppImage - -wget -q https://github.com/AppImage/AppImages/raw/master/functions.sh \ - -O ./functions.sh - -. ./functions.sh - -apt download -y apt libapt-pkg5.0 libbz2-1.0 liblzma5 \ - multiarch-support zlib1g dpkg - -mkdir -p pdf2htmlEX.AppImage - diff --git a/buildScripts/buildPoppler b/buildScripts/buildPoppler index c9e6a98..458697b 100755 --- a/buildScripts/buildPoppler +++ b/buildScripts/buildPoppler @@ -5,6 +5,6 @@ cd poppler mkdir build cd build -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \ +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \ -DENABLE_LIBOPENJPEG=none .. make -j `nproc` diff --git a/buildScripts/createAppImage b/buildScripts/createAppImage new file mode 100755 index 0000000..f6abbc1 --- /dev/null +++ b/buildScripts/createAppImage @@ -0,0 +1,26 @@ +#!/bin/bash + +# This bash script creates an AppImage for pdf2htmlEX + + +mkdir -p imageBuild/pdf2htmlEX.AppDir + +cd pdf2htmlEX/build + +sudo rm -rf install_manifest.txt + +make install DESTDIR=../../imageBuild/pdf2htmlEX.AppDir + +cd ../../imageBuild + +wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + +chmod a+x linuxdeploy-x86_64.AppImage + +./linuxdeploy-x86_64.AppImage \ + -e pdf2htmlEX.AppDir/usr/bin/pdf2htmlEX \ + --create-desktop-file \ + -i ../pdf2htmlEX/logo/pdf2htmlEX.svg \ + --appdir=pdf2htmlEX.AppDir \ + --output appimage + diff --git a/buildScripts/doItAll b/buildScripts/doItAll new file mode 100755 index 0000000..e18b385 --- /dev/null +++ b/buildScripts/doItAll @@ -0,0 +1,26 @@ +#!/bin/bash + +# This bash script builds the complete pdf2htmlEX application LOCALLY +# (It does not create the AppImage or Docker images) + +export UNATTENDED=--assume-yes + +getBuildTools + +getDevLibraries + +getPoppler + +buildPoppler + +installPoppler + +getFontForge + +buildFontForge + +installFontForge + +buildPdf2htmlEX + +installPdf2htmlEX diff --git a/buildScripts/installFontforge b/buildScripts/installFontforge index e5eb120..77c2058 100755 --- a/buildScripts/installFontforge +++ b/buildScripts/installFontforge @@ -1,31 +1,16 @@ #!/bin/bash -echo "WARNING: this will over-write any existing" -echo "FontForge version you have installed on your system." -echo "This may break other packages/applications." -echo "" -echo "This installation assumes you have 'sudo' privileges." -echo "" -echo "Type ctrl-c now if DO NOT want to continue" -read -p "Type anything else to continue: " +if [ -z "$UNATTENDED" ] ; then + echo "WARNING: this may over-write any existing" + echo "FontForge version you have installed on your system." + echo "This may break other packages/applications." + echo "" + echo "This installation assumes you have 'sudo' privileges." + echo "" + echo "Type ctrl-c now if DO NOT want to continue" + read -p "Type anything else to continue: " +fi cd fontforge sudo make install sudo ldconfig; - -#cd -# -#sudo mkdir -p /usr/include/poppler -#sudo cp poppler/poppler/*.h /usr/include/poppler -# -#sudo mkdir -p /usr/include/poppler/goo -#sudo cp poppler/goo/*.h /usr/include/poppler/goo -# -#sudo mkdir -p /usr/include/poppler/fofi -#sudo cp poppler/fofi/*.h /usr/include/poppler/fofi -# -#sudo mkdir -p /usr/include/poppler/splash -#sudo cp poppler/splash/*.h /usr/include/poppler/splash -# -#sudo cp poppler/build/poppler/poppler-config.h \ -# /usr/include/poppler diff --git a/buildScripts/installPdf2htmlEX b/buildScripts/installPdf2htmlEX index 4102e29..4193c6b 100755 --- a/buildScripts/installPdf2htmlEX +++ b/buildScripts/installPdf2htmlEX @@ -1,8 +1,9 @@ #!/bin/bash -if [[ $# -eq 0 ]] ; then +if [ -z "$UNATTENDED" ] ; then echo "This installation assumes you have 'sudo' privileges" + echo "" echo "Type ctrl-c now if DO NOT want to continue" read -p "Type anything else to continue: " diff --git a/buildScripts/installPoppler b/buildScripts/installPoppler index 6b5f540..ec97f26 100755 --- a/buildScripts/installPoppler +++ b/buildScripts/installPoppler @@ -2,31 +2,34 @@ # This bash script installs Poppler into the local system -echo "WARNING: this will over-write any existing" -echo "Poppler version you have installed on your system." -echo "This may break other packages/applications." -echo "" -echo "This installation assumes you have 'sudo' privileges." -echo "" -echo "Type ctrl-c now if DO NOT want to continue" -read -p "Type anything else to continue: " + +if [ -z "$UNATTENDED" ] ; then + echo "WARNING: this may over-write any existing" + echo "Poppler version you have installed on your system." + echo "This may break other packages/applications." + echo "" + echo "This installation assumes you have 'sudo' privileges." + echo "" + echo "Type ctrl-c now if DO NOT want to continue" + read -p "Type anything else to continue: " +fi cd poppler/build sudo make install cd .. -sudo mkdir -p /usr/include/poppler -sudo cp poppler/*.h /usr/include/poppler +sudo mkdir -p /usr/local/include/poppler +sudo cp poppler/*.h /usr/local/include/poppler -sudo mkdir -p /usr/include/poppler/goo -sudo cp goo/*.h /usr/include/poppler/goo +sudo mkdir -p /usr/local/include/poppler/goo +sudo cp goo/*.h /usr/local/include/poppler/goo -sudo mkdir -p /usr/include/poppler/fofi -sudo cp fofi/*.h /usr/include/poppler/fofi +sudo mkdir -p /usr/local/include/poppler/fofi +sudo cp fofi/*.h /usr/local/include/poppler/fofi -sudo mkdir -p /usr/include/poppler/splash -sudo cp splash/*.h /usr/include/poppler/splash +sudo mkdir -p /usr/local/include/poppler/splash +sudo cp splash/*.h /usr/local/include/poppler/splash sudo cp build/poppler/poppler-config.h \ - /usr/include/poppler + /usr/local/include/poppler diff --git a/buildScripts/pdf2htmlEX.desktop b/buildScripts/pdf2htmlEX.desktop deleted file mode 100644 index 81f4508..0000000 --- a/buildScripts/pdf2htmlEX.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=pdf2htmlEX -Comment=pdf2htmlEX -Exec=/usr/local/bin/pdf2htmlEX -Icon=/usr/local/share/pdf2htmlEX/pdf2htmlEX-64x64 -Categories=Office; -Terminal=false -StartupNotify=false -X-AppImage-Version=try1 diff --git a/pdf2htmlEX/src/pdf2htmlEX.cc b/pdf2htmlEX/src/pdf2htmlEX.cc index bdc56aa..d08bc6c 100644 --- a/pdf2htmlEX/src/pdf2htmlEX.cc +++ b/pdf2htmlEX/src/pdf2htmlEX.cc @@ -368,6 +368,13 @@ int main(int argc, char **argv) param.data_dir = PDF2HTMLEX_DATA_PATH; #endif + if (getenv("APPDIR")) { + // we are running inside an AppImage so we need to adjust the data_dir + // however the user can supply some other absolute path later + // + param.data_dir = string(getenv("APPDIR")) + param.data_dir; + } + parse_options(argc, argv); check_param();