diff --git a/pkgs/by-name/ed/eddie/deps.nix b/pkgs/by-name/ed/eddie/deps.nix new file mode 100644 index 0000000000000..d56288265e839 --- /dev/null +++ b/pkgs/by-name/ed/eddie/deps.nix @@ -0,0 +1,11 @@ +# This file was automatically generated by passthru.fetch-deps. +# Please dont edit it manually, your changes might get overwritten! + +{ fetchNuGet }: +[ + (fetchNuGet { + pname = "Microsoft.CSharp"; + version = "4.7.0"; + hash = "sha256-Enknv2RsFF68lEPdrf5M+BpV1kHoLTVRApKUwuk/pj0="; + }) +] diff --git a/pkgs/by-name/ed/eddie/dont-set-rpath-in-eddie-tray.patch b/pkgs/by-name/ed/eddie/dont-set-rpath-in-eddie-tray.patch new file mode 100644 index 0000000000000..fffc21171e838 --- /dev/null +++ b/pkgs/by-name/ed/eddie/dont-set-rpath-in-eddie-tray.patch @@ -0,0 +1,24 @@ +From 53cca427a5a64ee3496348007b3e58f0d1a5031f Mon Sep 17 00:00:00 2001 +From: Pavel Sobolev +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 + diff --git a/pkgs/by-name/ed/eddie/package.nix b/pkgs/by-name/ed/eddie/package.nix new file mode 100644 index 0000000000000..d2de360787085 --- /dev/null +++ b/pkgs/by-name/ed/eddie/package.nix @@ -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; + }; +} diff --git a/pkgs/by-name/ed/eddie/remove-the-postbuild-from-the-project-file.patch b/pkgs/by-name/ed/eddie/remove-the-postbuild-from-the-project-file.patch new file mode 100644 index 0000000000000..7002b6beab1b5 --- /dev/null +++ b/pkgs/by-name/ed/eddie/remove-the-postbuild-from-the-project-file.patch @@ -0,0 +1,27 @@ +From 243cfaf1847aab4510da0df7cf59941b1d358062 Mon Sep 17 00:00:00 2001 +From: Pavel Sobolev +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 @@ + + + +- +- +- +- +- + +\ No newline at end of file +-- +2.45.2 +