DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 4 Weeks Ago
jamesbal0 jamesbal0 is offline
New User
 
Join Date: Jun 2020
Posts: 2
Exclamation Building from source file in OpenBSD

Hello I am a bit confused on how to build applications from source files.
as example I am trying to build Kvantum
https://github.com/tsujan/Kvantum/bl....md#with-cmake

and I am getting :

Code:
$cd build/                                                                                                  
$ cmake ../
CMake Error at style/CMakeLists.txt:4 (find_package):
  By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Core", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Core"
  (requested version 5.9.0) with any of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

  Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
  "Qt5Core_DIR" to a directory containing one of the above files.  If
  "Qt5Core" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/home/admin/OWEN/Kvantum/Kvantum/build/CMakeFiles/CMakeOutput.log".
How should I precede?

I am asking in general because the sources build systems, what ever they may be, are looking in the wrong places, not for openbsd.
How should I force them to look at the openbsd directory convention?
thanks

Last edited by jamesbal0; 4 Weeks Ago at 10:47 AM.
Reply With Quote
  #2   (View Single Post)  
Old 4 Weeks Ago
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,034
Default

To be honest, I use the ports tree infrastructure for complex build toolchains like cmake and qmake. A lot of work went into the ports tree to be able to configure and build applications that require them on OpenBSD. As an example, here is the port-modules(5) file for cmake, /usr/ports/devel/cmake/cmake.port.mk. There's a similarly complex one for qmake:
Code:
# $OpenBSD: cmake.port.mk,v 1.66 2020/05/25 05:12:00 rsadowski Exp $

BUILD_DEPENDS+=    devel/cmake

.for _n _v in ${SHARED_LIBS}
CONFIGURE_ENV+=LIB${_n}_VERSION=${_v}
MAKE_ENV+=LIB${_n}_VERSION=${_v}
.endfor

USE_NINJA ?= Yes

.if ${USE_NINJA:L} == "yes"
BUILD_DEPENDS += devel/ninja>=1.5.1
NINJA ?= ninja
NINJA_FLAGS ?= -v -j ${MAKE_JOBS}
.elif ${USE_NINJA:L} == "samurai"
BUILD_DEPENDS += devel/samurai
NINJA ?= samu
NINJA_FLAGS ?= -v -j ${MAKE_JOBS}
CONFIGURE_ARGS += -DCMAKE_MAKE_PROGRAM=${NINJA}
.endif

.if ${USE_NINJA:L} == "yes" || ${USE_NINJA:L} == "samurai"
_MODCMAKE_GEN = Ninja
MODCMAKE_BUILD_TARGET = cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \
    ${NINJA} ${NINJA_FLAGS} ${ALL_TARGET}
MODCMAKE_INSTALL_TARGET = cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \
    ${FAKE_SETUP} ${NINJA} ${NINJA_FLAGS} ${FAKE_TARGET}
MODCMAKE_TEST_TARGET = cd ${WRKBUILD} && exec ${SETENV} ${ALL_TEST_ENV} \
    ${NINJA} ${NINJA_FLAGS} ${TEST_FLAGS} ${TEST_TARGET}

.if !target(do-build)
do-build:
    @${MODCMAKE_BUILD_TARGET}
.endif

.if !target(do-install)
do-install:
    @${MODCMAKE_INSTALL_TARGET}
.endif

.if !target(do-test)
do-test:
    @${MODCMAKE_TEST_TARGET}
.endif

.else
_MODCMAKE_GEN = "Unix Makefiles"
# XXX cmake include parser is bogus
DPB_PROPERTIES += nojunk
.endif

# JAVA
.if ${MODULES:Mjava}
CONFIGURE_ENV +=    JAVA_HOME=${JAVA_HOME}
MAKE_ENV +=    JAVA_HOME=${JAVA_HOME}
.endif

# Python
.if ${MODULES:Mlang/python}
# https://cmake.org/cmake/help/latest/module/FindPython3.html#artifacts-specification
CONFIGURE_ARGS +=    -DPYTHON_EXECUTABLE=${MODPY_BIN}
CONFIGURE_ARGS +=    -DPYTHON_LIBRARY_DIRS=${MODPY_LIBDIR}
CONFIGURE_ARGS +=    -DPYTHON_INCLUDE_DIR=${MODPY_INCDIR}
.endif

# Lua
.if ${MODULES:Mlang/lua}
CONFIGURE_ARGS +=    -DLUA_INCLUDE_DIR=${MODLUA_INCL_DIR}
.endif

# Ruby
.if ${MODULES:Mlang/ruby}
# https://cmake.org/cmake/help/latest/module/FindRuby.html
CONFIGURE_ARGS +=    -DRUBY_EXECUTABLE=${RUBY}
.endif

# XXX Remove hackish patches
# Tcl/Tk
CONFIGURE_ENV +=    MODTCL_VERSION=${MODTCL_VERSION} \
            MODTK_VERSION=${MODTK_VERSION} \
            MODTCL_INCDIR=${MODTCL_INCDIR} \
            MODTK_INCDIR=${MODTK_INCDIR} \
            MODTCL_LIBDIR=${MODTCL_LIBDIR} \
            MODTK_LIBDIR=${MODTK_LIBDIR} \
            MODTCL_LIB=${MODTCL_LIB} \
            MODTK_LIB=${MODTK_LIB}

MODCMAKE_DEBUG ?=        No

.if empty(CONFIGURE_STYLE)
CONFIGURE_STYLE=    cmake
.endif
MODCMAKE_configure=    cd ${WRKBUILD} && ${SETENV} \
    CC="${CC}" CFLAGS="${CFLAGS}" \
    CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
    ${CONFIGURE_ENV} ${LOCALBASE}/bin/cmake \
        -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \
        -G ${_MODCMAKE_GEN} ${CONFIGURE_ARGS} ${WRKSRC}

.if !defined(CONFIGURE_ARGS) || ! ${CONFIGURE_ARGS:M*CMAKE_BUILD_TYPE*}
.  if ${MODCMAKE_DEBUG:L} == "yes"
CONFIGURE_ARGS += -DCMAKE_BUILD_TYPE=Debug
MODCMAKE_BUILD_SUFFIX =    -debug.cmake
.  else
CONFIGURE_ARGS += -DCMAKE_BUILD_TYPE=Release
MODCMAKE_BUILD_SUFFIX =    -release.cmake
.  endif
.endif
SUBST_VARS +=    MODCMAKE_BUILD_SUFFIX

SEPARATE_BUILD ?=    Yes

TEST_TARGET ?=    test

MODCMAKE_WANTCOLOR ?= No
MODCMAKE_VERBOSE ?= Yes

.if ${MODCMAKE_WANTCOLOR:L} == "yes" && defined(TERM)
MAKE_ENV += TERM=${TERM}
.endif

.if ${MODCMAKE_VERBOSE:L} == "yes"
MAKE_ENV += VERBOSE=1
.endif
Reply With Quote
  #3   (View Single Post)  
Old 4 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 171
Default

Try installing x11/qt5/qtbase, that supplies lib/qt5/cmake/Qt5Core/Qt5CoreConfig.cmake
__________________
Linux is for people who hate Windows. BSD is for people who love UNIX.
Reply With Quote
  #4   (View Single Post)  
Old 4 Weeks Ago
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,034
Default

Hah! Your way might be expedient for this one hurdle, but mine ensures all dependencies are installed and all environment variables are set correctly to configure and build. I look for a similar application in the ports tree, copy it to /usr/ports/mystuff/.../..., and edit the Makefile.
Reply With Quote
  #5   (View Single Post)  
Old 4 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 171
Default

^ Yes, your way does look better
__________________
Linux is for people who hate Windows. BSD is for people who love UNIX.
Reply With Quote
  #6   (View Single Post)  
Old 4 Weeks Ago
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,034
Default

Long term, it's certainly easier, because I don't need to remember any of the "gotcha" issues. For example, the devel/cmake module noted above does all of this for me:
Code:
     devel/cmake   Adds devel/cmake to BUILD_DEPENDS and fills up
                   CONFIGURE_ARGS, CONFIGURE_ENV and MAKE_ENV.  Sets up
                   configure target.  If CONFIGURE_STYLE was not set before,
                   sets its value to `cmake'.  Changes default value of
                   SEPARATE_BUILD to `Yes' because modern CMake requires out-
                   of-source build anyway.  Changes TEST_TARGET to `test' as
                   this is standard for CMake projects.  Also this module has
                   the following knobs:

                   MODCMAKE_WANTCOLOR
                           If set to `Yes', CMake will colorize its output.
                           Should not be used in ports Makefiles.  Default
                           value is `No'.

                   MODCMAKE_VERBOSE
                           If set to `Yes', CMake will print details during
                           configure and build stages about exact command
                           being run, etc.  Should not be used in ports
                           Makefiles.  Default value is `Yes'.

                   MODCMAKE_DEBUG
                           If set to `Yes', CMake will produce a debug build
                           instead of a release build.  The exact effects on
                           the build process depend on settings specified in
                           the CMake config files.  Default value is `No'.
                   Also, ‘nojunk’ is added to DPB_PROPERTIES because CMake's
                   include files parser cheats too much.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Building from source mafkees1233 OpenBSD General 12 10th May 2019 09:49 PM
Building the System from Source hanzer OpenBSD Installation and Upgrading 10 28th October 2018 09:12 PM
Building a 10.2 system from source hanzer FreeBSD Installation and Upgrading 1 1st September 2015 01:36 AM
Building OpenBSD userland from source bceverly OpenBSD General 6 6th April 2015 07:26 PM
*** Error code 1 building OpenBSD 5.1-stable from source comet--berkeley OpenBSD Installation and Upgrading 12 19th May 2012 02:18 AM


All times are GMT. The time now is 01:40 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick