lol

vpcs: 0.8.2 -> 0.8.3, enable darwin support (#256458)

* vpcs: 0.8.2 -> 0.8.3

https://github.com/GNS3/vpcs/compare/v0.8.2...v0.8.3

* vpcs: enable darwin support

* vpcs: add anthonyroussel to maintainers

* vpcs: add passthru.tests.version

* vpcs: add meta.mainProgram

* vpcs: drop gcc

* vpcs: refactor

---------

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>

authored by

Anthony Roussel
Weijia Wang
and committed by
GitHub
1cf41e12 5d5d09d4

+38 -16
+38 -16
pkgs/applications/virtualization/vpcs/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub }: 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , testers 5 + , vpcs 6 + }: 2 7 3 - stdenv.mkDerivation rec { 8 + stdenv.mkDerivation (finalAttrs: { 4 9 pname = "vpcs"; 5 - version = "0.8.2"; 10 + version = "0.8.3"; 6 11 7 12 src = fetchFromGitHub { 8 13 owner = "GNS3"; 9 - repo = pname; 10 - rev = "v${version}"; 11 - sha256 = "sha256-joEXRMtNZMQumkYDX1gdpGAV+XdNKiAMj3dh1GZxeqc="; 14 + repo = "vpcs"; 15 + rev = "v${finalAttrs.version}"; 16 + hash = "sha256-OKi4sC4fmKtkJkkpHZ6OfeIDaBafVrJXGXh1R6gLPFY="; 12 17 }; 13 18 14 - buildPhase = ''( 15 - cd src 16 - ./mk.sh ${stdenv.buildPlatform.linuxArch} 17 - )''; 19 + sourceRoot = "${finalAttrs.src.name}/src"; 20 + 21 + buildPhase = '' 22 + runHook preBuild 23 + 24 + MKOPT="CC=${stdenv.cc.targetPrefix}cc" ./mk.sh ${stdenv.buildPlatform.linuxArch} 25 + 26 + runHook postBuild 27 + ''; 18 28 19 29 installPhase = '' 20 - install -D -m555 src/vpcs $out/bin/vpcs; 21 - install -D -m444 man/vpcs.1 $out/share/man/man1/vpcs.1; 30 + runHook preInstall 31 + 32 + install -D -m555 vpcs $out/bin/vpcs 33 + install -D -m444 ../man/vpcs.1 $out/share/man/man1/vpcs.1 34 + 35 + runHook postInstall 22 36 ''; 23 37 24 38 enableParallelBuilding = true; 25 39 40 + passthru = { 41 + tests.version = testers.testVersion { 42 + package = vpcs; 43 + command = "vpcs -v"; 44 + }; 45 + }; 46 + 26 47 meta = with lib; { 27 48 description = "A simple virtual PC simulator"; 28 49 longDescription = '' ··· 30 51 ping/traceroute them, or ping/traceroute the other hosts/routers from the 31 52 VPCS when you study the Cisco routers in the dynamips. 32 53 ''; 33 - inherit (src.meta) homepage; 54 + inherit (finalAttrs.src.meta) homepage; 34 55 license = licenses.bsd2; 35 - platforms = platforms.linux; 36 - maintainers = with maintainers; [ ]; 56 + platforms = platforms.linux ++ platforms.darwin; 57 + mainProgram = "vpcs"; 58 + maintainers = with maintainers; [ anthonyroussel ]; 37 59 }; 38 - } 60 + })