Skip to content

Commit

Permalink
vpcs: fix build with glibc 2.26
Browse files Browse the repository at this point in the history
Tracking issue: #31696
  • Loading branch information
orivej committed Nov 16, 2017
1 parent 2318223 commit 41e0d4b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkgs/applications/virtualization/vpcs/default.nix
Expand Up @@ -6,26 +6,27 @@ stdenv.mkDerivation rec {
version = "0.8";

src = fetchurl {
name = "${name}.tar.bz2";
url = "mirror://sourceforge/project/${pname}/${version}/${name}-src.tbz";
sha256 = "14y9nflcyq486vvw0na0fkfmg5dac004qb332v4m5a0vaz8059nw";
};

unpackCmd = "tar -xjf $src";
patches = [ ./vpcs-0.8-glibc-2.26.patch ];

buildInputs = [ glibc.static ];

buildPhase = ''
buildPhase = ''(
cd src
./mk.sh ${buildPlatform.platform.kernelArch}
'';
)'';

installPhase = ''
cd ..
install -D -m555 src/vpcs $out/bin/vpcs;
install -D -m444 man/vpcs.1 $out/share/man/man1/vpcs.1;
'';

enableParallelBuilding = true;

meta = with stdenv.lib; {
description = "Virtual PC simulator";
longDescription = ''
Expand Down
14 changes: 14 additions & 0 deletions pkgs/applications/virtualization/vpcs/vpcs-0.8-glibc-2.26.patch
@@ -0,0 +1,14 @@
diff --git a/src/getopt.h b/src/getopt.h
index 4394aa2..bf59e10 100644
--- a/src/getopt.h
+++ b/src/getopt.h
@@ -49,9 +49,6 @@ extern int optind;
extern int opterr;
extern int optopt;

-#ifndef FreeBSD
-int getopt(int argc, char** argv, char* optstr);
-#endif
int arg_to_int(const char* arg, int min, int max, int defalt);

#ifdef __cplusplus

0 comments on commit 41e0d4b

Please sign in to comment.