nixpkgs/pkgs/by-name/lo/logmein-hamachi/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

46 lines
1.5 KiB
Nix

{ lib, stdenv, fetchurl }:
let
arch =
if stdenv.hostPlatform.system == "x86_64-linux" then "x64"
else if stdenv.hostPlatform.system == "i686-linux" then "x86"
else throwSystem;
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
sha256 =
if stdenv.hostPlatform.system == "x86_64-linux" then "0zy0jzvdqccfsg42m2lq1rj8r2c4iypd1h9vxl9824cbl92yim37"
else if stdenv.hostPlatform.system == "i686-linux" then "03ml9xv19km99f0z7fpr21b1zkxvw7q39kjzd8wpb2pds51wnc62"
else throwSystem;
libraries = lib.makeLibraryPath [ stdenv.cc.cc ];
in stdenv.mkDerivation rec {
pname = "logmein-hamachi";
version = "2.1.0.203";
src = fetchurl {
url = "https://vpn.net/installers/${pname}-${version}-${arch}.tgz";
inherit sha256;
};
installPhase = ''
patchelf \
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
--set-rpath ${libraries} \
hamachid
install -D -m755 hamachid $out/bin/hamachid
ln -s $out/bin/hamachid $out/bin/hamachi
'';
dontStrip = true;
dontPatchELF = true;
meta = with lib; {
description = "Hosted VPN service that lets you securely extend LAN-like networks to distributed teams";
homepage = "https://secure.logmein.com/products/hamachi/";
changelog = "https://support.logmeininc.com/central/help/whats-new-in-hamachi";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfreeRedistributable;
maintainers = with maintainers; [ abbradar ];
platforms = platforms.linux;
};
}