push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
diff --git a/bitmask.pro b/bitmask.pro
index f377bb4..3c71a71 100644
--- a/bitmask.pro
+++ b/bitmask.pro
@@ -4,9 +4,9 @@ QT += quickcontrols2 svg
CONFIG += qt staticlib
CONFIG += c++17 strict_c++
CONFIG += qtquickcompiler
-CONFIG+=force_debug_info
-CONFIG+=debug_and_release
-#CONFIG+=release
+#CONFIG+=force_debug_info
+#CONFIG+=debug_and_release
+CONFIG+=release
windows:CONFIG -= console
unix:DEBUG:CONFIG += debug
lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5")

View File

@@ -0,0 +1,189 @@
{
lib,
stdenv,
replaceVars,
git,
fetchFromGitLab,
buildGoModule,
wrapQtAppsHook,
python3,
python3Packages,
pkg-config,
openvpn,
cmake,
qmake,
which,
iproute2,
iptables,
procps,
qtbase,
qtdeclarative,
qtsvg,
qttools,
qtwayland,
provider ? "riseup",
}:
let
version = "0.24.8";
src = fetchFromGitLab {
domain = "0xacab.org";
owner = "leap";
repo = "bitmask-vpn";
rev = "8b3ac473f64b6de0262fbf945ff25af8029134f1";
leaveDotGit = true;
sha256 = "sha256-XUgCVHnTLZXFU+r0s1yuYryWNBJRgQrFlf3g1iRrLWs=";
};
# bitmask-root is only used on GNU/Linux
# and may one day be replaced by pkg/helper
bitmask-root = stdenv.mkDerivation {
inherit src version;
sourceRoot = "${src.name}/helpers";
pname = "bitmask-root";
nativeBuildInputs = [ python3Packages.wrapPython ];
postPatch = ''
substituteInPlace bitmask-root \
--replace 'swhich("ip")' '"${iproute2}/bin/ip"' \
--replace 'swhich("iptables")' '"${iptables}/bin/iptables"' \
--replace 'swhich("ip6tables")' '"${iptables}/bin/ip6tables"' \
--replace 'swhich("sysctl")' '"${procps}/bin/sysctl"' \
--replace /usr/sbin/openvpn ${openvpn}/bin/openvpn
substituteInPlace se.leap.bitmask.policy \
--replace /usr/sbin/bitmask-root $out/bin/bitmask-root
'';
installPhase = ''
runHook preInstall
install -m 755 -D -t $out/bin bitmask-root
install -m 444 -D -t $out/share/polkit-1/actions se.leap.bitmask.policy
wrapPythonPrograms
runHook postInstall
'';
};
in
buildGoModule rec {
inherit src version;
pname = "${provider}-vpn";
vendorHash = null;
patches = [
# This patch fixes the paths in the build script generated by qmake
# to use the correct paths for qmlcachegen and lrelease
(replaceVars ./fix_paths.patch {
inherit qtbase qtdeclarative qttools;
})
# Don't build the debug version
./build_release.patch
];
postPatch = ''
substituteInPlace pkg/pickle/helpers.go \
--replace /usr/share $out/share
# Using $PROVIDER is not working,
# thus replacing directly into the vendor.conf
substituteInPlace providers/vendor.conf \
--replace "provider = bitmask" "provider = ${provider}"
substituteInPlace branding/templates/debian/app.desktop-template \
--replace "Icon=icon" "Icon=${pname}"
patchShebangs gui/build.sh
wrapPythonProgramsIn branding/scripts
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace pkg/helper/linux.go \
--replace /usr/sbin/openvpn ${openvpn}/bin/openvpn
substituteInPlace pkg/launcher/launcher_linux.go \
--replace /usr/sbin/openvpn ${openvpn}/bin/openvpn \
--replace /usr/sbin/bitmask-root ${bitmask-root}/bin/bitmask-root \
--replace /usr/bin/lxpolkit /run/wrappers/bin/polkit-agent-helper-1 \
--replace '"polkit-gnome-authentication-agent-1",' '"polkit-gnome-authentication-agent-1","polkitd",'
'';
nativeBuildInputs = [
cmake
git
pkg-config
python3
python3Packages.wrapPython
which
wrapQtAppsHook
qmake
qttools
qtsvg
];
buildInputs = [
qtbase
qtdeclarative
qtsvg
]
++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ];
# FIXME: building on Darwin currently fails
# due to missing debug symbols for Qt,
# this should be fixable once darwin.apple_sdk >= 10.13
# See https://bugreports.qt.io/browse/QTBUG-76777
# Not using buildGoModule's buildPhase:
# gui/build.sh will build Go modules into lib/libgoshim.a
buildPhase = ''
runHook preBuild
make vendor
# TODO: this is a hack that copies the qrc file that should by built by qmlcachegen
# qmlcachegen is in qtdeclarative/libexec, but qmake is in qtbase/bin
# but qmake searches for qmlcachegen in qtbase/libexec which leads to the error
mkdir -p build/qt
cp ${./gui_gui_qmlcache.qrc} build/qt/gui_gui_qmlcache.qrc
make build
runHook postBuild
'';
postInstall = ''
install -m 755 -D -t $out/bin build/qt/release/${pname}
VERSION=${version} VENDOR_PATH=providers branding/scripts/generate-debian branding/templates/debian/data.json
(cd branding/templates/debian && ${python3Packages.python}/bin/python3 generate.py)
install -m 444 -D branding/templates/debian/app.desktop $out/share/applications/${pname}.desktop
install -m 444 -D providers/${provider}/assets/icon.svg $out/share/icons/hicolor/scalable/apps/${pname}.svg
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
install -m 444 -D -t $out/share/polkit-1/actions ${bitmask-root}/share/polkit-1/actions/se.leap.bitmask.policy
'';
# Some tests need access to the Internet:
# Post "https://api.black.riseup.net/3/cert": dial tcp: lookup api.black.riseup.net on [::1]:53: read udp [::1]:56553->[::1]:53: read: connection refused
doCheck = false;
passthru = { inherit bitmask-root; };
meta = {
description = "Generic VPN client by LEAP";
longDescription = ''
Bitmask, by LEAP (LEAP Encryption Access Project),
is an application to provide easy and secure encrypted communication
with a VPN (Virtual Private Network). It allows you to select from
a variety of trusted service provider all from one app.
Current providers include Riseup Networks
and The Calyx Institute, where the former is default.
The <literal>${pname}</literal> executable should appear
in your desktop manager's XDG menu or could be launch in a terminal
to get an execution log. A new icon should then appear in your systray
to control the VPN and configure some options.
'';
homepage = "https://bitmask.net";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ julm ];
# darwin requires apple_sdk >= 10.13
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/gui/build.sh b/gui/build.sh
index a858a81..ac43f52 100755
--- a/gui/build.sh
+++ b/gui/build.sh
@@ -94,6 +94,8 @@ function buildQmake {
mkdir -p $QTBUILD
$QMAKE -early QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX -o "$QTBUILD/Makefile" CONFIG+=release VENDOR_PATH="${VENDOR_PATH}" $PROJECT
#CONFIG=+force_debug_info CONFIG+=debug CONFIG+=debug_and_release
+ sed -i 's|@qtbase@/libexec/qmlcachegen|@qtdeclarative@/libexec/qmlcachegen|g' $QTBUILD/Makefile
+ sed -i 's|@qtbase@/bin/lrelease|@qttools@/bin/lrelease|g' $QTBUILD/Makefile
}
function renameOutput {

View File

@@ -0,0 +1,107 @@
<?xml version="1.0"?>
<RCC>
<qresource prefix="/">
<file alias="main.qml">../../gui/main.qml</file>
<file alias="qtquickcontrols2.conf">../../gui/qtquickcontrols2.conf</file>
<file alias="themes/themes.js">../../gui/themes/themes.js</file>
<file alias="themes/theme-riseup.js">../../gui/themes/theme-riseup.js</file>
<file alias="themes/Riseup.qml">../../gui/themes/Riseup.qml</file>
<file alias="themes/theme-calyx.js">../../gui/themes/theme-calyx.js</file>
<file alias="themes/Calyx.qml">../../gui/themes/Calyx.qml</file>
<file alias="themes/Bitmask.qml">../../gui/themes/Bitmask.qml</file>
<file alias="themes/ThemeObject.qml">../../gui/themes/ThemeObject.qml</file>
<file alias="components/MainView.qml">../../gui/components/MainView.qml</file>
<file alias="components/ThemedPage.qml">../../gui/components/ThemedPage.qml</file>
<file alias="components/Splash.qml">../../gui/components/Splash.qml</file>
<file alias="components/FadeBehavior.qml">../../gui/components/FadeBehavior.qml</file>
<file alias="components/Home.qml">../../gui/components/Home.qml</file>
<file alias="components/Header.qml">../../gui/components/Header.qml</file>
<file alias="components/Footer.qml">../../gui/components/Footer.qml</file>
<file alias="components/About.qml">../../gui/components/About.qml</file>
<file alias="components/MaterialRadioButton.qml">../../gui/components/MaterialRadioButton.qml</file>
<file alias="components/MaterialRadioIndicator.qml">../../gui/components/MaterialRadioIndicator.qml</file>
<file alias="components/WrappedRadioButton.qml">../../gui/components/WrappedRadioButton.qml</file>
<file alias="components/MaterialCheckBox.qml">../../gui/components/MaterialCheckBox.qml</file>
<file alias="components/StatusBox.qml">../../gui/components/StatusBox.qml</file>
<file alias="components/Systray.qml">../../gui/components/Systray.qml</file>
<file alias="components/Help.qml">../../gui/components/Help.qml</file>
<file alias="components/Locations.qml">../../gui/components/Locations.qml</file>
<file alias="components/SignalIcon.qml">../../gui/components/SignalIcon.qml</file>
<file alias="components/Preferences.qml">../../gui/components/Preferences.qml</file>
<file alias="components/BoldLabel.qml">../../gui/components/BoldLabel.qml</file>
<file alias="components/LightLabel.qml">../../gui/components/LightLabel.qml</file>
<file alias="components/VPNButtonBase.qml">../../gui/components/VPNButtonBase.qml</file>
<file alias="components/VPNMouseArea.qml">../../gui/components/VPNMouseArea.qml</file>
<file alias="components/VerticalSpacer.qml">../../gui/components/VerticalSpacer.qml</file>
<file alias="components/Icon.qml">../../gui/components/Icon.qml</file>
<file alias="components/VPNState.qml">../../gui/components/VPNState.qml</file>
<file alias="components/InitErrors.qml">../../gui/components/InitErrors.qml</file>
<file alias="components/ErrorBox.qml">../../gui/components/ErrorBox.qml</file>
<file alias="components/MotdBox.qml">../../gui/components/MotdBox.qml</file>
<file alias="resources/icon-noshield.svg">../../gui/resources/icon-noshield.svg</file>
<file alias="resources/location.svg">../../gui/resources/location.svg</file>
<file alias="resources/settings.svg">../../gui/resources/settings.svg</file>
<file alias="resources/power.svg">../../gui/resources/power.svg</file>
<file alias="resources/language.svg">../../gui/resources/language.svg</file>
<file alias="resources/lightning.svg">../../gui/resources/lightning.svg</file>
<file alias="resources/close.svg">../../gui/resources/close.svg</file>
<file alias="resources/donate.svg">../../gui/resources/donate.svg</file>
<file alias="resources/tools.svg">../../gui/resources/tools.svg</file>
<file alias="resources/help.svg">../../gui/resources/help.svg</file>
<file alias="resources/about.svg">../../gui/resources/about.svg</file>
<file alias="resources/bridge.svg">../../gui/resources/bridge.svg</file>
<file alias="resources/gear-fill.svg">../../gui/resources/gear-fill.svg</file>
<file alias="resources/reception-0.svg">../../gui/resources/reception-0.svg</file>
<file alias="resources/reception-2.svg">../../gui/resources/reception-2.svg</file>
<file alias="resources/reception-4.svg">../../gui/resources/reception-4.svg</file>
<file alias="resources/reception-0@24.svg">../../gui/resources/reception-0@24.svg</file>
<file alias="resources/reception-4@24.svg">../../gui/resources/reception-4@24.svg</file>
<file alias="resources/arrow-left.svg">../../gui/resources/arrow-left.svg</file>
<file alias="resources/globe.svg">../../gui/resources/globe.svg</file>
<file alias="resources/spy.gif">../../gui/resources/spy.gif</file>
<file alias="resources/quit.svg">../../gui/resources/quit.svg</file>
<file alias="resources/alert.svg">../../gui/resources/alert.svg</file>
<file alias="resources/angle-right.svg">../../gui/resources/angle-right.svg</file>
<file alias="resources/snowflake.svg">../../gui/resources/snowflake.svg</file>
<file alias="resources/button_green.png">../../gui/resources/button_green.png</file>
<file alias="resources/button_yellow.png">../../gui/resources/button_yellow.png</file>
<file alias="resources/button_red.png">../../gui/resources/button_red.png</file>
<file alias="resources/ravens.svg">../../gui/resources/ravens.svg</file>
<file alias="resources/ravens.gif">../../gui/resources/ravens.gif</file>
<file alias="resources/riseup-icon.svg">../../gui/resources/riseup-icon.svg</file>
<file alias="resources/riseup_connected_bg.png">../../gui/resources/riseup_connected_bg.png</file>
<file alias="resources/riseup_connecting_bg.png">../../gui/resources/riseup_connecting_bg.png</file>
<file alias="resources/riseup_disconnected_bg.png">../../gui/resources/riseup_disconnected_bg.png</file>
<file alias="resources/riseup_green_shield.svg">../../gui/resources/riseup_green_shield.svg</file>
<file alias="resources/calyx/calyx-shield-green.png">../../gui/resources/calyx/calyx-shield-green.png</file>
<file alias="resources/calyx/calyx-hand.png">../../gui/resources/calyx/calyx-hand.png</file>
<file alias="resources/calyx/calyx-red-shield.png">../../gui/resources/calyx/calyx-red-shield.png</file>
<file alias="resources/calyx/calyx-yellow-shield.png">../../gui/resources/calyx/calyx-yellow-shield.png</file>
<file alias="resources/bitmask/splash_logo.png">../../gui/resources/bitmask/splash_logo.png</file>
<file alias="resources/bitmask/state_connected.png">../../gui/resources/bitmask/state_connected.png</file>
<file alias="resources/bitmask/state_connecting.png">../../gui/resources/bitmask/state_connecting.png</file>
<file alias="resources/bitmask/state_disconnected.png">../../gui/resources/bitmask/state_disconnected.png</file>
<file alias="resources/bitmask/bitmask_connected_bg.png">../../gui/resources/bitmask/bitmask_connected_bg.png</file>
<file alias="resources/bitmask/bitmask_connecting_bg.png">../../gui/resources/bitmask/bitmask_connecting_bg.png</file>
<file alias="resources/bitmask/bitmask_disconnected_bg.png">../../gui/resources/bitmask/bitmask_disconnected_bg.png</file>
<file alias="poppins-regular.ttf">../../gui/resources/fonts/Poppins-Regular.ttf</file>
<file alias="poppins-bold.ttf">../../gui/resources/fonts/Poppins-Bold.ttf</file>
<file alias="monserrat-bold.ttf">../../gui/resources/fonts/Montserrat-SemiBold.ttf</file>
<file alias="roboto.ttf">../../gui/resources/fonts/Roboto-Regular.ttf</file>
<file alias="roboto-bold.ttf">../../gui/resources/fonts/Roboto-Bold.ttf</file>
<file alias="assets/icon/png/black/vpn_off.png">../../gui/assets/icon/png/black/vpn_off.png</file>
<file alias="assets/icon/png/black/vpn_on.png">../../gui/assets/icon/png/black/vpn_on.png</file>
<file alias="assets/icon/png/black/vpn_wait_0.png">../../gui/assets/icon/png/black/vpn_wait_0.png</file>
<file alias="assets/icon/png/black/vpn_wait_1.png">../../gui/assets/icon/png/black/vpn_wait_1.png</file>
<file alias="assets/icon/png/black/vpn_wait_2.png">../../gui/assets/icon/png/black/vpn_wait_2.png</file>
<file alias="assets/icon/png/black/vpn_wait_3.png">../../gui/assets/icon/png/black/vpn_wait_3.png</file>
<file alias="assets/icon/png/white/vpn_off.png">../../gui/assets/icon/png/white/vpn_off.png</file>
<file alias="assets/icon/png/white/vpn_on.png">../../gui/assets/icon/png/white/vpn_on.png</file>
<file alias="assets/icon/png/white/vpn_wait_0.png">../../gui/assets/icon/png/white/vpn_wait_0.png</file>
<file alias="assets/icon/png/white/vpn_wait_1.png">../../gui/assets/icon/png/white/vpn_wait_1.png</file>
<file alias="assets/icon/png/white/vpn_wait_2.png">../../gui/assets/icon/png/white/vpn_wait_2.png</file>
<file alias="assets/icon/png/white/vpn_wait_3.png">../../gui/assets/icon/png/white/vpn_wait_3.png</file>
<file alias="assets/img/bird.jpg">../../gui/assets/img/bird.jpg</file>
<file alias="providers.json">../../gui/providers/providers.json</file>
</qresource>
</RCC>