Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit ac3cd07

Browse files
authored
Merge pull request #191 from redhatrises/travis_qt5
[v1-2] Fix OSX builds
2 parents 3b40210 + 776c330 commit ac3cd07

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

.travis.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ language: cpp
77
compiler:
88
- gcc
99

10+
env:
11+
- PATH="/usr/local/opt/qt/bin:$PATH"
12+
1013
before_install:
1114
- brew update
1215
- brew install jq
13-
- brew install cartr/qt4/qt@4
16+
- brew install qt5
1417
- brew install asciidoc
1518

1619
before_script:
@@ -23,8 +26,17 @@ before_script:
2326

2427
script:
2528
- ./build-for-osx.sh
26-
- wget `curl -s https://api.github.com/repos/openscap/scap-security-guide/releases/latest?access_token=$GITHUB_TOKEN | jq -r ".assets[] | select(.name | test(\"(scap-security-guide-[0-9].[0-9].[0-9]*).zip\")) | .browser_download_url"` -O ssg.zip
27-
- mkdir -p `pwd`/scap-workbench.app/Contents/Resources/ssg/ && unzip ssg.zip -d `pwd`/scap-workbench.app/Contents/Resources/ssg/
29+
# Parse release page json to obtain link to latest content zip file and download it
30+
- |
31+
REL_TAG=`curl -s "https://github.com/ComplianceAsCode/content/releases/latest" | grep -o 'tag/[v.0-9]*' | awk -F/ '{print $2}'`
32+
REL_TAG_NUM=`echo ${REL_TAG} | cut -d"v" -f2`
33+
DWN_LINK=https://github.com/ComplianceAsCode/content/releases/download/${REL_TAG}/scap-security-guide-${REL_TAG_NUM}.zip
34+
if [ -z "${DWN_LINK}" ] ; then
35+
echo "Could not get the ZIP URL! It is empty!"
36+
exit 1
37+
fi
38+
- wget "${DWN_LINK}" -O ssg.zip
39+
- mkdir -p `pwd`/build-osx/scap-workbench.app/Contents/Resources/ssg/ && unzip ssg.zip && cp -a scap-security-guide-*/* `pwd`/build-osx/scap-workbench.app/Contents/Resources/ssg/
2840
- cd build-osx && sh osx-create-dmg.sh
2941

3042
deploy:

CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,23 @@ set(SCAP_WORKBENCH_LINK_LIBRARIES
125125
Qt5::Widgets Qt5::XmlPatterns
126126
${OPENSCAP_LIBRARIES})
127127

128+
# ---------- RPATHS for linking
129+
130+
# see https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
131+
132+
# when building, use the install RPATH
133+
# (but later on when installing)
134+
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
135+
136+
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
137+
138+
# add the automatically determined parts of the RPATH
139+
# which point to directories outside the build tree to the install RPATH
140+
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
141+
142+
# Turn on RPATH for OSX
143+
set(CMAKE_MACOSX_RPATH ON)
144+
128145
configure_file("include/Config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/Config.h")
129146
# It is not trivial to make the resulting file executable :-(
130147
# People will have to `bash runwrapper.sh ...` in the meantime.

build-for-osx.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
set -e
2+
13
mkdir -p build-osx/
24
pushd build-osx/
35
cmake -D SCAP_WORKBENCH_LOCAL_SCAN_ENABLED=false -D SCAP_AS_RPM_EXECUTABLE="" ../
46
make -j 4
57
mkdir -p ./scap-workbench.app/Contents/Frameworks/
68
cp /usr/local/lib/libpcre.1.dylib ./scap-workbench.app/Contents/Frameworks/
7-
cp /usr/local/lib/libopenscap.8.dylib ./scap-workbench.app/Contents/Frameworks/
9+
cp /usr/local/lib/libopenscap*.dylib ./scap-workbench.app/Contents/Frameworks/
810
chmod 755 ./scap-workbench.app/Contents/Frameworks/*.dylib
911
echo "Copy fresh extracted SSG zip into `pwd`/scap-workbench.app/Contents/Resources/ssg/"
1012
echo "so that SSG README.md is at `pwd`/scap-workbench.app/Contents/Resources/ssg/README.md"

osx-create-dmg.sh.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -e
4+
35
# Original by Andy Maloney
46
# http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/
57
# Changes specific to SCAP Workbench by Martin Preisler <[email protected]>

0 commit comments

Comments
 (0)