Skip to content

Commit ec4c5c7

Browse files
authored
add SYSCONFDIR variable to allow FHS-compliant builds (#210)
1 parent 34029ad commit ec4c5c7

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

skyscraper.pro

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ isEmpty(PREFIX) {
2929
PREFIX = /usr/local
3030
}
3131

32+
# System configuration directory
33+
SYSCONFDIR = $$(SYSCONFDIR)
34+
isEmpty(SYSCONFDIR) {
35+
SYSCONFDIR = $${PREFIX}/etc
36+
}
37+
3238
unix:target.path=$${PREFIX}/bin
3339
unix:target.files=Skyscraper Skyscraper.app/Contents/MacOS/Skyscraper
3440

@@ -39,25 +45,25 @@ unix:supplementary.files=\
3945
supplementary/scraperdata/peas_and_idmap_verify.py \
4046
supplementary/scraperdata/README-Skyscraper-Scripts.md
4147

42-
unix:config.path=$${PREFIX}/etc/skyscraper
48+
unix:config.path=$${SYSCONFDIR}/skyscraper
4349
unix:config.files=aliasMap.csv hints.xml mameMap.csv \
4450
mobygames_platforms.json peas.json platforms_idmap.csv \
4551
screenscraper_platforms.json tgdb_developers.json \
4652
tgdb_genres.json tgdb_platforms.json tgdb_publishers.json
4753

48-
unix:examples.path=$${PREFIX}/etc/skyscraper
54+
unix:examples.path=$${SYSCONFDIR}/skyscraper
4955
unix:examples.files=config.ini.example README.md artwork.xml \
5056
artwork.xml.example1 artwork.xml.example2 artwork.xml.example3 \
5157
artwork.xml.example4 batocera-artwork.xml docs/ARTWORK.md docs/CACHE.md
5258

53-
unix:cacheexamples.path=$${PREFIX}/etc/skyscraper/cache
59+
unix:cacheexamples.path=$${SYSCONFDIR}/skyscraper/cache
5460
unix:cacheexamples.files=cache/priorities.xml.example docs/CACHE.md
5561

56-
unix:impexamples.path=$${PREFIX}/etc/skyscraper/import
62+
unix:impexamples.path=$${SYSCONFDIR}/skyscraper/import
5763
unix:impexamples.files=docs/IMPORT.md import/definitions.dat.example1 \
5864
import/definitions.dat.example2
5965

60-
unix:resexamples.path=$${PREFIX}/etc/skyscraper/resources
66+
unix:resexamples.path=$${SYSCONFDIR}/skyscraper/resources
6167
unix:resexamples.files=resources/maskexample.png resources/frameexample.png \
6268
resources/boxfront.png resources/boxside.png resources/scanlines1.png \
6369
resources/scanlines2.png
@@ -73,6 +79,7 @@ unix:count(dev, 1) {
7379
}
7480
DEFINES+=VERSION=\\\"$$VERSION\\\"
7581
DEFINES+=PREFIX=\\\"$$PREFIX\\\"
82+
DEFINES+=SYSCONFDIR=\\\"$$SYSCONFDIR\\\"
7683

7784
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT
7885

src/config.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void Config::setupUserConfig() {
234234
}
235235
}
236236

237-
QString localEtcPath = QString(PREFIX "/etc/skyscraper/");
237+
QString localEtcPath = QString(SYSCONFDIR "/skyscraper/");
238238
if (!QFileInfo::exists(localEtcPath) || isRpInstall) {
239239
// RetroPie or Windows installation type: handled externally
240240
return;
@@ -391,4 +391,4 @@ const char *Config::pathToCStr(QString &in) {
391391
ret = ret.replace(QDir::homePath(), "~");
392392
#endif
393393
return ret.toUtf8().constData();
394-
}
394+
}

0 commit comments

Comments
 (0)