Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

[SOLVED] Writing my first ebuild for CasparCG/server

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
nagmat84
Guru
Guru
Posts: 325
Joined: Tue Mar 27, 2007 7:31 pm

[SOLVED] Writing my first ebuild for CasparCG/server

  • Quote

Post by nagmat84 » Tue Apr 22, 2025 2:20 pm

I want to use CasparCG/server for which no Gentoo ebuild exists. I wanted to do it properly and create an ebuild for it. This is the first time that I ever try to create an ebuild. The configuration phase dies with the following message

Code: Select all

CMake Warning (dev) at CMakeModules/Bootstrap_Linux.cmake:27 (FIND_PACKAGE):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  CMakeLists.txt:47 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/lib64/cmake/Boost-1.85.0/BoostConfig.cmake:141 (find_package):
  Found package configuration file:

    /usr/lib64/cmake/boost_system-1.85.0/boost_system-config.cmake

  but it set boost_system_FOUND to FALSE so package "boost_system" is
  considered to be NOT FOUND.  Reason given by package:

  No suitable build variant has been found.

  The following variants have been tried and rejected:

  * libboost_system.so.1.85.0 (shared, Boost_USE_STATIC_LIBS=ON)

Call Stack (most recent call first):
  /usr/lib64/cmake/Boost-1.85.0/BoostConfig.cmake:262 (boost_find_component)
  /usr/share/cmake/Modules/FindBoost.cmake:610 (find_package)
  CMakeModules/Bootstrap_Linux.cmake:27 (FIND_PACKAGE)
  CMakeLists.txt:47 (include)
Maybe someone is willing to support a newbie to create his first ebuild script and may help me to figure out what is going on?

This is my custom ebuild file so far

Code: Select all

EAPI=8

inherit cmake

DESCRIPTION="CasparCG Server plays out professional graphics, audio and video to multiple outputs. It has been in 24/7 broadcast production since 2006."
HOMEPAGE="https://casparcg.com/"

# Upon download, rename unspecific "vX.Y.Z.-stable.tar.gz" to a file whose name contains the full package name plus version.
SRC_URI="https://github.com/CasparCG/server/archive/refs/tags/v${PV}-stable.tar.gz -> ${P}.tar.gz"

# The tar-archive contains a subdirectory with the sources "server-x.y.z-stable/src" whose name differs from the package name.
# Overwrite the source directory "$S" with the correct directory.
S="${WORKDIR}/server-${PV}-stable/src"

# Always download the source from upstream, do not try to download it from a Gentoo mirror.
RESTRICT="mirror"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND=">=dev-libs/boost-1.67.0:*"
DEPEND="${RDEPEND}"
My ebuild does not contain much yet, in particular it does not yet overwrite any of the emerge phases, as I wanted to take it step-by-step and only overwrite what is necessary. For the same reason, the dependencies are probably far from complete.

I assume the problematic line in the upstream sources is in "src/CMakeModules/Bootstrap_Linux.cmake:"

Code: Select all

if (USE_STATIC_BOOST)
        SET (Boost_USE_STATIC_LIBS ON)
endif()
FIND_PACKAGE (Boost 1.67.0 COMPONENTS system thread chrono filesystem log_setup log locale regex date_time coroutine REQUIRED)
The following package is installed on my system

Code: Select all

$ equery uses boost
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for dev-libs/boost-1.85.0-r1:
 U I
 - - abi_x86_32                : 32-bit (x86) libraries
 + + bzip2                     : Enable bzip2 compression support
 + + context                   : Build and install the Boost.Context (and Boost.Fiber) library and all other Boost libraries that depend on it
 - - debug                     : Build and install only the debug version of the Boost libraries. Only enable this flag if you're developing against boost.
 - - doc                       : Install the full API documentation documentation. This takes over 200MB of extra disk space.
 + + icu                       : Enable ICU (Internationalization Components for Unicode) support, using dev-libs/icu
 - - lzma                      : Support for LZMA compression algorithm
 - - mpi                       : Add MPI (Message Passing Interface) layer to the apps that support it
 + + nls                       : Build libboost_locale. This library requires compatible C library interfaces, which might not be provided by uClibc or other embedded libraries.
 - - numpy                     : Optionally build NumPy extensions when Boost.Python is enabled
 - - python                    : Add optional support/bindings for the Python language
 - - python_targets_python3_10 : Build with Python 3.10
 - - python_targets_python3_11 : Build with Python 3.11
 + + python_targets_python3_12 : Build with Python 3.12
 + + python_targets_python3_13 : Build with Python 3.13
 + + stacktrace                : Build the full Boost.Stacktrace dynamic library instead of relying on the header-only implementation
 - - tools                     : Build and install the boost tools (bcp, quickbook, inspect, wave)
 + + zlib                      : Add support for zlib compression
 - - zstd                      : Enable support for ZSTD compression
My considerations:
  • From what I understand from CMake 4.0.1 Documentation - FindBoost the version 1.67.0 is a minimal version, so 1.85.0 on my system should be good
  • Something seems to set "USE_STATIC_BOOST" and hence "Boost_USE_STATIC_LIBS" gets enabled, however there are only *.so-files on my system. Static libs would be in *.a-files. Right? So this might be the culprit. If this assumption is correct, how do I use the eclass "cmake" to correctly disable "USE_STATIC_BOOST"? How does it get enabled in the first place anyway?
  • Off-topic, but might become relevant later: The CMakeList.txt is not located in the root source directory, but in another subdirectory called "src". That's why I set S="${WORKDIR}/server-${PV}-stable/src". But I am not sure whether this is the right thing to do, because there are other directories next to "src" which seem to be relevant, too. In particular, Emerge sets the build directory to ${WORKDIR}/server-${PV}-stable/src_build now, instead of ${WORKDIR}/server-${PV}-stable_build. I wonder if this might become problematic during the install phase later, but I am not that far yet.
Last edited by nagmat84 on Wed Apr 23, 2025 6:02 am, edited 1 time in total.
Top
nagmat84
Guru
Guru
Posts: 325
Joined: Tue Mar 27, 2007 7:31 pm

  • Quote

Post by nagmat84 » Tue Apr 22, 2025 2:44 pm

I was able to go some steps further. I had to add

Code: Select all

MYCMAKEARGS=" -DUSE_STATIC_BOOST=OFF -DUSE_SYSTEM_FFMPEG=ON "
to the ebuild. The eclass cmake uses the variable MYCMAKEARGS.

The first option enables using shared libraries for boost. The upstream documentation claims that it was disabled by default but the CMakeList.txt says otherwise.

The seconds option is necessary as without it the build system tries to download sources for FFmpeg itself which is not allowed due to sandboxing. (What a mess of a build script which tries to download additional sources.) The option "USE_SYSTEM_FFMPEG" is not documented upstream, but I found it in CMakeLists.txt.
Top
enderium
n00b
n00b
Posts: 1
Joined: Fri Mar 27, 2026 9:13 am
Location: Germany

  • Quote

Post by enderium » Fri Mar 27, 2026 9:18 am

Have you managed to write a good working ebuild for casparcg? I would need this software too, to use it for a non-profit organization from Germany.

Would you mind sharing the ebuild you have written?
Top
Post Reply

3 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic