Skip to content

Commit

Permalink
Linux, BSD: Add BUNDLE_XPI option
Browse files Browse the repository at this point in the history
The official Debian package includes this file, but other systems do not
neccessarily need it;  at least OpenBSD is unable to download files from
the intenet during packaging, so this fails ether way.

Signed-off-by: Klemens Nanni <kn@openbsd.org>
  • Loading branch information
klemensn authored and mrts committed Jul 11, 2023
1 parent dcb38be commit de7e072
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk
DEB_CMAKE_EXTRA_FLAGS = \
-DBUNDLE_XPI=ON
DEB_MAKE_CHECK_TARGET = test
11 changes: 8 additions & 3 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@ elseif(APPLE)
)
endif()
else()
option(BUNDLE_XPI "Download and bundle the Firefox extension" OFF)
include(GNUInstallDirs)
file(DOWNLOAD ${FIREFOX_URL} ${CMAKE_CURRENT_BINARY_DIR}/${FIREFOX_UUID}.xpi)
if (BUNDLE_XPI)
file(DOWNLOAD ${FIREFOX_URL} ${CMAKE_CURRENT_BINARY_DIR}/${FIREFOX_UUID}.xpi)
endif()
set(WEBEID_PATH ${CMAKE_INSTALL_FULL_BINDIR}/web-eid)
install(TARGETS web-eid DESTINATION ${CMAKE_INSTALL_BINDIR})
if(EXISTS "/etc/debian_version")
Expand All @@ -179,8 +182,10 @@ else()
DESTINATION ${CMAKE_INSTALL_DATADIR}/google-chrome/extensions)
install(FILES ${CMAKE_SOURCE_DIR}/install/web-eid.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${FIREFOX_UUID}.xpi
DESTINATION ${CMAKE_INSTALL_DATADIR}/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384})
if (BUNDLE_XPI)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${FIREFOX_UUID}.xpi
DESTINATION ${CMAKE_INSTALL_DATADIR}/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384})
endif()
foreach(RES 16 32 128 256 512)
install(
FILES ${CMAKE_SOURCE_DIR}/install/appicon_${RES}.png
Expand Down

0 comments on commit de7e072

Please sign in to comment.