Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not installing for a user, not installing for root, but packaging for a Linux distro #724

Closed
xyproto opened this issue May 28, 2020 · 3 comments
Labels
bug A problem, flaw, or broken functionality. build issues building OTIO

Comments

@xyproto
Copy link

xyproto commented May 28, 2020

Hi,

I'm trying to package OpenTimelineIO for Arch Linux.

Looking at setup.py and the CMake files, it looks like OpenTimelineIO (python files that go in site-packages + C++ include files + libraries) is meant to be installed either into /home somewhere for a user, or directly onto the system into / somewhere. However, when packaging for a Linux distro there are slightly different needs, since files needs to be able to be packaged into a directory that will later be installed to /. Usually, this can be solved by flags to setup.py or flags to cmake, but I was not successful in convincing OpenTimelineIO to install to a directory, meant for being installed to the system root later.

Is there a flag I have overlooked?

Here is my best attempt so far, at a WIP PKGBUILD file. I assume the intention is that only setup.py or cmake should be called, but I tried a few different things.

# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>

pkgname=python-opentimelineio
pkgver=0.12.1
pkgrel=1
pkgdesc='API and interchange format for editorial timeline information'
arch=(any)
license=('APACHE')
makedepends=(cmake git python-pip python-setuptools setconf)
url='https://github.com/PixarAnimationStudios/OpenTimeLineIO'
source=("git+$url#commit=cc9c067cf8482d9e703c480f31df9d22198d076a") # tag: v0.12.1
md5sums=(SKIP)

prepare() {
  setconf OpenTimeLineIO/setup.py _ctx.cxx_install_root "'""$pkgdir""'"
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  setconf OpenTimeLineIO/setup.py _ctx.install_usersite "'""$pkgdir$site_packages""'"
}

build() {
  mkdir -p build
  cd build
  cmake "$srcdir/OpenTimeLineIO" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_C_FLAGS="$CFLAGS -fPIC -w" \
    -DPYTHON_EXECUTABLE=/usr/bin/python \
    -DOTIO_PYTHON_INSTALL:BOOL=ON \
    -G Ninja
  ninja
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
  cd "$srcdir/OpenTimeLineIO"
  python setup.py install --cxx-install-root="$pkgdir/usr" --user
}

# vim: ts=2 sw=2 et:

Attaching the stdout and stderr I get when running the above:

out.log
err.log

The resulting directory structure in the package directory is this one (without ie. otioconvert).

pkgdir.txt

Any help or tips are warmly welcome.

Best regards,
Alexander F. Rødseth

@meshula meshula added bug A problem, flaw, or broken functionality. build issues building OTIO labels Jun 4, 2020
@ssteinbach
Copy link
Collaborator

@xyproto sorry for the late reply - I think the #764 PR might make what you're trying to do easier. Does that look like it might help?

@xyproto
Copy link
Author

xyproto commented Aug 19, 2020

@ssteinbach Yes, that looks helpful. I'll give it a shot.

@ssteinbach
Copy link
Collaborator

#1006 should cover this. If this is still an issue, please let us know! Thank you!

@ssteinbach ssteinbach added this to the Public Beta 14 milestone Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A problem, flaw, or broken functionality. build issues building OTIO
Projects
None yet
Development

No branches or pull requests

3 participants