Skip to content

Commit

Permalink
contrib: srt: don't set default GNU folders
Browse files Browse the repository at this point in the history
We do force CMAKE_INSTALL_LIBDIR which makes srt not use any other of the GNU
directories...

Merged upstream: Haivision/srt#2450
  • Loading branch information
robUx4 authored and chouquette committed Sep 10, 2022
1 parent 183ecb2 commit 055841e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
41 changes: 41 additions & 0 deletions contrib/src/srt/0001-build-always-use-GNUInstallDirs.patch
@@ -0,0 +1,41 @@
From e76d61dae5af710317a919f867b9b7a58adf6a39 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Fri, 2 Sep 2022 09:46:56 +0200
Subject: [PATCH] [build] always use GNUInstallDirs

It's possible to use GNUInstallDirs and allow the user to force some specific
target folder. The values set by the user are not overriden in that case [1]:

> If the includer does not define a value the above-shown default will be used
> and the value will appear in the cache for editing by the user.

With MSVC builds this doesn't change the default values used to install targets.

[1] https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
---
CMakeLists.txt | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce3d0b8..05764e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,14 +45,7 @@ set_if(POSIX LINUX OR DARWIN OR BSD OR SUNOS OR ANDROID OR (CYGWIN AND CYG
set_if(SYMLINKABLE LINUX OR DARWIN OR BSD OR SUNOS OR CYGWIN OR GNU)
set_if(NEED_DESTINATION ${CMAKE_VERSION} VERSION_LESS "3.14.0")

-# Not sure what to do in case of compiling by MSVC.
-# This will make installdir in C:\Program Files\SRT then
-# inside "bin" and "lib64" directories. At least this maintains
-# the current status. Shall this be not desired, override values
-# of CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR.
-if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
- include(GNUInstallDirs)
-endif()
+include(GNUInstallDirs)

# The CMAKE_BUILD_TYPE seems not to be always set, weird.
if (NOT DEFINED ENABLE_DEBUG)
--
2.37.3.windows.1

3 changes: 2 additions & 1 deletion contrib/src/srt/rules.mak
Expand Up @@ -25,11 +25,12 @@ $(TARBALLS)/srt-$(SRT_VERSION).tar.gz:
srt: srt-$(SRT_VERSION).tar.gz .sum-srt
$(UNPACK)
$(APPLY) $(SRC)/srt/0001-core-remove-MSG_TRUNC-logging.patch
$(APPLY) $(SRC)/srt/0001-build-always-use-GNUInstallDirs.patch
$(call pkg_static,"scripts/srt.pc.in")
mv srt-$(SRT_VERSION) $@ && touch $@

.srt: srt toolchain.cmake
cd $< && $(HOSTVARS_PIC) $(CMAKE) \
-DENABLE_SHARED=OFF -DUSE_ENCLIB=gnutls -DENABLE_CXX11=OFF -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_BINDIR=bin -DCMAKE_INSTALL_INCLUDEDIR=include
-DENABLE_SHARED=OFF -DUSE_ENCLIB=gnutls -DENABLE_CXX11=OFF
+$(CMAKEBUILD) $< --target install
touch $@

0 comments on commit 055841e

Please sign in to comment.