← Back to team overview

openshot.developers team mailing list archive

Packagin Update

 

I thought I'd let you know where I'm at.

I suspended testing of the openshot 'alpha' packages yesterday evening
because I got to the point where I was attempting to execute the
installed openshot.

It was failing because the Python package "mlt" (Debian: "python-mlt")
was not yet installed.

I spent today figuring out how to add the required make processing to
the mlt "debian/rules" Makefile.

The core of the issue is the Debian package being generated
("python-mlt") must (Debian policy) use python-support or similar - it
is not allowed to install binary objects directly into the
"/usr/lib/pythonX.Y/{site,dist}-packages/" directories.

This is done since user systems may have several Python versions
installed, and these will not be known at build-time. python-support
handles the logistics of matching the versions of the built binaries to
the end-users installed Python versions.

Now, python-support expects to be creating a 'pure' python package and
so the CDBS (Common Debian Build System) scripts used by the mlt package
that invoke python-support will try to operate against *every* binary
package declared in "debian/control" - not just selected 'python-only'
packages. This is a big problem since only "python-mlt" should be
processed this way.

The second issue is that the Python packaging system, distutils, is
designed to build binary libraries from C/C++ files for Python
Extensions automatically. In the case of "mlt" however it has its own
"src/swig/python/build" script (SWIG == Simplified Wrapper and Interface
Generator) which creates the binaries using certain constructs that
would be very difficult to transpose to a Python distutils.setup()
script.

The solution I developed was to create a new SWIG
"build-for-python-support" shell script that is called from CDBS
overrides in "debian/rules" only for the "python-mlt" package. These
ensure the created binary library and object files, and the python
script and egg-info, are put in the Debian temporary package-build
directories ("debian/python-mlt/").

I manually dissected the "python-adns" package to learn what the final
file payout for python-support should be, and extracted the Debian
"postinst" and "prerm" shell scripts, transposed them for "python-mlt",
and included them in the mlt "debian/" directory.

The end result is that "debian/rules" uses the existing mlt SWIG build
system to create the wrapper files and put them in the correct system
locations, and CDBS correctly builds the "python-mlt" package and
includes the python-support postinst and prerm scripts that are run on
the end-user's system at package install and removal, respectively.

Right now I'm optimising the code in "debian/rules" since I spotted some
redundant actions.

Once I'm happy I'll commit the new code my local "mlt" git repository
and then publish the updated package to my video-editors PPA.

I retested openshot with "python-mlt" installed and it didn't throw up
an error when importing "mlt" so that looks good. I have other openshot
errors to resolve in the launcher code before openshot will start and I
can test it properly.

At that point I'll publish a package to my PPA for you guys to install
and test to ensure it doesn't introduce any regression or bugs due to
the refactoring I've done to streamline the installation.




Follow ups