Skip to content

Commit

Permalink
eddie: init at 2.24.2
Browse files Browse the repository at this point in the history
  • Loading branch information
paveloom committed Aug 5, 2024
1 parent e34add5 commit 93a8f78
Show file tree
Hide file tree
Showing 4 changed files with 206 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/by-name/ed/eddie/deps.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions pkgs/by-name/ed/eddie/dont-set-rpath-in-eddie-tray.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 53cca427a5a64ee3496348007b3e58f0d1a5031f Mon Sep 17 00:00:00 2001
From: Pavel Sobolev <[email protected]>
Date: Sun, 4 Aug 2024 21:07:04 +0300
Subject: [PATCH] Don't set `RPATH` in `eddie-tray`.

---
src/App.Forms.Linux.Tray/build.sh | 1 -
1 file changed, 1 deletion(-)

diff --git a/src/App.Forms.Linux.Tray/build.sh b/src/App.Forms.Linux.Tray/build.sh
index 771b2c7..bc1093c 100755
--- a/src/App.Forms.Linux.Tray/build.sh
+++ b/src/App.Forms.Linux.Tray/build.sh
@@ -35,7 +35,6 @@ g++ "$BASEPATH/main.cpp" -fPIC -o "$BASEPATH/bin/eddie-tray" `pkg-config --cflag

strip -S --strip-unneeded "$BASEPATH/bin/eddie-tray"
chmod a+x "$BASEPATH/bin/eddie-tray"
-patchelf --set-rpath '$ORIGIN' "$BASEPATH/bin/eddie-tray"

echo "Building eddie-tray - Done"
exit 0
--
2.45.2

144 changes: 144 additions & 0 deletions pkgs/by-name/ed/eddie/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
lib,
buildDotnetModule,
fetchFromGitHub,
dotnetCorePackages,

gcc,
makeWrapper,
msbuild,
pkg-config,

curl,
gtk3,
libayatana-appindicator,

openssh,
openvpn,
stunnel,

gtk2,
libayatana-indicator,

mono,

eddie,
testers,
}:

buildDotnetModule rec {
pname = "eddie";
version = "2.24.2";

src = fetchFromGitHub {
owner = "AirVPN";
repo = "Eddie";
# Upstream uses the summaries of commits for
# specifying the versions of experimental builds
rev = "c201d5605664e3a22db4af1b2b038aaba9a50211";
hash = "sha256-5UUi7N/+bUPKJcGk+viAmOvCLPZxvNrN1Qouc6Ecynw=";
};

patches = [
./dont-set-rpath-in-eddie-tray.patch
./remove-the-postbuild-from-the-project-file.patch
];

projectFile = [ "src/App.CLI.Linux/App.CLI.Linux.net7.csproj" ];
nugetDeps = ./deps.nix;

dotnet-sdk = dotnetCorePackages.sdk_7_0;
dotnet-runtime = dotnetCorePackages.runtime_7_0;

nativeBuildInputs = [
gcc
makeWrapper
msbuild
pkg-config
];

buildInputs = [
curl
gtk3
libayatana-appindicator
];

nativeRuntimeInputs = lib.makeBinPath [
openssh
openvpn
stunnel
];

runtimeInputs = lib.makeLibraryPath [
gtk2
gtk3
libayatana-indicator
];

makeWrapperArgs = [
"--add-flags \"--path.resources=${placeholder "out"}/share/eddie-ui\""
"--prefix PATH : ${nativeRuntimeInputs}"
];

executables = [ "eddie-cli" ];

postPatch = ''
patchShebangs src
'';

postBuild = ''
src/App.CLI.Linux.Elevated/build.sh Release
src/Lib.Platform.Linux.Native/build.sh Release
src/App.Forms.Linux.Tray/build.sh Release
msbuild \
-v:minimal \
-p:Configuration=Release \
-p:TargetFrameworkVersion=v4.8 \
-p:DefineConstants="EDDIEMONO4LINUX" \
src/App.Forms.Linux/App.Forms.Linux.sln
'';

postInstall = ''
mkdir -p $out/lib/eddie-ui
mkdir -p $out/share/{applications,eddie-ui}
cp src/App.CLI.Linux.Elevated/bin/eddie-cli-elevated $out/lib/eddie-ui
cp src/Lib.Platform.Linux.Native/bin/libLib.Platform.Linux.Native.so $out/lib/eddie-ui
cp src/App.Forms.Linux.Tray/bin/eddie-tray $out/lib/eddie-ui
ln -s $out/lib/eddie-ui/eddie-cli-elevated $out/lib/eddie/eddie-cli-elevated
ln -s $out/lib/eddie-ui/libLib.Platform.Linux.Native.so $out/lib/eddie/Lib.Platform.Linux.Native.so
cp -r src/App.Forms.Linux/bin/*/Release/* $out/lib/eddie-ui
chmod +x $out/lib/eddie-ui/App.Forms.Linux.exe
cp -r resources/* $out/share/eddie-ui
cp -r repository/linux_arch/bundle/eddie-ui/usr/share/{applications,pixmaps,polkit-1} $out/share
substituteInPlace \
$out/share/{applications/eddie-ui.desktop,polkit-1/actions/org.airvpn.eddie.ui.elevated.policy} \
--replace-fail /usr $out
makeWrapper "${mono}/bin/mono" $out/bin/eddie-ui \
--add-flags $out/lib/eddie-ui/App.Forms.Linux.exe \
--prefix LD_LIBRARY_PATH : ${runtimeInputs} \
''${makeWrapperArgs[@]}
'';

passthru = {
tests.version = testers.testVersion {
package = eddie;
command = "eddie-cli version.short";
};
};

meta = with lib; {
description = "AirVPN's OpenVPN and WireGuard wrapper";
homepage = "https://eddie.website";
license = licenses.gpl3Plus;
mainProgram = "eddie-ui";
maintainers = with maintainers; [ paveloom ];
platforms = platforms.linux;
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 243cfaf1847aab4510da0df7cf59941b1d358062 Mon Sep 17 00:00:00 2001
From: Pavel Sobolev <[email protected]>
Date: Sun, 4 Aug 2024 17:21:18 +0300
Subject: [PATCH] Remove the postbuild from the project file.

---
src/App.CLI.Linux/App.CLI.Linux.net7.csproj | 5 -----
1 file changed, 5 deletions(-)

diff --git a/src/App.CLI.Linux/App.CLI.Linux.net7.csproj b/src/App.CLI.Linux/App.CLI.Linux.net7.csproj
index c72f41f..a08a536 100644
--- a/src/App.CLI.Linux/App.CLI.Linux.net7.csproj
+++ b/src/App.CLI.Linux/App.CLI.Linux.net7.csproj
@@ -50,9 +50,4 @@
<ProjectReference Include="..\Lib.Core\Lib.Core.net7.csproj" />
<ProjectReference Include="..\Lib.Platform.Linux\Lib.Platform.Linux.net7.csproj" />
</ItemGroup>
-
- <Target Name="LinuxPostBuild" AfterTargets="PostBuildEvent">
- <Exec Command="$(ProjectDir)/postbuild.sh &quot;$(TargetDir)&quot; $(RuntimeIdentifier) $(ConfigurationName)" />
- </Target>
-
</Project>
\ No newline at end of file
--
2.45.2

0 comments on commit 93a8f78

Please sign in to comment.