[Bug 222175] New ports: graphics/vulkan-sdk and dependencies

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Sep 18 11:38:57 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222175

Jan Beich <jbeich at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jbeich at FreeBSD.org

--- Comment #1 from Jan Beich <jbeich at FreeBSD.org> ---
Comment on attachment 186206
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=186206
The patch

=== devel/glslang-devel ===

> +PORTNAME=	glslang-devel

Use PKGNAMESUFFIX=-devel or just drop it due to lack of stable port. As
maintainer you can switch to track releases once upstream starts doing those
more often.

Ditto for devel/spirv-tools-devel.

> +DISTVERSION=	Overload400-PrecQual.2000-12-Apr-2017
[...]
> +GH_TAGNAME=	d5aedc199

Maybe convert to a tag offset:

  $ git describe --tags --match 3.0 d5aedc199
  3.0-1516-gd5aedc19

would be

  DISTVERSION=  3.0-1516
  DISTVERSIONSUFFIX=    -gd5aedc19

represented as

  $ make -V PKGNAME
  glslang-devel-3.0.1516

Maybe ditto for devel/spirv-tools-devel:

  DISTVERSIONPREFIX=    v
  DISTVERSION=  2016.6-155
  DISTVERSIONSUFFIX=    -gf0fe601
  [...]
  GH_ACCOUNT=   KhronosGroup
  GH_PROJECT=   SPIRV-Tools
  GH_TUPLE=    
KhronosGroup:SPIRV-Headers:2bb92e6:headers/external/spirv-headers

  $ make -V PKGNAME
  spirv-tools-2016.6.155

In both cases you'd have a monotonically increasing version for each upstream
commit, sparing inventing arbitrary suffixes.

> +LICENSE=	BSD3DLABS
> +LICENSE_NAME=	Modified BSD License (3Dlabs/LunarG)
> +LICENSE_FILE=	${FILESDIR}/LICENSE
> +LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

Doesn't look modified compared to regular variants[1]. Google copyrights are
also missing. Maybe generate license text on-the-fly:

  LICENSE=      BSD3CLAUSE
  LICENSE_FILE= ${WRKDIR}/LICENSE

  post-extract:
        ${SED} '/^$$/,$$d' ${WRKSRC}/${PORTNAME}/Include/Types.h \
                >${WRKDIR}/LICENSE

[1] https://fedoraproject.org/wiki/Licensing:BSD

> +USES=	cmake:outsource compiler:c++11-lang

Can you reindent with 8 column tabs to achieve consistent whitespace alignment?

Ditto for devel/spirv-tools-devel.

> +Khronos reference front-end for GLSL and ESSL, and sample SPIR-V generator.

A bit terse for pkg-descr. Maybe use the first paragraph from khronos.org link.

> +WWW: https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/
> +WWW: https://github.com/KhronosGroup/glslang

One of those can probably be dropped given both cross-reference each other.

=== devel/spirv-tools-devel ===

Fails to build with DEVELOPER=1 set in make.conf:

====> Running Q/A tests (stage-qa)
Error: '/bin/bash' is an invalid shebang you need USES=shebangfix for
'bin/spirv-lesspipe.sh'
*** Error code 1

> +USES=	cmake:outsource compiler:c++11-lang python:2

- USES=compiler:c++11-lib instead as std::unique_ptr isn't available in
libstdc++ 4.2.
- USES=python:build instead given it builds fine with "python3.6" and runtime
doesn't call "python2".

Ditto for graphics/vulkan-sdk.

> +LICENSE=	APACHE20
> +LICENSE_FILE=	${WRKSRC}/LICENSE

In this case, defining LICENSE_FILE isn't necessary. Apache 2.0 is a
standardized license for which there's a copy under Templates/Licenses/.

Ditto for graphics/vulkan-sdk.

=== graphics/vulkan-sdk ===

Fails to build in poudriere:

In file included from
/wrkdirs/usr/ports/graphics/vulkan-sdk/work/Vulkan-LoaderAndValidationLayers-sd
k-1.0.57.0/layers/vk_layer_extension_utils.cpp:22:
In file included from
/wrkdirs/usr/ports/graphics/vulkan-sdk/work/Vulkan-LoaderAndValidationLayers-sd
k-1.0.57.0/layers/vk_layer_extension_utils.h:21:
In file included from
/wrkdirs/usr/ports/graphics/vulkan-sdk/work/Vulkan-LoaderAndValidationLayers-sd
k-1.0.57.0/include/vulkan/vk_layer.h:29:
/wrkdirs/usr/ports/graphics/vulkan-sdk/work/Vulkan-LoaderAndValidationLayers-sdk-1.0.57.0/layers/../include/vulkan/vulkan.h:5916:10:
fatal error: 'X11/extensions/Xrandr.h' file not found
#include <X11/extensions/Xrandr.h>
         ^

http://sprunge.us/OaAM

> +XLIB_CMAKE_ON=	-DBUILD_WSI_XLIB_SUPPORT:BOOL=ON
> +XLIB_CMAKE_OFF=	-DBUILD_WSI_XLIB_SUPPORT:BOOL=OFF

Switch to _CMAKE_BOOL to improve readability.

> +-if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
> ++if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD"))

What about other BSDs? DragonFly is a downstream of FreeBSD Ports. Maybe switch
to if(UNIX AND NOT APPLE)

Ditto in other places.

> +-    set(FALLBACK_CONFIG_DIRS "/etc/xdg" CACHE STRING
> ++    set(FALLBACK_CONFIG_DIRS "/usr/local/etc/xdg:/etc/xdg" CACHE STRING

Would it respect LOCALBASE? Maybe replace /usr/local with
${CMAKE_INSTALL_PREFIX}.

> ++if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
> ++    include_directories("/usr/local/include")
> + endif()

Better add include_directories(SYSTEM ${XCB_INCLUDE_DIR}) just after
find_package(XCB) and include_directories(SYSTEM ${X11_Xlib_INCLUDE_PATH}) just
after find_package(X11).

> ++++ demos/cube.cpp
[...]
> +-#elif __linux__
> ++#elif defined(__linux__) || defined(__FreeBSD__)

Maybe use #elif !defined(__APPLE__)

> ++    list(APPEND libraries PRIVATE -lrt)

On BSDs clock_gettime() is in libc. Maybe limit to if(CMAKE_SYSTEM_NAME MATCHES
"^(Linux|kFreeBSD|GNU|SunOS)$")

> ++    if(NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
> ++        list(APPEND libraries PRIVATE -ldl)
> ++    endif()

Switch to ${CMAKE_DL_LIBS}.

> ++++ loader/loader.c
[...]
> +-#if defined(__linux__)
> ++#if defined(__linux__) || defined(__FreeBSD__)

getenv() is part of POSIX. Maybe use #ifndef _WIN32 or #if !defined(_WIN32) &&
!defined(__APPLE__) depending on how weird OS X is. ;)

> ++++ loader/vk_loader_platform.h
[...]
> +-#if defined(__linux__)
> ++#if defined(__linux__) || defined(__FreeBSD__)

Ditto.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list