Merge pull request #210764 from alyssais/mtdev-freebsd
mtdev: add FreeBSD support
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchurl }:
|
||||
{ lib, stdenv, fetchurl, evdev-proto }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mtdev";
|
||||
@@ -9,8 +9,10 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "1q700h9dqcm3zl6c3gj0qxxjcx6ibw2c51wjijydhwdcm26v5mqm";
|
||||
};
|
||||
|
||||
buildInputs = lib.optional stdenv.hostPlatform.isFreeBSD evdev-proto;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://bitmath.org/code/mtdev/";
|
||||
homepage = "https://bitmath.org/code/mtdev/";
|
||||
description = "Multitouch Protocol Translation Library";
|
||||
longDescription = ''
|
||||
The mtdev is a stand-alone library which transforms all variants of
|
||||
@@ -20,6 +22,6 @@ stdenv.mkDerivation rec {
|
||||
See the kernel documentation for further details.
|
||||
'';
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
platforms = with platforms; freebsd ++ linux;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
, makeScopeWithSplicing, generateSplicesForMkScope
|
||||
, buildPackages
|
||||
, bsdSetupHook, makeSetupHook
|
||||
, fetchgit, fetchurl, coreutils, groff, mandoc, byacc, flex, which, m4, gawk, substituteAll, runtimeShell
|
||||
, fetchgit, fetchzip, coreutils, groff, mandoc, byacc, flex, which, m4, gawk, substituteAll, runtimeShell
|
||||
, zlib, expat, libmd
|
||||
, runCommand, writeShellScript, writeText, symlinkJoin
|
||||
}:
|
||||
@@ -75,6 +75,11 @@ in makeScopeWithSplicing
|
||||
in {
|
||||
inherit freebsdSrc;
|
||||
|
||||
ports = fetchzip {
|
||||
url = "https://cgit.freebsd.org/ports/snapshot/ports-dde3b2b456c3a4bdd217d0bf3684231cc3724a0a.tar.gz";
|
||||
sha256 = "BpHqJfnGOeTE7tkFJBx0Wk8ryalmf4KNTit/Coh026E=";
|
||||
};
|
||||
|
||||
# Why do we have splicing and yet do `nativeBuildInputs = with self; ...`?
|
||||
# See note in ../netbsd/default.nix.
|
||||
|
||||
@@ -388,6 +393,12 @@ in makeScopeWithSplicing
|
||||
outputs = [ "out" "man" "test" ];
|
||||
};
|
||||
|
||||
sed = mkDerivation {
|
||||
path = "usr.bin/sed";
|
||||
TESTSRC = "${freebsdSrc}/contrib/netbsd-tests";
|
||||
MK_TESTS = "no";
|
||||
};
|
||||
|
||||
# Don't add this to nativeBuildInputs directly. Use statHook instead.
|
||||
stat = mkDerivation {
|
||||
path = "usr.bin/stat";
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
{ lib, stdenv, linuxHeaders, freebsd, runCommandCC, buildPackages }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "evdev-proto";
|
||||
inherit (linuxHeaders) version;
|
||||
|
||||
src = freebsd.ports;
|
||||
|
||||
sourceRoot = "source/devel/evdev-proto";
|
||||
|
||||
useTempPrefix = true;
|
||||
|
||||
nativeBuildInputs = [ freebsd.makeMinimal ];
|
||||
|
||||
ARCH = freebsd.makeMinimal.MACHINE_ARCH;
|
||||
OPSYS = "FreeBSD";
|
||||
_OSRELEASE = "${lib.versions.majorMinor freebsd.makeMinimal.version}-RELEASE";
|
||||
|
||||
AWK = "awk";
|
||||
CHMOD = "chmod";
|
||||
FIND = "find";
|
||||
MKDIR = "mkdir -p";
|
||||
PKG_BIN = "${buildPackages.pkg}/bin/pkg";
|
||||
RM = "rm -f";
|
||||
SED = "${buildPackages.freebsd.sed}/bin/sed";
|
||||
SETENV = "env";
|
||||
SH = "sh";
|
||||
TOUCH = "touch";
|
||||
XARGS = "xargs";
|
||||
|
||||
ABI_FILE = runCommandCC "abifile" {} "$CC -shared -o $out";
|
||||
CLEAN_FETCH_ENV = true;
|
||||
INSTALL_AS_USER = true;
|
||||
NO_CHECKSUM = true;
|
||||
NO_MTREE = true;
|
||||
SRC_BASE = freebsd.freebsdSrc;
|
||||
|
||||
preUnpack = ''
|
||||
export MAKE_JOBS_NUMBER="$NIX_BUILD_CORES"
|
||||
|
||||
export DISTDIR="$PWD/distfiles"
|
||||
export PKG_DBDIR="$PWD/pkg"
|
||||
export PREFIX="$prefix"
|
||||
|
||||
mkdir -p "$DISTDIR/evdev-proto"
|
||||
tar -C "$DISTDIR/evdev-proto" \
|
||||
-xf ${linuxHeaders.src} \
|
||||
--strip-components 4 \
|
||||
linux-${linuxHeaders.version}/include/uapi/linux
|
||||
'';
|
||||
|
||||
makeFlags = [ "DIST_SUBDIR=evdev-proto" ];
|
||||
|
||||
postInstall = ''
|
||||
mv $prefix $out
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Input event device header files for FreeBSD";
|
||||
maintainers = with maintainers; [ qyliss ];
|
||||
platforms = platforms.freebsd;
|
||||
license = licenses.gpl2Only;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{ lib, stdenv, fetchFromGitHub, m4, pkg-config, tcl
|
||||
, bzip2, libarchive, libbsd, lzma, openssl, zlib
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "pkg";
|
||||
version = "1.19.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "freebsd";
|
||||
repo = "pkg";
|
||||
rev = finalAttrs.version;
|
||||
sha256 = "W66g8kVvaPJSyOZcgyDcUBrWQQ5YDkRqofSWfIsjd+k=";
|
||||
};
|
||||
|
||||
setOutputFlags = false;
|
||||
separateDebugInfo = true;
|
||||
|
||||
nativeBuildInputs = [ m4 pkg-config tcl ];
|
||||
buildInputs = [ bzip2 libarchive lzma openssl zlib ]
|
||||
++ lib.optional stdenv.isLinux libbsd;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p $out/etc
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/freebsd/pkg";
|
||||
description = "Package management tool for FreeBSD";
|
||||
maintainers = with maintainers; [ qyliss ];
|
||||
platforms = with platforms; darwin ++ freebsd ++ linux ++ netbsd ++ openbsd;
|
||||
license = licenses.bsd2;
|
||||
};
|
||||
})
|
||||
@@ -5269,6 +5269,8 @@ with pkgs;
|
||||
|
||||
pika = callPackage ../applications/graphics/pika { };
|
||||
|
||||
pkg = callPackage ../tools/package-management/pkg { };
|
||||
|
||||
playerctl = callPackage ../tools/audio/playerctl { };
|
||||
|
||||
pn = callPackage ../tools/text/pn { };
|
||||
@@ -25402,6 +25404,8 @@ with pkgs;
|
||||
|
||||
erofs-utils = callPackage ../os-specific/linux/erofs-utils { };
|
||||
|
||||
evdev-proto = callPackage ../os-specific/bsd/freebsd/evdev-proto { };
|
||||
|
||||
fscryptctl = callPackage ../os-specific/linux/fscryptctl { };
|
||||
# unstable until the first 1.x release
|
||||
fscrypt-experimental = callPackage ../os-specific/linux/fscrypt { };
|
||||
|
||||
Reference in New Issue
Block a user