Skip to content

Commit

Permalink
(Linux) Build script improvement: ability to disable WIFI functionali…
Browse files Browse the repository at this point in the history
…ty (skipping "libiw-dev")

Currently, Wireless Tools (package "libiw-dev") needs to be available on the build machine.
We need it for the WIFI functionality being included in the daemon.

Some users may face issues building daemon due to missing "libiw-dev" on their systems.

So, now there is the possibility to skip using "libiw-dev" and disable WIFI functionality from the daemon build.
Environment variable `IVPN_NO_WIFI` must be defined for that.

Example:
```
  cd desktop-app/daemon/References/Linux/scripts/
  IVPN_NO_WIFI=true ./build-daemon.sh
```

#345
  • Loading branch information
stenya committed Jan 5, 2024
1 parent 4262d05 commit 7761ad9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions daemon/References/Linux/scripts/build-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,20 @@ fi
# Build
cd $SCRIPT_DIR/../../../

BUILDTAG_DEBUG="" # "debug"
BUILDTAG_NOWIFI="" # "nowifi"

if [[ "$@" == *"-debug"* ]]
then
echo "Compiling in DEBUG mode"
go build -buildmode=pie -tags debug -o "$OUT_FILE" -trimpath -ldflags "-X github.com/ivpn/desktop-app/daemon/version._version=$VERSION -X github.com/ivpn/desktop-app/daemon/version._commit=$COMMIT -X github.com/ivpn/desktop-app/daemon/version._time=$DATE"
else
go build -buildmode=pie -o "$OUT_FILE" -trimpath -ldflags "-s -w -X github.com/ivpn/desktop-app/daemon/version._version=$VERSION -X github.com/ivpn/desktop-app/daemon/version._commit=$COMMIT -X github.com/ivpn/desktop-app/daemon/version._time=$DATE"
echo "[!] Compiling in DEBUG mode."
BUILDTAG_DEBUG="debug"
fi
if [ ! -z "$IVPN_NO_WIFI" ]; then
echo "[!] WIFI functionality DISABLED."
BUILDTAG_NOWIFI="nowifi"
fi

go build -buildmode=pie -tags "${BUILDTAG_DEBUG} ${BUILDTAG_NOWIFI}" -o "$OUT_FILE" -trimpath -ldflags "-X github.com/ivpn/desktop-app/daemon/version._version=$VERSION -X github.com/ivpn/desktop-app/daemon/version._commit=$COMMIT -X github.com/ivpn/desktop-app/daemon/version._time=$DATE"

echo "Compiled binary: '$OUT_FILE'"

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion daemon/wifiNotifier/wifiNotifier_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package wifiNotifier
// 2) comment '#include "iwlib_2_linux.c"'
// 3) remove suffix '_2' from function names (in this file): iw_get_range_info_2, iw_init_event_stream_2, iw_extract_event_stream_2
// #cgo LDFLAGS: -liw
#include "iwlib_2_linux.c"
#include "linux_lib/iwlib_2_linux.c"
#include <stdio.h> // printf
#include <string.h> // strndup prototype
Expand Down

0 comments on commit 7761ad9

Please sign in to comment.