8 isCross = !stdenv.buildPlatform.canExecute stdenv.hostPlatform;
9 isStatic = stdenv.hostPlatform.isStatic;
10 isMusl = stdenv.hostPlatform.isMusl;
13 stdenv.mkDerivation rec {
18 url = "http://dist.schmorp.de/libptytty/${pname}-${version}.tar.gz";
19 sha256 = "1xrikmrsdkxhdy9ggc0ci6kg5b1hn3bz44ag1mk5k1zjmlxfscw0";
22 nativeBuildInputs = [ cmake ];
24 cmakeFlags = lib.optional isStatic "-DBUILD_SHARED_LIBS=OFF"
25 ++ lib.optional (isCross || isStatic) "-DTTY_GID_SUPPORT=OFF"
26 # Musl lacks UTMP/WTMP built-in support
27 ++ lib.optionals isMusl [
30 "-DLASTLOG_SUPPORT=OFF"
34 description = "OS independent and secure pty/tty and utmp/wtmp/lastlog";
35 homepage = "http://dist.schmorp.de/libptytty";
36 maintainers = with maintainers; [ rnhmjoj ];
37 platforms = platforms.unix;
38 license = licenses.gpl2;
39 # pkgsMusl.pkgsStatic errors as:
40 # ln: failed to create symbolic link './include': File exists
41 broken = isStatic && isMusl;