Andrea incorporated Igor Proxy warning + bdwrite appimage
[goodguy/cin-manual-latex.git] / parts / Developer.tex
index 82f131726c97514257c1b9334d5f4e50a96c7ba3..43a43cd7270fc2850302413075a667e39b473a59 100644 (file)
@@ -98,11 +98,11 @@ FFmpeg is a \textit{strongly connected} component in the build linkage and widel
        \item \texttt{./configure} {\dots}
 \end{itemize}
 
-Specific information on using the current ffmpeg GIT repository follows.  You have to supply the actual URL location of the ffmpeg git as you can see in this example \texttt{?bld.sh?} script:
+Specific information on using the current ffmpeg GIT repository follows.  You have to supply the actual URL location of the ffmpeg git as you can see in this example \texttt{bld.sh} script:
 
 \begin{lstlisting}[numbers=none]
-#!/bin/bash\newline
-() ./autogen.sh\newline
+#!/bin/bash
+./autogen.sh
 ./configure --with-single-user --with-booby --with-git-ffmpeg=https://git.ffmpeg.org/ffmpeg.git
 make && make install ) 2>1 | tee log
 mv Makefile Makefile.cfg
@@ -657,6 +657,134 @@ The summary line above in Bold represents the User time, System time, Real time
 
 So why use a Profiler? Because it is the ``ls'' for executable functions!!
 
+\section{Working on AppImage}
+\label{sec:working_on_appimage}
+
+You can work on the appimage file to make changes and fix errors, or you can create a new appimage from scratch containing customizations. For example, you can add new rendering presets, update the Context-Help, change libraries that are no longer supported by the current distro, or make other modifications.
+
+\subsection{Managing AppImage}
+\label{sub:managing_appimage}
+\index{appimage!management}
+
+A limitation of using AppImage instead of installing the binary or compiling from git, is that there is only a single file without the ability to browse the directory structure or to look for files to edit or check. So if using \CGG{} leads to some errors, it is not possible to investigate and fix the problem. Which means if you want to add the most up-to-date Context-Help or want to introduce some custom presets, that can not be done.
+
+Because the appimage file is nothing more than a compressed file containing the same structure as the installed program plus other libraries that allow the program to run independently from the system, the content can be extracted so that you can work on it as you would have on the normally installed program.  To do this you will need the appimage management program.
+Many Linux distros come with this managment program by default, but others may not. For instance in the case of Arch Linux the \texttt{appimagetool-bin} package from AUR needs to be installed. 
+
+To work on the appimage, first unpack it using the command\protect\footnote{Example provided by Glitterball3}:
+
+\begin{lstlisting}[numbers=none]
+       /{path to appimage}/CinGG-yyyymmdd.AppImage --appimage-extract
+\end{lstlisting}
+
+You will now have a \texttt{squashfs-root} folder in your current directory containing \texttt{/usr/bin/} as well as other files and directories such as \texttt{/usr/lib} and \texttt{/usr/share}. \texttt{Bin} is the folder similar to the one installed with \CGG{} and contains the files that you can work on. Now it is possible to make changes like adding a custom preset in \texttt{/ffmpeg/video} or replacing a library that no longer works with a more recent version by working in \texttt{/squashfs-root/usr/lib}.
+
+To start the unpacked program from the bin folder use the command:
+
+\begin{lstlisting}[numbers=none]
+       /{path to appimage}/squashfs-root/usr/bin/./cin
+\end{lstlisting}
+
+After making your changes, to get back to having an appimage file instead of having to run the program from the bin folder, you can take the extra step of recompressing the squashfs-root folder.
+To do so use linuxdeploy's appimage, a program that can also be useful for creating appimages from scratch (\url{https://github.com/linuxdeploy/linuxdeploy/releases/continuous}).
+
+The steps to recreate the appimage are:
+
+\begin{enumerate}
+       \item Copy the linuxdeploy appimage to \texttt{/\{path to appimage\}} and make sure it is executable.
+       \item Then use the command:
+       \begin{lstlisting}[numbers=none]
+               ./linuxdeploy-x86_64.AppImage --appdir squashfs-root --output appimage
+       \end{lstlisting}
+\end{enumerate}
+
+A new appimage will be created like the original but containing the changes.
+
+Alternatively, download the \texttt{appimagetool} version from \url{https://github.com/AppImage/AppImageKit/releases} if available for your distro and use the command:
+
+\begin{lstlisting}[numbers=none]
+       ./appimagetool --comp /{path to appimage}/squashfs-root /tmpCinGG-yyyymmdd.AppImage
+\end{lstlisting}
+
+Now there will be an appimage called \textit{CinGG-yyyymmdd.AppImage} with the changes that were made.
+
+NOTE: for the \textbf{bdwrite} program which is used to create the udfs image to burn Blu-ray
+media (or any other standalone program), you will find it in the squashfs-root/usr/bin
+subdirectory. You only need to do the initial unpacking extract step and then just copy
+bdwrite and the entire squashfs-root/usr/lib directory to a convenient permanent place for
+usage.  Then when running bdwrite, you will have to first export the libary path by typing
+this command in the window first:
+\begin{lstlisting}[numbers=none]
+export LD_LIBRARY_PATH=/{put your copied usr/lib path here}:$LD_LIBRARY_PATH
+\end{lstlisting}
+
+\subsection{Build the CinGG.AppImage from scratch}
+\label{sub:built_appimage_scratch}
+\index{appimage!creating}
+
+If a developer wants to create an appimage from git, follow these next few steps. An existing automated script is available, \texttt{bld\_appimage.sh}, in the directory \texttt{/\{path to cinelerra-5.1\}}.
+
+This follows four steps:
+
+\begin{itemize}
+       \item Build static version of \CGG{}.
+       \item If desired and needed, build the HTML manual for context-sensitive help.
+       \item Organize code and if present, the manual, in a AppImage specific format \textit{AppDir}. Do this with tool makeappimage, which is built if needed.
+       \item Call an external tool to make the AppDir into an AppImage
+\end{itemize}
+
+Start by downloading the \CGG{} source from Cinelerra's git. The last parameter is a directory name of your choice, the directory must not exist. As example, the name \textit{cinelerra5} is used.
+
+\begin{lstlisting}[numbers=none]
+       git clone --depth 1 "git://git.cinelerra-gg.org/goodguy/cinelerra.git" cinelerra5
+\end{lstlisting}
+
+The source will be in a subdirectory \texttt{cinelerra-5.1} of the directory created by the \textit{git clone} operation.
+
+If context-sensitive help is needed, download the manual sources too, with a different destination directory.
+
+\begin{lstlisting}[numbers=none]
+       git clone --depth 1 "git://git.cinelerra-gg.org/goodguy/cin-manual-latex.git" cin-manual-latex
+\end{lstlisting}
+
+Then move to the \texttt{/\{path to cinelerra-5.1}/\} directory.
+
+
+There are two preliminaries to do before running the script:
+
+1- If context sensitive help in the appimage version is required, the source of the manual and the tools (packages) to build it must be on the system. In the bld\_appimage.sh script, set the variable \texttt{MANUAL\_DIRECTORY=\$(pwd)/../../ cin-manual-latex} to the path of the source of the manual. If the variable is empty, or the specified directory does not exist, \CGG{} will be built without built-in help. The path to the manual source can be an absolute or relative one.
+
+2- The script bld\_appimage.sh uses a platform specific version of appimagetool so that it can create appimages for \textit{x86\_64}, \textit{i686}, \textit{aarch64}, or \textit{armv7l} architecture. We need to add appimagetool-(platform).AppImage to the \texttt{/\{path to cinelerra- 5.1\}/tools} directory, or somewhere in your path. You can download the tool for your system (e.g. appimagetool-x86\_64.AppImage) from git: {\small\url{https://github.com/AppImage/AppImageKit/releases}}
+
+Always remember to make it executable. The four supported platforms are:
+
+\begin{itemize}
+       \item appimagetool-aarch64.AppImage
+       \item appimagetool-armhf.AppImage
+       \item appimagetool-i686.AppImage
+       \item appimagetool-x86\_64.AppImage
+\end{itemize}
+
+With the preparations done, let's go back to the bld\_appimage.sh script.
+
+Make the script executable if it isn't already:
+
+\begin{lstlisting}[numbers=none]
+chmod x+u bld_appimage.sh
+\end{lstlisting}
+
+Start the script with:
+
+\begin{lstlisting}[numbers=none]
+./bld_appimage.sh
+\end{lstlisting}
+
+The first part of the script customizes \texttt{configure}, depending on the architecture of our system. The next step compiles and installs \CGG{} in the \texttt{bin} subdirectory. The third part creates the manual in HTML; It will be the basis for the context help (see \nameref{sec:help_context_help}). The fourth part creates the directory \texttt{/AppDir/usr}, which is the basic structure of an appimage, and then populates it with the contents of \texttt{/\{path to cinelerra-5.1\}/bin}. Finally, the fifth step starts a script, called \texttt{makeappimage}, which points to \textit{bld.sh} contained in \texttt{/tools/makeappimagetool/}.
+
+The script specifies all executables that are part of \CGG{}, so makeappimage can pick up dependencies. Any executable code in other places is not picked up. makeappimage will populate the AppDir directory, and then call the platform dependent appimagetool found in \texttt{/\{path to cinelerra-5.1\}/tools}.
+
+At the end of the compilation there will be an appimage in the \texttt{cinelerra-5.1} directory, which we can move and use.
+
 \section{How to Create a new Theme}
 \label{sec:how_create_theme}
 \index{theme!create new theme}
@@ -899,3 +1027,12 @@ For now, \CGG{} context help is not localized at all. There is no complete \CGG{
 More about ContextManual.pl file?
 
 The bin/doc/ContextManual.pl script can be configured further. Look in the script text. You can define your preferable web browser, or redefine it to 'echo' for debug purposes. There are also some predefined HTML pages for Contents and Index, and several explicitly rewritten keyphrases. 
+
+After the first invocation of context help the system-wide script, bin/doc/ContextManual.pl, copies itself into
+the user's config directory, \$HOME/.bcast5. If the user needs to modify ContextManual.pl, it should be done
+on that copy from .bcast5 rather than the system-wide one. On all subsequent context help requests this
+(possibly modified) .bcast5 version of the script will be called.  If later the \CGG{} package gets
+upgraded containing a newer, not 100\% compatible version of ContextManual.pl script, and/or not compatible
+structure of the HTML manual itself, the new system-wide version of the script will be copied into .bcast5
+again to ensure context help functionality. The older version of the script will be backed up (with the .bak
+suffix) as a reference of the modifications done by the user.